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

haskell-modules/generic-builder.nix: work around libc++abi issue #266172

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkgs/development/haskell-modules/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -811,5 +811,12 @@ stdenv.mkDerivation ({
// optionalAttrs (args ? dontStrip) { inherit dontStrip; }
// optionalAttrs (postPhases != []) { inherit postPhases; }
// optionalAttrs (stdenv.buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }

# Ensure libc++abi is linked even when clang is invoked as just `clang` or `cc`.
# Works around https://github.com/NixOS/nixpkgs/issues/166205.
# This can be dropped once a fix has been committed to cc-wrapper.
Copy link

Choose a reason for hiding this comment

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

Has a PR with the proposed fix to cc-wrapper been opened?

Copy link
Contributor Author

@reckenrode reckenrode Nov 9, 2023

Choose a reason for hiding this comment

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

@toonn is working on the fix to cc-wrapper. I don’t believe he’s opened a PR for it yet.

// lib.optionalAttrs (stdenv.cc.isClang && stdenv.cc.libcxx != null) {
env.NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
Copy link
Member

Choose a reason for hiding this comment

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

This completely overwrites env if it is set. Is probably better to just set NIX_LDFLAGS top level to prevent confusion if this sticks around for longer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I pushed an update that preserves env while also avoiding any further rebuilds (since the staging-next job on Hydra is currently pointed to a branch with this commit cherry-picked).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opened #266878 to preserve env since this got merged before I could push the update.

}
)
)