Skip to content

Commit

Permalink
Test nix builds
Browse files Browse the repository at this point in the history
Installations on MacOS didn't properly work after 8ee7ab3 because MacOS
doesn't like the `-rpath=x` syntax.

The changed patch makes clang invocations compatible with both Linux and
MacOS. Added regression testing to CI so that we don't overlook issues
like this in the future.

Fixes #918

Co-authored-by: Zach Birenbaum <[email protected]>
  • Loading branch information
aaronmondal and Zach Birenbaum committed May 15, 2024
1 parent ba7ed50 commit 6183525
Show file tree
Hide file tree
Showing 7 changed files with 274 additions and 248 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,29 @@ jobs:
run: >
nix develop --impure --command
bash -c "cargo test --all --profile=smol"
installation:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-13, macos-14]
name: Installation / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
steps:

- name: Checkout
uses: >- # v4.1.1
actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Install Nix
uses: >- # v10
DeterminateSystems/nix-installer-action@de22e16c4711fca50c816cc9081563429d1cf563
- name: Cache Nix derivations
uses: >- # v4
DeterminateSystems/magic-nix-cache-action@fc6aaceb40b9845a02b91e059ec147e78d1b4e41
- name: Run build
run: >
nix build
10 changes: 5 additions & 5 deletions local-remote-execution/generated-cc/cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,18 @@ cc_toolchain_config(
coverage_link_flags = ["--coverage"],
cpu = "k8",
cxx_builtin_include_directories = [
"/nix/store/vqbgiwjvjbgypsfwgpdc78asxvx13lsm-clang-wrapper-18.1.5/resource-root/include",
"/nix/store/5ark5p94q2nwni9rkq9zqnfsyfv9y50w-clang-wrapper-18.1.5/resource-root/include",
"/nix/store/s3pvsv4as7mc8i2nwnk2hnsyi2qdj4bq-glibc-2.39-31-dev/include",
"/nix/store/vqbgiwjvjbgypsfwgpdc78asxvx13lsm-clang-wrapper-18.1.5/resource-root/share",
"/nix/store/5ark5p94q2nwni9rkq9zqnfsyfv9y50w-clang-wrapper-18.1.5/resource-root/share",
"/nix/store/csml9b5w7z51yc7hxgd2ax4m6vj36iyq-libcxx-18.1.5-dev/include/c++/v1",
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk",
],
cxx_flags = ["-std=c++14"],
dbg_compile_flags = ["-g"],
host_system_name = "x86_64-unknown-linux-gnu",
link_flags = [
"-fuse-ld=/nix/store/vqbgiwjvjbgypsfwgpdc78asxvx13lsm-clang-wrapper-18.1.5/bin/ld.mold",
"-B/nix/store/6fr9bp9drswk1azlcby44c97l9xiifbm-customClang/bin",
"-fuse-ld=/nix/store/5ark5p94q2nwni9rkq9zqnfsyfv9y50w-clang-wrapper-18.1.5/bin/ld.mold",
"-B/nix/store/d6x389rgl2x9b6dkwxc71grbzgmkr28c-customClang/bin",
"-Wl,-no-as-needed",
"-Wl,-z,relro,-z,now",
],
Expand Down Expand Up @@ -152,7 +152,7 @@ cc_toolchain_config(
"llvm-cov": "None",
"llvm-profdata": "None",
"cpp": "/usr/bin/cpp",
"gcc": "/nix/store/6fr9bp9drswk1azlcby44c97l9xiifbm-customClang/bin/customClang",
"gcc": "/nix/store/d6x389rgl2x9b6dkwxc71grbzgmkr28c-customClang/bin/customClang",
"dwp": "/nix/store/bmmczrsfycv4rradx0cy95vw0fwx9sm7-binutils-wrapper-2.41/bin/dwp",
"gcov": "None",
"nm": "/nix/store/bmmczrsfycv4rradx0cy95vw0fwx9sm7-binutils-wrapper-2.41/bin/nm",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
This file is generated by cc_configure and contains builtin include directories
that /nix/store/6fr9bp9drswk1azlcby44c97l9xiifbm-customClang/bin/customClang reported. This file is a dependency of every compilation action and
that /nix/store/d6x389rgl2x9b6dkwxc71grbzgmkr28c-customClang/bin/customClang reported. This file is a dependency of every compilation action and
changes to it will be reflected in the action cache key. When some of these
paths change, Bazel will make sure to rerun the action, even though none of
declared action inputs or the action commandline changes.

/nix/store/vqbgiwjvjbgypsfwgpdc78asxvx13lsm-clang-wrapper-18.1.5/resource-root/include
/nix/store/5ark5p94q2nwni9rkq9zqnfsyfv9y50w-clang-wrapper-18.1.5/resource-root/include
/nix/store/s3pvsv4as7mc8i2nwnk2hnsyi2qdj4bq-glibc-2.39-31-dev/include
/nix/store/vqbgiwjvjbgypsfwgpdc78asxvx13lsm-clang-wrapper-18.1.5/resource-root/share
/nix/store/5ark5p94q2nwni9rkq9zqnfsyfv9y50w-clang-wrapper-18.1.5/resource-root/share
/nix/store/csml9b5w7z51yc7hxgd2ax4m6vj36iyq-libcxx-18.1.5-dev/include/c++/v1
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
2 changes: 1 addition & 1 deletion local-remote-execution/generated-cc/cc/cc_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ set -eu


# Call the C++ compiler
/nix/store/6fr9bp9drswk1azlcby44c97l9xiifbm-customClang/bin/customClang "$@"
/nix/store/d6x389rgl2x9b6dkwxc71grbzgmkr28c-customClang/bin/customClang "$@"
Loading

0 comments on commit 6183525

Please sign in to comment.