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
omega-mv / research / atemporal / at0 / oracle / build.sh
| 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # Build the AT-0 reference oracle with a direct rustc invocation (no cargo, no crates). |
| 18 | # Usage: ./build.sh -> target/at0-oracle |
| 19 | # ./build.sh test -> builds and runs target/at0-oracle-test |
| 20 | set -eu |
| 21 | cd "$(dirname "$0")" |
| 22 | mkdir -p target |
| 23 | RUSTC_VERSION="$(rustc -V)" |
| 24 | RUSTC_HOST="$(rustc -vV | sed -n 's/^host: //p')" |
| 25 | FLAGS="--edition 2021 -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -C panic=abort -D warnings" |
| 26 | export AT0_RUSTC_VERSION="$RUSTC_VERSION" AT0_RUSTC_HOST="$RUSTC_HOST" AT0_BUILD_FLAGS="$FLAGS" |
| 27 | case "${1:-build}" in |
| 28 | build) |
| 29 | rustc $FLAGS --crate-name at0_oracle src/main.rs -o target/at0-oracle |
| 30 | echo "built target/at0-oracle with $RUSTC_VERSION ($RUSTC_HOST)" ;; |
| 31 | test) |
| 32 | # tests need unwinding panics; everything else identical |
| 33 | rustc --edition 2021 -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -D warnings --test --crate-name at0_oracle src/main.rs -o target/at0-oracle-test |
| 34 | ./target/at0-oracle-test "${2:-}" ;; |
| 35 | lib) |
| 36 | # compute crate alone, for the isolation gate (no main.rs, so no I/O layer) |
| 37 | rustc $FLAGS --crate-type lib --crate-name at0 src/at0/mod.rs -o target/libat0.rlib |
| 38 | echo "built target/libat0.rlib" ;; |
| 39 | *) echo "usage: $0 [build|test|lib]" >&2; exit 1 ;; |
| 40 | esac |