tricu

A lazy functional language based on Tree Calculus
Log | Files | Refs | README | LICENSE

float_fixture.py (1053B)


      1 """Stage complete immutable providers for binary64 artifact acceptance."""
      2 from bootstrap_archive import select_exports
      3 from bundle_dag import read
      4 from float_multiply import ROOT, sha
      5 
      6 
      7 def stage_providers(runner, workspace, support, aliases):
      8     records = {}
      9     for alias in aliases:
     10         bundle = (ROOT / 'test/fixtures/compiler-library.arboricx'
     11                   if alias in ('native_math', 'base') else support)
     12         exports = read(bundle)[3]
     13         names = [(name, name.split('.', 1)[1]) for name in exports
     14                  if name.startswith(alias + '.')]
     15         if not names:
     16             raise ValueError('missing complete fixture provider: ' + alias)
     17         selected = runner.root / ('provider-' + alias + '.arboricx')
     18         select_exports(bundle, selected, names)
     19         pin = runner.imported(selected, 'provider-' + alias)
     20         (workspace / (alias + '.tri')).write_text('!export * from ' + pin + '\n')
     21         records[alias] = dict(bundle_sha256=sha(bundle), selected_sha256=sha(selected), manifest=pin)
     22     return records