Skip to content

Commit db851b8

Browse files
authored
Merge pull request #32 from xdoardo/cheriot-runner
2 parents 48b66f7 + 5113ec4 commit db851b8

File tree

21 files changed

+1482
-6
lines changed

21 files changed

+1482
-6
lines changed

.cirrus.yml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ pr_check_commits_task:
3030
fi
3131
3232
x_check_task:
33-
skip: $CIRRUS_PR == ""
34-
name: (PR) Run ./x check
33+
name: Run ./x check
3534
# TODO(xdoardo): Figure out when it makes sense to have this dependency, or
3635
# how that dependency should actually work. Having this dependency would
3736
# pretty much mean making every PR that merges changes on `beta` to `master`
@@ -65,10 +64,9 @@ x_check_task:
6564
ui_test_script: CC="clang" CXX="clang++" ./x test ui
6665

6766
build_core_task:
68-
skip: $CIRRUS_PR == ""
69-
name: (PR) Build `core` library for `riscv32cheriot-unknown-cheriotrtos`
67+
name: Build `core` library for `riscv32cheriot-unknown-cheriotrtos`
7068
depends_on:
71-
- (PR) Run ./x check
69+
- Run ./x check
7270
timeout_in: 240m
7371
gce_instance: &arm_vm
7472
image_project: ubuntu-os-cloud
@@ -93,4 +91,41 @@ build_core_task:
9391
pull_master_script: git fetch origin master
9492
build_script: CC="clang" CXX="clang++" ./x build compiler std --target=riscv32cheriot-unknown-cheriotrtos
9593

94+
run_cheri_tests_task:
95+
name: Run CHERIoT-specific tests
96+
depends_on:
97+
- Build `core` library for `riscv32cheriot-unknown-cheriotrtos`
98+
timeout_in: 240m
99+
gce_instance: &arm_vm
100+
image_project: ubuntu-os-cloud
101+
image_family: ubuntu-2404-lts-arm64
102+
architecture: arm64
103+
zone: us-east1-b
104+
type: c4a-standard-16
105+
disk: 60
106+
spot: true
107+
env:
108+
CIRRUS_CLONE_DEPTH: 0
109+
CARGO_HOME: /tmp/cargo
110+
RUSTUP_HOME: /tmp/cargo
111+
XMAKE_ROOT: "y"
112+
113+
dependencies_script:
114+
- set -eo pipefail
115+
- apt-get update
116+
- apt-get install -y clang ninja-build lld cmake ccache perl opam z3 libgmp-dev
117+
install_xmake_script: curl -fsSL https://xmake.io/shget.text | bash || true # The installer will fail without any informations.
118+
verify_xmake_script: /root/.local/bin/xmake -v
119+
install_rust_script: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y && . "$CARGO_HOME/env"
120+
verify_rust_script: . "$CARGO_HOME/env" && cargo --version
121+
build_sail_sim_script: git clone --recurse-submodules https://github.com/CHERIoT-Platform/cheriot-sail && cd cheriot-sail && opam init --reinit --bypass-check --disable-sandboxing --disable-shell-hook && eval $(opam env) && opam install sail --confirm-level=unsafe-yes && make csim && cp c_emulator/cheriot_sim /usr/local/bin
122+
gen_bootstrap_script: ./cheri/gen_bootstrap.sh --build-clang
123+
setup_env_script:
124+
- export CCACHE_REMOTE_STORAGE="http://${CIRRUS_HTTP_CACHE_HOST}/${CIRRUS_OS}/"
125+
- export CCACHE_REMOTE_ONLY=1
126+
- env
127+
pull_master_script: git fetch origin master
128+
build_rustc_script: CC="clang" CXX="clang++" ./x build compiler std --target=riscv32cheriot-unknown-cheriotrtos
129+
build_test_runner_script: cd ./cheri/tests/runner && . "$CARGO_HOME/env" && cargo build --release
130+
run_tests_script: cd ./cheri/tests && ./runner/target/release/cheriot-runner -vvvvv . --sysroot=../../build/host/llvm --rustc=../../build/host/stage1/bin/rustc --xmake=/root/.local/bin/xmake
96131
# -- End PR tasks

cheri/gen_bootstrap.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
FILE="bootstrap.toml"
44

5+
if [[ $1 = "--build-clang" ]]; then
6+
LLVM_PROJECTS=", LLVM_ENABLE_PROJECTS=\"clang;lld\""
7+
else
8+
LLVM_PROJECTS=""
9+
fi
10+
511
if [ -e "$FILE" ]; then
612
echo "$FILE already exists!"
713
exit 1
@@ -27,7 +33,7 @@ std-features = ["compiler-builtins-mem"]
2733
targets = "all"
2834
experimental-targets = ""
2935
download-ci-llvm = false
30-
build-config = {CMAKE_C_COMPILER="clang", CMAKE_CXX_COMPILER="clang++"}
36+
build-config = {CMAKE_C_COMPILER="clang", CMAKE_CXX_COMPILER="clang++" $LLVM_PROJECTS}
3137
3238
[target.riscv32cheriot-unknown-cheriotrtos]
3339
no-std = true

cheri/tests/runner/.gitignore

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# This file should only ignore things that are generated during a `x.py` build,
2+
# generated by common IDEs, and optional files controlled by the user that
3+
# affect the build (such as bootstrap.toml).
4+
# In particular, things like `mir_dump` should not be listed here; they are only
5+
# created during manual debugging and many people like to clean up instead of
6+
# having git ignore such leftovers. You can use `.git/info/exclude` to
7+
# configure your local ignore list.
8+
9+
## File system
10+
.DS_Store
11+
desktop.ini
12+
13+
## Editor
14+
*.swp
15+
*.swo
16+
Session.vim
17+
.cproject
18+
.idea
19+
*.iml
20+
.vscode
21+
.project
22+
.vim/
23+
.helix/
24+
.zed/
25+
.favorites.json
26+
.settings/
27+
.vs/
28+
.dir-locals.el
29+
30+
## Tool
31+
.valgrindrc
32+
.cargo
33+
# Included because it is part of the test case
34+
!/tests/run-make/thumb-none-qemu/example/.cargo
35+
36+
## Configuration
37+
/bootstrap.toml
38+
/config.toml
39+
/Makefile
40+
config.mk
41+
config.stamp
42+
no_llvm_build
43+
44+
## Build
45+
/dl/
46+
/doc/
47+
/inst/
48+
/llvm/
49+
/mingw-build/
50+
/build
51+
/build-rust-analyzer/
52+
/dist/
53+
/unicode-downloads
54+
/target
55+
/library/target
56+
/src/bootstrap/target
57+
/src/ci/citool/target
58+
/src/tools/x/target
59+
# Created by `x vendor`
60+
/vendor
61+
# Created by default with `src/ci/docker/run.sh`
62+
/obj/
63+
# Created by nix dev shell / .envrc
64+
src/tools/nix-dev-shell/flake.lock
65+
66+
## ICE reports
67+
rustc-ice-*.txt
68+
69+
## Temporary files
70+
*~
71+
\#*
72+
\#*\#
73+
.#*
74+
75+
## Tags
76+
tags
77+
tags.*
78+
TAGS
79+
TAGS.*
80+
81+
## Python
82+
__pycache__/
83+
*.py[cod]
84+
*$py.class
85+
86+
## Node
87+
node_modules
88+
/src/doc/rustc-dev-guide/mermaid.min.js
89+
90+
## Rustdoc GUI tests
91+
tests/rustdoc-gui/src/**.lock
92+
93+
## direnv
94+
/.envrc
95+
/.direnv/
96+
97+
## nix
98+
/flake.nix
99+
flake.lock
100+
/default.nix
101+
102+
# Before adding new lines, see the comment at the top.

0 commit comments

Comments
 (0)