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

darwin.stdenv: use cmake without curl to bootstrap clang #21099

Closed
wants to merge 1 commit into from

Conversation

LnL7
Copy link
Member

@LnL7 LnL7 commented Dec 12, 2016

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
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

+bootstrap-python-2.7.12.drv
+bzip2-1.0.6.0.1.drv
-bzip2-1.0.6.0.1.drv
-clang-5.3.patch
+cmake-3.6.2.drv
-cmake-3.6.2.drv
-curl-7.51.0.drv
-curl-7.51.0.tar.bz2.drv
-db-5.3.28.drv
-db-5.3.28.tar.gz.drv
-e0ec3471cb09.drv
-gdbm-1.12.drv
-gdbm-1.12.drv
-gdbm-1.12.tar.gz.drv
-hook.drv
+libarchive-3.2.2.drv
-libarchive-3.2.2.drv
-libssh2-1.7.0.drv
-libssh2-1.7.0.tar.gz.drv
-libxml2-2.9.4.drv
-link-against-ncurses.patch
+lzo-2.09.drv
-lzo-2.09.drv
-no-arch_only-6.3.patch
-openssl-1.0.2j.drv
-openssl-1.0.2j.drv
-openssl-1.0.2j.tar.gz.drv
+pkg-config-0.29.drv
-pkg-config-0.29.drv
-properly-detect-curses.patch
-python-2.7-distutils-C++.patch
-python-2.7.12.drv
-python-2.7.12.drv
-readline-6.3.tar.gz.drv
-readline-6.3p08.drv
-readline-6.3p08.drv
-readline63-001.drv
-readline63-002.drv
-readline63-003.drv
-readline63-004.drv
-readline63-005.drv
-readline63-006.drv
-readline63-007.drv
-readline63-008.drv
-setup-hook.sh
-sqlite-3.15.0.drv
-sqlite-autoconf-3150000.tar.gz.drv
-use-etc-ssl-certs.patch

@LnL7 LnL7 added 1.severity: mass-darwin-rebuild 6.topic: darwin Running or building packages on Darwin labels Dec 12, 2016
@mention-bot
Copy link

@LnL7, thanks for your PR! By analyzing the history of the files in this pull request, we identified @dtzWill, @vcunat and @edolstra to be potential reviewers.

@@ -58,6 +61,7 @@ stdenv.mkDerivation rec {
"--no-system-jsoncpp"
]
++ optional (!stdenv.isCygwin) "--system-libs"
Copy link
Member Author

@LnL7 LnL7 Dec 12, 2016

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.

Copy link
Member

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)

Copy link
Member Author

@LnL7 LnL7 Dec 12, 2016

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.

Copy link
Member

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.

Copy link
Member

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...)

Copy link
Member Author

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

@LnL7
Copy link
Member Author

LnL7 commented Dec 28, 2016

This will just build cmake, statically linked against a vendored version of curl. But I have no idea if that's even important.

@LnL7
Copy link
Member Author

LnL7 commented Jan 2, 2017

Closing in favor of #21596

@LnL7 LnL7 closed this Jan 2, 2017
@LnL7 LnL7 deleted the darwin-stdenv-curl branch January 2, 2017 21:42
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