interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / research / atemporal / at1 / oracle / build.sh

47 lines · 2394 bytes Raw Blame History
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-1 reference oracle with a direct rustc invocation (no cargo, no crates).
18# Usage: ./build.sh -> target/at1-oracle
19# ./build.sh test -> builds and runs target/at1-oracle-test
20set -eu
21cd "$(dirname "$0")"
22mkdir -p target
23RUSTC_VERSION="$(rustc -V)"
24RUSTC_HOST="$(rustc -vV | sed -n 's/^host: //p')"
25FLAGS="--edition 2021 -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -C panic=abort -D warnings"
26# source provenance is captured at build time (AT0_RESULT_V2 section 7: the commit the
27# binary was built from, and whether this directory, the only source it compiles, had
28# uncommitted changes); a record from a dirty or non-git build says source_tree_clean NO
29SRC_COMMIT="$(git rev-parse HEAD 2>/dev/null || true)"
30SRC_CLEAN=NO
31if [ -n "$SRC_COMMIT" ] && [ -z "$(git status --porcelain -- . 2>/dev/null)" ]; then SRC_CLEAN=YES; fi
32export AT1_RUSTC_VERSION="$RUSTC_VERSION" AT1_RUSTC_HOST="$RUSTC_HOST" AT1_BUILD_FLAGS="$FLAGS"
33export AT1_SOURCE_COMMIT="$SRC_COMMIT" AT1_SOURCE_CLEAN="$SRC_CLEAN"
34case "${1:-build}" in
35 build)
36 rustc $FLAGS --crate-name at1_oracle src/main.rs -o target/at1-oracle
37 echo "built target/at1-oracle with $RUSTC_VERSION ($RUSTC_HOST)" ;;
38 test)
39 # tests need unwinding panics; everything else identical
40 rustc --edition 2021 -C opt-level=2 -C codegen-units=1 -C debuginfo=0 -D warnings --test --crate-name at1_oracle src/main.rs -o target/at1-oracle-test
41 ./target/at1-oracle-test "${2:-}" ;;
42 lib)
43 # compute crate alone, for the isolation gate (no main.rs, so no I/O layer)
44 rustc $FLAGS --crate-type lib --crate-name at1 src/at1/mod.rs -o target/libat1.rlib
45 echo "built target/libat1.rlib" ;;
46 *) echo "usage: $0 [build|test|lib]" >&2; exit 1 ;;
47esac