diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 00000000000..e173df423a7 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,25 @@ +task: + name: freebsd + freebsd_instance: + image: freebsd-12-1-release-amd64 + setup_rust_script: + - pkg install -y curl git bash + - curl https://sh.rustup.rs -sSf --output rustup.sh + - sh rustup.sh --default-toolchain none -y --profile=minimal + cargo_bin_cache: + folder: ~/.cargo/bin + target_cache: + folder: target + prepare_script: + - . $HOME/.cargo/env + - git config --global user.email "user@example.com" + - git config --global user.name "User" + - ./prepare.sh + test_script: + - . $HOME/.cargo/env + - # Enable backtraces for easier debugging + - export RUST_BACKTRACE=1 + - # Reduce amount of benchmark runs as they are slow + - export COMPILE_RUNS=2 + - export RUN_RUNS=2 + - ./test.sh diff --git a/build.sh b/build.sh index 598ce35ecea..52bc21d0a17 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e # Settings @@ -34,13 +34,13 @@ done # Build cg_clif unset CARGO_TARGET_DIR unamestr=$(uname) -if [[ "$unamestr" == 'Linux' ]]; then +if [[ "$unamestr" == 'Linux' || "$unamestr" == "FreeBSD" ]]; then export RUSTFLAGS='-Clink-arg=-Wl,-rpath=$ORIGIN/../lib '$RUSTFLAGS elif [[ "$unamestr" == 'Darwin' ]]; then export RUSTFLAGS='-Csplit-debuginfo=unpacked -Clink-arg=-Wl,-rpath,@loader_path/../lib -Zosx-rpath-install-name '$RUSTFLAGS dylib_ext='dylib' else - echo "Unsupported os" + echo "Unsupported os $unamestr" exit 1 fi if [[ "$CHANNEL" == "release" ]]; then diff --git a/build_sysroot/build_sysroot.sh b/build_sysroot/build_sysroot.sh index 282ce4a582c..636aa5f3f3d 100755 --- a/build_sysroot/build_sysroot.sh +++ b/build_sysroot/build_sysroot.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Requires the CHANNEL env var to be set to `debug` or `release.` diff --git a/build_sysroot/prepare_sysroot_src.sh b/build_sysroot/prepare_sysroot_src.sh index d3b87e02ba8..d6e012148ac 100755 --- a/build_sysroot/prepare_sysroot_src.sh +++ b/build_sysroot/prepare_sysroot_src.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e cd "$(dirname "$0")" diff --git a/clean_all.sh b/clean_all.sh index b47efe72bce..a7bbeb05cac 100755 --- a/clean_all.sh +++ b/clean_all.sh @@ -1,4 +1,4 @@ -#!/bin/bash --verbose +#!/usr/bin/env bash set -e rm -rf target/ build/ build_sysroot/{sysroot_src/,target/,compiler-builtins/} perf.data{,.old} diff --git a/prepare.sh b/prepare.sh index 08e7cb18029..ee995ffcfa9 100755 --- a/prepare.sh +++ b/prepare.sh @@ -1,4 +1,4 @@ -#!/bin/bash --verbose +#!/usr/bin/env bash set -e rustup component add rust-src rustc-dev llvm-tools-preview diff --git a/scripts/cargo.sh b/scripts/cargo.sh index a3d6d303057..669d2d45b71 100755 --- a/scripts/cargo.sh +++ b/scripts/cargo.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash dir=$(dirname "$0") source "$dir/config.sh" diff --git a/scripts/config.sh b/scripts/config.sh index 834708aa9a6..e1f54e4a8b5 100644 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -3,7 +3,7 @@ set -e unamestr=$(uname) -if [[ "$unamestr" == 'Linux' ]]; then +if [[ "$unamestr" == 'Linux' || "$unamestr" == 'FreeBSD' ]]; then dylib_ext='so' elif [[ "$unamestr" == 'Darwin' ]]; then dylib_ext='dylib' diff --git a/scripts/rustup.sh b/scripts/rustup.sh index 430f5c469b4..694945a87c2 100755 --- a/scripts/rustup.sh +++ b/scripts/rustup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/scripts/test_bootstrap.sh b/scripts/test_bootstrap.sh index 15f97c867a1..5bc45488444 100755 --- a/scripts/test_bootstrap.sh +++ b/scripts/test_bootstrap.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e cd "$(dirname "$0")/../" diff --git a/scripts/tests.sh b/scripts/tests.sh index d37b57babe6..cfc0c3fe9bd 100755 --- a/scripts/tests.sh +++ b/scripts/tests.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/test.sh b/test.sh index 5ab10e0e905..e222adc7b80 100755 --- a/test.sh +++ b/test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e ./build.sh --sysroot none "$@"