Skip to content
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

Update the rules_nixpkgs guide #554

Merged
merged 6 commits into from
Jun 21, 2024
Merged

Update the rules_nixpkgs guide #554

merged 6 commits into from
Jun 21, 2024

Conversation

aherrmann
Copy link
Member

To use a more recent nixpkgs revision, Bazel 7, and more recent rules_cc.

  • Update nixpkgs revision
  • Update Bazel to 7.1.0
  • Update rules_cc
  • Update guide NixOS 22.05 -> 24.05
  • Update guide rules_nixpkgs release

@aherrmann aherrmann requested a review from benradf as a code owner June 19, 2024 14:41
echo "-L${pkgs.libiconv}/lib" >> $out/nix-support/cc-cflags
echo "-L${pkgs.darwin.libobjc}/lib" >> $out/nix-support/cc-cflags
echo "-resource-dir=${pkgs.stdenv.cc}/resource-root" >> $out/nix-support/cc-cflags
'' + pkgs.lib.optionalString (builtins.hasAttr "libcxxabi" pkgs.llvmPackages) ''
echo "-L${pkgs.llvmPackages.libcxxabi}/lib" >> $out/nix-support/cc-cflags
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes #543

@avdv avdv linked an issue Jun 20, 2024 that may be closed by this pull request
@aherrmann aherrmann force-pushed the update-guide branch 4 times, most recently from 771bc17 to 01aee9c Compare June 21, 2024 13:37
Bazel introduced the option `darwin_x86_64`.
@aherrmann
Copy link
Member Author

aherrmann commented Jun 21, 2024

The CI failures on MacOS were an instance bazelbuild/rules_cc#226. The logic to generate the toolchain constraints needed to be updated to capture the value darwin_x86_64 introduced in Bazel 7.0.0. Without this they were erroneously generating an os:linux constraint for the Darwin toolchain, meaning that the test on CI actually picked the local toolchain rather than the Nix provided toolchain.

For reference, the failure looked like this:

  /Users/runner/work/_temp/7ac2a868-366e-441a-8c4b-4441651ee01e.sh: line 10:  4663 Segmentation fault: 11  nix develop --command bazel run //src:hello-world

@aherrmann aherrmann added the merge-queue merge on green CI label Jun 21, 2024
@mergify mergify bot merged commit e50218c into master Jun 21, 2024
15 checks passed
@mergify mergify bot deleted the update-guide branch June 21, 2024 16:15
@mergify mergify bot removed the merge-queue merge on green CI label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lack of llvmPackages.libcxxabi for e.g. 23.11
3 participants