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-c-import.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-c-import.py` 31 lines ยท 2483 bytes Raw Blame History 1 #!/usr/bin/env python3 2 """Host build orchestration only; all importer computation is seeded Omega.""" 3 from pathlib import Path 4 import hashlib,json,os,struct,subprocess,tempfile 5 ROOT=Path(__file__).resolve().parents[2] 6 build=ROOT/'build/L589' 7 for p in [ROOT/'build',build]: 8 if p.is_symlink():raise SystemExit('C_IMPORT_UNSAFE_BUILD_PATH') 9 build.mkdir(parents=True,exist_ok=True) 10 # Reuse the exact upstream #621 source-only construction path and original 11 # bootstrap/ELF checks. No downloaded compiler or sibling mutable binary. 12 subprocess.run(['bash','tools/source-aware/build'],cwd=ROOT,check=True,timeout=120,stdout=subprocess.PIPE) 13 compiler=ROOT/'build/L574/toolchain/build/bootstrap/omc' 14 verifier=ROOT/'build/L574/toolchain/tools/verify-elf.sh' 15 expected='`191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`' 16 assert compiler.is_file() and hashlib.sha256(compiler.read_bytes()).hexdigest()==expected,'C_IMPORT_COMPILER_PIN_MISMATCH' 17 parts=[ROOT/'src/source-aware/vendor/sha256.om',ROOT/'src/adapters/c-u64-import.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('C_IMPORT_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('