Skip to content

Conversation

@tobim
Copy link
Contributor

@tobim tobim commented Oct 27, 2019

CMake is used for static builds because the Makefile does not
offer a way to disable the shared library.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nix-review --run "nix-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.
Notify maintainers

cc @orivej

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Oct 27, 2019
CMake is used for static builds because the Makefile does not
offer a way to disable the shared library.
@c0bw3b
Copy link
Contributor

c0bw3b commented Oct 31, 2019

Isn't it possible to build both shared & static in one common multi-outputs derivation (with CMake) ; and then install static lib in "static" output ?

@tobim
Copy link
Contributor Author

tobim commented Oct 31, 2019

The regular Makefile based build already builds libzstd as shared object and static library in the same tree. A separate static output would be very unusual, almost no other package does that.

The purpose of this PR is mostly to get zstd to build in the pkgsStatic set, where position independent code is disabled and shared libraries don't link.

};
}
} // stdenv.lib.optionalAttrs static {
nativeBuildInputs = [ cmake ];
Copy link
Member

Choose a reason for hiding this comment

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

It would be good if we can use cmake on non-static as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in the second commit.

@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Nov 4, 2019
@tobim
Copy link
Contributor Author

tobim commented Jan 3, 2020

superseded by #75798.

@tobim tobim closed this Jan 3, 2020
@tobim tobim deleted the pkgsStatic/zstd branch January 3, 2020 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants