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

sonic-server: fix build with clang 12+ #270634

Closed
Closed
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
5 changes: 5 additions & 0 deletions pkgs/servers/search/sonic-server/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ rustPlatform.buildRustPackage rec {
})
];

# Work around https://github.com/NixOS/nixpkgs/issues/166205.
env = lib.optionalAttrs stdenv.cc.isClang {
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
};
Comment on lines +34 to +36
Copy link

Choose a reason for hiding this comment

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

stdenv.cc.isClang can be true while stdenv.cc.libxx is null so i've been using (stdenv.cc.libcxx != null) as the check.

nix-repl> builtins.currentSystem
"x86_64-linux"
nix-repl> clang16Stdenv.cc.libcxx
null
nix-repl> clang16Stdenv.cc.isClang
true

also NIX_LDFLAGS will link -lc++abi into everything it builds, there seem to be various things getting built by cargo in this package so this could be undesirable.


cargoHash = "sha256-k+gPCkf8DCnuv/aLXcQwjmsDUu/eqSEqKXlUyj8bRq8=";

# Found argument '--test-threads' which wasn't expected, or isn't valid in this context
Expand Down