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-python-export.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-python-export.py` 36 lines ยท 2888 bytes Raw Blame History 1 #!/usr/bin/env python3 2 """Host build orchestration only; all exporter computation is seeded Omega (#627).""" 3 from pathlib import Path 4 import hashlib,json,os,struct,subprocess,tempfile 5 ROOT=Path(__file__).resolve().parents[2] 6 build=ROOT/'build/L627/export' 7 for p in [ROOT/'build',ROOT/'build/L627',build]: 8 if p.is_symlink():raise SystemExit('PY_EXPORT_UNSAFE_BUILD_PATH') 9 build.mkdir(parents=True,exist_ok=True) 10 # Same source-only #621 construction path and pinned bridge-seed compiler as the C importer. 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,'PY_EXPORT_COMPILER_PIN_MISMATCH' 16 # Unchanged reviewed #621 SHA256 vendor and decoder core (envelope validation), then the exporter. 17 parts=[ROOT/'src/source-aware/vendor/sha256.om',ROOT/'src/source-aware/core.om',ROOT/'src/adapters/python-u64-export.om'] 18 program=b'\n'.join(p.read_bytes() for p in parts)+b'\n' 19 subprocess.run(['sha256sum','-c','tools/source-aware/imports.sha256'],cwd=ROOT,check=True,stdout=subprocess.PIPE) 20 result=subprocess.run([str(compiler)],input=program,capture_output=True,timeout=60) 21 if result.returncode:raise SystemExit('PY_EXPORT_COMPILE_FAILED: '+result.stderr.decode(errors='replace')) 22 binary=result.stdout 23 assert len(binary)>64 and binary[:4]==b'\x7fELF' and struct.unpack_from('