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

Conversation

anthonyroussel
Copy link
Member

@anthonyroussel anthonyroussel commented Nov 28, 2023

Description of changes

Fix the build on Darwin with this workaround: #166205

ZHF: #265948

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Priorities

Add a 👍 reaction to pull requests you find important.

@anthonyroussel anthonyroussel added backport release-23.11 0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign labels Nov 28, 2023
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Nov 28, 2023
@ghost
Copy link

ghost commented Nov 28, 2023

looks like the build is failing for rocksdb on darwin before the link step.

Comment on lines +34 to +36
env = lib.optionalAttrs stdenv.cc.isClang {
NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}";
};
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.

@marsam marsam mentioned this pull request Feb 11, 2024
13 tasks
@anthonyroussel anthonyroussel deleted the bugfix/sonic-4-darwin branch February 12, 2024 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant