-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux arm build #1465
Linux arm build #1465
Changes from 96 commits
b3a3a2d
a979d35
29af443
dd37d20
b93c27d
84073b0
3a8b46a
0ee1260
2031b4d
0bc6ab8
13de166
5c215ee
314d32f
bed8ec6
e0b7845
ec86b31
10dfcce
bd18c74
1007790
56009d9
2b9f43e
2894565
c25b034
1e23596
aadc302
6776237
bd2497f
eae3ab5
071d0a9
120b8bb
78daf08
461b6a2
b27c925
b51f469
ec81b5b
37e210f
c1b3c38
7c92287
85d4520
d47a2e4
3b51e67
3e0b474
fb866a8
0c7d709
abfcc56
0c12e3e
6994d46
aa00ccc
3e02887
d0d7804
c467213
0b58c2e
8dfaddf
f36d346
ae58975
e0ed1bc
62f5f7f
a29b0c2
c56b7ce
883ade8
674a81f
3688701
82460b1
6ae0ab0
c012cff
2379f28
7ff8995
9d239b1
fb346e2
db0bec1
8927901
1a680bf
d410985
19dbc00
1e34a3b
3a643d9
b2a8277
32ef99b
973b3ab
f434b27
4f4fafb
04f6020
05ff967
12efeed
8104d1b
1103ed1
18b4c39
0895ff2
15c30fc
ce556e1
d4f71e5
a2625fb
75149fa
7313c56
1ab6b8f
759e845
70026e0
91c57a6
5faa34c
39a4b24
e21c239
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -e | ||
set -x | ||
|
||
if [ $# -lt 2 ] ; then | ||
echo "Usage: ./build-arm.sh <RUNNER OS> <PROJECT FILE>" | ||
exit 1 | ||
fi | ||
|
||
RUNNER_OS=$1 | ||
PROJECT_FILE=$2 | ||
|
||
# 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 --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" |
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 |
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ tikv-jemallocator = { version = "0.5.4", optional = true } | |
clap = { version = "4.3.21", features = ["derive", "env", "cargo"] } | ||
stable-eyre = "0.2.2" | ||
srclib = { version = "*", git = "https://github.com/fossas/foundation-libs" } | ||
snippets = { version = "0.1.3", git = "https://github.com/fossas/foundation-libs", features = ["lang-all"] } | ||
snippets = { version = "0.1.3", tag = "v0.1.3", git = "https://github.com/fossas/lib-snippets", features = ["lang-all"] } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this just something we missed updating previously? It doesn't seem related to this PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It isn't related directly. When I was trying to get the rust deps to build I was having trouble and for one of the issues I had I tried updating this library because I thought I might have to make some changes to it. I just kept this bit since it didn't seem to be hurting anything. If you feel strongly about it I can delete. |
||
traceconf = { git = "https://github.com/fossas/foundation-libs", version = "1.1.0" } | ||
serde = { version = "1.0.183", features = ["derive"] } | ||
thiserror = "1.0.46" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting rid of the second attempt at a build that we used to do, like this:
Just double-checking that this is not something we want to keep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is. Honestly I don't think I've ever seen the issue in the comment before - I think it's a holdover from a while ago. We can always add it back in in the future if needed. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good to me. No need to leave it in if we don't need it, and it's easy to add back