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
darwin.stdenv: use cmake without curl to bootstrap clang #21099
Conversation
@@ -58,6 +61,7 @@ stdenv.mkDerivation rec { | |||
"--no-system-jsoncpp" | |||
] | |||
++ optional (!stdenv.isCygwin) "--system-libs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason we use system libs? I would expect cmake to use the libraries from the derivations' buildInputs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The decision here is whether cmake should use it's bundled copies of things like curl, or to prefer the ones it finds externally (like those provided by the buildInputs).
The configure/bootstrap's help message explains a bit:
--system-libs use all system-installed third-party libraries
(for use only by package maintainers)
--no-system-libs use all cmake-provided third-party libraries
(default)
--system-curl use system-installed curl library
--no-system-curl use cmake-provided curl library (default)
--system-expat use system-installed expat library
--no-system-expat use cmake-provided expat library (default)
--system-jsoncpp use system-installed jsoncpp library
--no-system-jsoncpp use cmake-provided jsoncpp library (default)
--system-zlib use system-installed zlib library
--no-system-zlib use cmake-provided zlib library (default)
--system-bzip2 use system-installed bzip2 library
--no-system-bzip2 use cmake-provided bzip2 library (default)
--system-liblzma use system-installed liblzma library
--no-system-liblzma use cmake-provided liblzma library (default)
--system-libarchive use system-installed libarchive library
--no-system-libarchive use cmake-provided libarchive library (default)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm just wondering why we give cmake a bunch of unnecessary dependencies, instead of just adding those to expressions that need them. I would prefer to make them explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you mean for things built with cmake? Not sure, but it was my understanding these libraries would be used to implement cmake functionality itself, not to be used for building/linking other things... but maybe that's not so.
Do you know? As you say, those should be explicitly listing the libraries they need via buildInputs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(it does seem useful to prevent cmake from using curl/openssl/etc at all, since AFAIK they're only used to fetch sources which we shouldn't be doing anyway...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I was thinking, and it looks like I missed --no-system-libarchive
, if I use that I can get rid of openssl without most of #21101
214f3f3
to
0cbc8bb
Compare
This will just build cmake, statically linked against a vendored version of curl. But I have no idea if that's even important. |
Closing in favor of #21596 |
Motivation for this change
This gets rid of
curl
by using a version of cmake that does not have it as a system library.I'm testing a branch WIP with #21078, #21099 and #21101.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)