Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ pr_check_commits_task:

# -- End PR tasks

x_check_task:
name: Run ./x check
alias: x_check
x_test_task:
name: Run ./x test
alias: x_test
# TODO(xdoardo): Figure out when it makes sense to have this dependency, or
# how that dependency should actually work. Having this dependency would
# pretty much mean making every PR that merges changes on `beta` to `master`
Expand All @@ -47,22 +47,21 @@ x_check_task:
dependencies_script:
- set -eo pipefail
- apt-get update
- apt-get install -y clang ninja-build lld cmake ccache perl
gen_bootstrap_script: ./cheri/gen_bootstrap.sh
- apt-get install -y pkg-config clang ninja-build lld cmake ccache perl libssl-dev
gen_bootstrap_script: ./cheri/gen_bootstrap.sh && cat bootstrap.toml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cat looks like it could be forgotten debugging code, is it meant to be here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's harmless and can give some insights if we see strange failures in the other tasks!

setup_env_script:
- echo "CCACHE_REMOTE_STORAGE=http://${CIRRUS_HTTP_CACHE_HOST}/${CIRRUS_OS}/" >> $CIRRUS_ENV
- echo "CCACHE_REMOTE_ONLY=1" >> $CIRRUS_ENV
check_env_script: env
pull_master_script: git fetch origin master:refs/remotes/origin/master
tidy_script: CC="clang" CXX="clang++" ./x test tidy
check_script: CC="clang" CXX="clang++" ./x check
ui_test_script: CC="clang" CXX="clang++" ./x test ui
rust_check_script: CC="clang" CXX="clang++" ./x check
rust_test_script: CC="clang" CXX="clang++" ./x test --skip src/tools/linkchecker --skip tests/rustdoc-ui --skip tests/run-make

build_core_task:
name: Build `core` library for `riscv32cheriot-unknown-cheriotrtos`
alias: build_core
depends_on:
- x_check
- x_test
timeout_in: 240m
env:
CIRRUS_CLONE_DEPTH: "1"
Expand Down
35 changes: 32 additions & 3 deletions cheri/gen_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,35 @@ elif [ -z "${CUSTOM_CMAKE_FLAGS+set}" ]; then
CUSTOM_CMAKE_FLAGS=""
fi

# Check if we're running CI for a PR to main.
if [ -n "${CIRRUS_BASE_BRANCH+set}" ]; then
if [ "$CIRRUS_BASE_BRANCH" == "main" ]; then
CHANNEL="nightly"
# We are seeing some faults unrelated to our changes when CI runs from
# main, specifically tied to gcc. When running like that (CI from main)
# we want to restrict the backend to LLVM and cranelift only, so that
# we don't get stuck on things that aren't our fault. Ideally, we
# should restore the normal behaviour once the error is fixed.
CODEGEN_BACKENDS="codegen-backends = [\"llvm\",\"cranelift\"]"
else
# TODO: change this to `dev` once we add rustfmt to the beta branch, so
# that fmt --check is part of the tests.
CHANNEL="beta"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be overkill, but we could create issues for these two TODOs when this PR is merged just so they don't get forgotten.

fi
# Otherwise we may be running for a direct push to main.
elif [ -n "${CIRRUS_BRANCH+set}" ]; then
if [ "$CIRRUS_BRANCH" == "main" ]; then
CHANNEL="nightly"

# See comment above.
CODEGEN_BACKENDS="codegen-backends = [\"llvm\",\"cranelift\"]"
else
CHANNEL="beta"
fi
else
CHANNEL="beta"
fi

if [ -e "$FILE" ]; then
echo "$FILE already exists!"
exit 1
Expand All @@ -26,14 +55,14 @@ cat > "$FILE" <<- EOF
# See bootstrap.example.toml for documentation of available options
#
profile = "compiler" # Includes one of the default files in src/bootstrap/defaults
change-id = 140732
change-id = "ignore"

[build]
ccache = true

[rust]
channel = "beta"
#codegen-backends = ["llvm"]
channel = "$CHANNEL"
$CODEGEN_BACKENDS
#debug = true
#debuginfo-level = 2
std-features = ["compiler-builtins-mem"]
Expand Down