-
Notifications
You must be signed in to change notification settings - Fork 127
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
Fix Cargo mismatch on MacOS build #974
Fix Cargo mismatch on MacOS build #974
Conversation
803f177
to
3dbbbad
Compare
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.
Reviewable status: 0 of 1 LGTMs obtained, and pending CI: pre-commit-checks (waiting on @aaronmondal)
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.
Oh this exposed a bunch of issues. Thanks a lot for looking into this.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: 0 of 1 LGTMs obtained, and pending CI: pre-commit-checks, and 4 discussions need to be resolved (waiting on @aaronmondal)
Suggestion:
to use the correct rust toolchain.
Fixes #948
Cargo.toml
line 8 at r1 (raw file):
version = "0.4.0" edition = "2021" rust-version = "1.78.0"
Let's defer this to another PR. It's correct that we want this to match, but the flake change impacts darwin alone and this change impacts the build for all architectures.
Once we have the current PR landed we can bump this and then start always keeping it in sync with the version in flake.nix
.
flake.nix
line 40 at r1 (raw file):
"x86_64-linux" "x86_64-darwin" "aarch64-linux"
Let's remove this as it's not part of the change.
flake.nix
line 93 at r1 (raw file):
then (crane.mkLib pkgs).overrideToolchain (stable-rust.default.override { targets = ["aarch64-apple-darwin"];
I was wondering why your PR succeeded even on the macos-13
runners which are x86_64-apple-darwin
, and I think it's because the GHA workflows there are not correct. We only invoke nix build
in:
nativelink/.github/workflows/nix.yaml
Line 84 in c0c09ed
installation: |
This means that with your current change things pass CI but won't work as intended because you'll be cross-compiling for aarch64-darwin
on any Mac, even on an x86_64-darwin
system.
The way to double check against this is to instead use nix run
in the installation workflow above and make the github action query whether the output of nix run
is:
error: the following required arguments were not provided:
<CONFIG_FILE>
Usage: nativelink <CONFIG_FILE>
For more information, try '--help'.
The above is what you'd get if the nativelink
executable worked. If it has been compiled for a different architecture this should create a segfault or raise an error like file not found
because of a mismatching dynamic loader.
a0187ce
to
865e3d7
Compare
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.
Reviewable status: 0 of 1 LGTMs obtained, and pending CI: Analyze (javascript-typescript), Analyze (python), Bazel Dev / ubuntu-22.04, Cargo Dev / macos-13, Cargo Dev / ubuntu-22.04, Installation / macos-13, Installation / macos-14, Installation / ubuntu-22.04, Local / ubuntu-22.04, Publish image, Publish nativelink-worker-lre-cc, Remote / large-ubuntu-22.04, asan / ubuntu-22.04, docker-compose-compiles-nativelink (20.04), docker-compose-compiles-nativelink (22.04), integration-tests (20.04), integration-tests (22.04), macos-13, pre-commit-checks, ubuntu-20.04 / stable, ubuntu-22.04, ubuntu-22.04 / stable, windows-2022 / stable, and 4 discussions need to be resolved (waiting on @aaronmondal)
-- commits
line 6 at r1:
Done.
flake.nix
line 40 at r1 (raw file):
Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…
Let's remove this as it's not part of the change.
Done.
flake.nix
line 93 at r1 (raw file):
Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…
I was wondering why your PR succeeded even on the
macos-13
runners which arex86_64-apple-darwin
, and I think it's because the GHA workflows there are not correct. We only invokenix build
in:nativelink/.github/workflows/nix.yaml
Line 84 in c0c09ed
installation: This means that with your current change things pass CI but won't work as intended because you'll be cross-compiling for
aarch64-darwin
on any Mac, even on anx86_64-darwin
system.The way to double check against this is to instead use
nix run
in the installation workflow above and make the github action query whether the output ofnix run
is:error: the following required arguments were not provided: <CONFIG_FILE> Usage: nativelink <CONFIG_FILE> For more information, try '--help'.
The above is what you'd get if the
nativelink
executable worked. If it has been compiled for a different architecture this should create a segfault or raise an error likefile not found
because of a mismatching dynamic loader.
Done.
Cargo.toml
line 8 at r1 (raw file):
Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…
Let's defer this to another PR. It's correct that we want this to match, but the flake change impacts darwin alone and this change impacts the build for all architectures.
Once we have the current PR landed we can bump this and then start always keeping it in sync with the version in
flake.nix
.
Done.
865e3d7
to
9a17700
Compare
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.
I believe you need to rebase. There was a CI issue with the pre-commit hooks.
Thanks a lot!
Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: 1 of 1 LGTMs obtained, and pending CI: Remote / large-ubuntu-22.04, pre-commit-checks
9a17700
to
d7007c5
Compare
The flake.nix uses the default crane toolchain on darwin. Override the default crane toolchain and specify the target to use the correct rust toolchain.
d7007c5
to
8a92417
Compare
Description
The flake.nix uses the default crane toolchain on darwin. Override the default crane toolchain and specify
the target to use the correct rust toolchain.
Fixes #948
Type of change
Please delete options that aren't relevant.
not work as expected)
How Has This Been Tested?
Invoke nix build on MacOS
Checklist
bazel test //...
passes locallygit amend
see some docsThis change is