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

[staging-next] libtiff: fix build on darwin #110729

Merged
merged 1 commit into from Jan 25, 2021
Merged

Conversation

r-burns
Copy link
Contributor

@r-burns r-burns commented Jan 25, 2021

Now that libtiff is using cmake, we need to let cmake
set the build rpath for the tests to pass on darwin.
The rpaths are rewritten at installation so
the output libraries should be unaffected.

(This won't be needed anymore if we eventually merge #108496)

Motivation for this change

#92708 (cc @L-as)
#110569 (cc @FRidh)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Now that libtiff is using cmake, we need to let cmake
set the build rpath for the tests to pass on darwin.
The rpaths are rewritten at installation so
the output libraries should be unaffected.
Comment on lines +21 to +23
cmakeFlags = if stdenv.isDarwin then [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
] else null;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
cmakeFlags = if stdenv.isDarwin then [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
] else null;
cmakeFlags = lib.optionals stdenv.isDarwin [
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
];

Copy link
Contributor Author

@r-burns r-burns Jan 25, 2021

Choose a reason for hiding this comment

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

I did this to avoid the rebuild on linux. With this change lib.optionals will evaluate to an empty list rather than null on linux and cause a rebuild.

Copy link
Member

Choose a reason for hiding this comment

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

I am personally not a big fan of such tricks but if it takes to long to rebuild on staging-next then I guess it it is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about I subsequently issue a PR against staging to make the BUILD_RPATH unconditional? Then this check will only be in place until the next staging-next merge, and the mass rebuild will be "free" alongside other mass rebulid commits in staging

Copy link
Member

Choose a reason for hiding this comment

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

I am not sure if this is worth the effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants