-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add-notice-files-to-source-units
- Loading branch information
Showing
13 changed files
with
263 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[target.aarch64-unknown-linux-musl] | ||
rustflags = ["-C", "link-arg=-lgcc"] |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
set -x | ||
|
||
if [ $# -lt 2 ] ; then | ||
echo "Usage: ./build-arm.sh <RUNNER OS> <PROJECT FILE> [FEATURES]" | ||
exit 1 | ||
fi | ||
|
||
RUNNER_OS=$1 | ||
PROJECT_FILE=$2 | ||
FEATURES=$3 | ||
|
||
# Install rust tooling | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal | ||
. "/home/runner/.cargo/env" | ||
|
||
rustc -V | ||
cargo -V | ||
|
||
# Build Rust binaries | ||
cargo build ${FEATURES:+--features $FEATURES} --release | ||
|
||
cargo test --release | ||
|
||
# Validate that diagnose runs | ||
cargo run --release --bin diagnose -- walk --trace-spans none --trace-level info | ||
|
||
# Now do Haskell things | ||
./.github/workflows/scripts/build.sh "$RUNNER_OS" "$PROJECT_FILE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
set -x | ||
|
||
if [ $# -lt 2 ] ; then | ||
echo "Usage: ./build.sh <RUNNER OS> <PROJECT FILE>" | ||
exit 1 | ||
fi | ||
|
||
RUNNER_OS=$1 | ||
PROJECT_FILE=$2 | ||
|
||
make build-test-data | ||
|
||
# Does this need to run in the container? | ||
# It normally runs outside. | ||
git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
|
||
# With dist-newstyle caches: | ||
# Cabal mainly knows to recompile based on changes to files. | ||
# Tagging in git doesn't reliably change a file in a fixed location that cabal/GHC can track to indicate that there's a new tag. | ||
# For our release process, we merge to master, which builds (and may store a dist-newstyle cache), then push a release tag. | ||
# During the tag build, cabal/GHC may not realize that they have to rebuild the Version.hs file because the tag is invisible to it. | ||
# This line adds a comment to our version source file to prompt cabal/GHC to rebuild Version.hs. | ||
echo "{- $GITHUB_RUN_ID -}" >> src/App/Version.hs | ||
cabal update | ||
cabal build --project-file="$PROJECT_FILE" all | ||
cabal test --project-file="$PROJECT_FILE" unit-tests | ||
|
||
# Todo: Bring this back. | ||
# Test cabal-install. | ||
# This check ensures that QuickImport can use spectrometer as a library. | ||
# if [ "$RUNNER_OS" = 'Linux' ] ; then | ||
# cabal install --overwrite-policy=always --project-file="$PROJECT_FILE" --ghc-options="-Wwarn" | ||
# fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
set -x | ||
|
||
if [ $# -lt 2 ] ; then | ||
echo "Usage: ./compute_cache_key <RUNNER OS> <PROJECT FILE>" | ||
exit 1 | ||
fi | ||
|
||
RUNNER_OS=$1 | ||
PROJECT_FILE=$2 | ||
|
||
cabal --project-file="$PROJECT_FILE" update | ||
cabal --project-file="$PROJECT_FILE" build --dry-run | ||
jq '."install-plan"[]."id"' < dist-newstyle/cache/plan.json | sort > /tmp/cabal-cache-key | ||
echo "Install plan:" | ||
cat /tmp/cabal-cache-key | ||
|
||
if [ "$RUNNER_OS" = "macOS" ]; then | ||
PLAN_SUM=$(shasum -a256 /tmp/cabal-cache-key) | ||
else | ||
PLAN_SUM=$(sha256sum /tmp/cabal-cache-key) | ||
fi | ||
|
||
CABAL_CACHE_KEY="$(echo "$PLAN_SUM" | awk '{print $1}')" | ||
export CABAL_CACHE_KEY | ||
echo "Cabal cache key: $CABAL_CACHE_KEY" | ||
echo "cabal-cache-key=$CABAL_CACHE_KEY" >> "$GITHUB_OUTPUT" | ||
|
||
echo "Home dotfiles in container: $(ls -al ~/.*)" | ||
|
||
# Cleanup. Restoring this cache seems to fail if the directory already exists. | ||
rm -rf dist-newstyle |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters