Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/tools/adapters/build-go-u64.py # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / tools / adapters / build-go-u64.py` 37 lines ยท 3077 bytes Raw Blame History 1 #!/usr/bin/env python3 2 """Host build orchestration only; all Go importer/exporter computation is seeded Omega (#741).""" 3 from pathlib import Path 4 import hashlib,json,os,struct,subprocess,tempfile 5 ROOT=Path(__file__).resolve().parents[2] 6 build=ROOT/'build/L741' 7 for p in [ROOT/'build',build]: 8 if p.is_symlink():raise SystemExit('GO_ADAPTER_UNSAFE_BUILD_PATH') 9 build.mkdir(parents=True,exist_ok=True) 10 # Same source-only #621 construction path and pinned compiler as the C importer and C exporter. 11 subprocess.run(['bash','tools/source-aware/build'],cwd=ROOT,check=True,timeout=600,stdout=subprocess.PIPE) 12 compiler=ROOT/'build/L574/toolchain/build/bootstrap/omc' 13 verifier=ROOT/'build/L574/toolchain/tools/verify-elf.sh' 14 expected='`191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`' 15 assert compiler.is_file() and hashlib.sha256(compiler.read_bytes()).hexdigest()==expected,'GO_ADAPTER_COMPILER_PIN_MISMATCH' 16 subprocess.run(['sha256sum','-c','tools/source-aware/imports.sha256'],cwd=ROOT,check=True,stdout=subprocess.PIPE) 17 VENDOR='src/source-aware/vendor/sha256.om' 18 # The exporter decodes with the #621 v2 codec (source-aware-v2.md section 7), which accepts OMSA versions 1 and 2. 19 ARTIFACTS={'go-import':[VENDOR,'src/adapters/go-u64-import.om'], 20 'go-export':[VENDOR,'src/source-aware/core-v2.om','src/adapters/go-u64-export.om']} 21 report={'schema':'omega.go-u64.build.v1','compiler_sha256':expected,'seed_source_archive':'`0fc7d8662cb799e7c206b17c18ea4c3ec2b8fea9`','birth_seed':'`29b12760`', 22 'compiler_choice':'bridge-seed omc `191b776e`: the pinned compiler of the reviewed C importer and #621 codec; vendor SHA256 and the core-v2.om decoder compile unchanged under it; neither adapter needs argv', 23 'artifacts':{},'host_orchestration':'Python process/filesystem only; no Go/C/Rust/Python parser or compute fallback in native artifacts'} 24 with tempfile.TemporaryDirectory(prefix='.go-build-',dir=build) as temp: 25 t=Path(temp) 26 for name,parts in ARTIFACTS.items(): 27 program=b'\n'.join((ROOT/p).read_bytes() for p in parts)+b'\n' 28 result=subprocess.run([str(compiler)],input=program,capture_output=True,timeout=120) 29 if result.returncode:raise SystemExit(f'GO_ADAPTER_COMPILE_FAILED {name} rc={result.returncode}: '+result.stderr.decode(errors='replace')) 30 binary=result.stdout 31 assert len(binary)>64 and binary[:4]==b'\x7fELF' and struct.unpack_from('