Skip to content
This repository was archived by the owner on May 9, 2022. It is now read-only.

Commit fad53a1

Browse files
committed
build: add build script: all.sh
This is the local build script I've been using and tweaking day-to-day. It should be relatively stable by now.
1 parent 40cd09e commit fad53a1

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

_hack_timestamp.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh -e
2+
3+
# See all.sh
4+
#
5+
# This works around cargo rebuilding sgx_unwind unnecessarily due to config.h.in* churn.
6+
# Run this before (and/or after) each relevant cargo invocation.
7+
8+
# See "Pinning SGX dependencies" in HACKING.md.
9+
# This revision should match the Rust SGX SDK revision we're pinned to.
10+
base='/root/.cargo/git/checkouts/incubator-teaclave-sgx-sdk-c63c8825343e87f0/b9d1bda/sgx_unwind/libunwind'
11+
12+
if test -e "$base"; then
13+
touch --reference "$base/configure.in" "$base/include/config.h.in" "$base/include/config.h.in~"
14+
else
15+
echo "$0: warning: missing $base"
16+
fi

all.sh

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/sh -e
2+
# Check, build, and test everything
3+
4+
echo "################################################################################"
5+
echo "# make enclaves"
6+
echo "################################################################################"
7+
for enclave in 'rtc_data_enclave' 'rtc_auth_enclave' 'rtc_exec_enclave'; do
8+
./_hack_timestamp.sh
9+
(cd "$enclave" && make)
10+
done
11+
12+
# TODO: doc --document-private-items
13+
for action in check build doc test; do
14+
15+
for root in rtc_tenclave rtc_data_enclave rtc_auth_enclave rtc_exec_enclave .; do
16+
17+
args=''
18+
case "$root $action" in
19+
20+
# Skip enclave tests: not supported yet.
21+
'rtc_'*'_enclave test') continue ;;
22+
23+
# Only the root project can build all targets, so far
24+
'. build') args='--all-targets' ;;
25+
26+
27+
# FIXME: Skip enclave docs for now: rustdoc doesn't support const_evaluatable_checked yet.
28+
# Issue: https://github.com/rust-lang/rust/issues/77647
29+
'rtc_'*'enclave doc') continue ;;
30+
31+
# FIXME: Only the rtc_types docs build successfully right now.
32+
'. doc') args='--no-deps --package rtc_types' ;;
33+
34+
# Skip documenting dependencies, by default
35+
*' doc') args='--no-deps' ;;
36+
37+
# rtc_tenclave can test, but only with --no-default-features
38+
'rtc_tenclave test') args='--no-default-features' ;;
39+
40+
esac
41+
42+
# Show a big banner to make it easier to find and re-run failing commands.
43+
echo "################################################################################"
44+
echo "# (cd $root && cargo $action $args)"
45+
echo "################################################################################"
46+
./_hack_timestamp.sh
47+
(cd "$root" && cargo "$action" $args)
48+
done
49+
50+
done
51+
52+
# Final timestamp reset, for good measure.
53+
./_hack_timestamp.sh

0 commit comments

Comments
 (0)