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

libseccomp: enable static library build #96556

Closed
wants to merge 1 commit into from

Conversation

saschagrunert
Copy link
Member

@saschagrunert saschagrunert commented Aug 28, 2020

Motivation for this change

This enables the output of libseccomp.a which is useful for building static binaries from it.

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.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
@saschagrunert
Copy link
Member Author

@GrahamcOfBorg build libseccomp.lib libseccomp

@saschagrunert
Copy link
Member Author

cc @thoughtpolice

@roberth
Copy link
Member

roberth commented Sep 1, 2020

@jtojnar @danieldk please leave a comment explaining your thumbs-down reaction. Sascha has taken the effort to improve Nixpkgs, so the least you could do is explain in a few words why this might not be the right solution. Thank you.

@jtojnar
Copy link
Contributor

jtojnar commented Sep 1, 2020

Sorry, was busy at the time. Most of systems will not need static builds so always including them will bloat the closures there.

For that reason, we usually add false-by-default enableStatic argument that is then enabled in https://github.com/NixOS/nixpkgs/blob/7ebcaec02f2f250220db63ffc87d69663ffdaa86/pkgs/top-level/static.nix

@danieldk
Copy link
Contributor

danieldk commented Sep 1, 2020

@jtojnar @danieldk please leave a comment explaining your thumbs-down reaction. Sascha has taken the effort to improve Nixpkgs, so the least you could do is explain in a few words why this might not be the right solution. Thank you.

My apologies @saschagrunert , I didn't intend to be rude.

I have encountered some cases before where Nix derivations were installing static libraries, leading to other derivations linking to the static library rather than the dynamic library (the most recent case I encountered was sortmerna linking statically against rocksdb). When static libraries are not installed by default, it makes it much easier to detect or avoid such cases.

To me, our default (outside some language ecosystems such as Rust and Go) is dynamic linking and dontDisableStatic is provided as an escape hatch that people can use to enable building of static libraries. This will become confusing if certain derivations have the opposite behavior.

Of course, there may be some specific use case for libseccomp that I missed.

Sorry again @saschagrunert , you contributions are very much appreciated 👍 .

@saschagrunert
Copy link
Member Author

Thank you for the clarification @danieldk! 🙏 I'm happy to close this PR for now. In terms of libseccomp it seems confusing that many (most?) distributions package the static library together with the dynamic one, so I thought this pattern might apply well to libseccomp, too. 🤷

@saschagrunert saschagrunert deleted the seccomp-static branch September 1, 2020 11:05
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

4 participants