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

curlFull: Add http2Support for darwin #34339

Merged
merged 1 commit into from Feb 7, 2018

Conversation

bdarnell
Copy link
Contributor

This gives darwin users an easy way to install an HTTP/2-aware build
of curl. Also adds comments explaining the absence of this feature by
default.

Motivation for this change

On darwin, curl does not contain http2 support by default and this functionality is only accessible via manual overrides. The curlFull target includes all of curl's other features so it should enable http2 as well.

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
    • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@matthewbauer
Copy link
Member

/cc @copumpkin @LnL7

@copumpkin
Copy link
Member

I'm not sure it's even true anymore that we don't have xz in the bootstrap, right?

@LnL7
Copy link
Member

LnL7 commented Feb 5, 2018

I don't really like this being conditional, we can allow xz if the linux stdenv already depends on it.

@copumpkin
Copy link
Member

Yeah, sorry, what I meant is that I think that curl http2 support being conditioned on !darwin is based on ancient information that stopped being true when we merged pure-darwin a couple of years ago.

@bdarnell
Copy link
Contributor Author

bdarnell commented Feb 6, 2018

Yeah, that may be true. xz is named in darwin/make-bootstrap-tools.nix. How would I test and confirm this?

@copumpkin
Copy link
Member

@bdarnell I think if you just remove the !stdenv.isDarwin from curl's top level expression, that might rebuild a bunch of stuff but should get the curl to be equivalent on all platforms.

http2Support was disabled due to a bootstrapping issue involving xz.
Now that xz is available in the bootstrap environment for all
platforms, http2Support can be enabled globally.
@bdarnell
Copy link
Contributor Author

bdarnell commented Feb 7, 2018

OK, I've made that change. nix-shell -I nixpkgs=. -p curl builds correctly; do I need to do anything else to test the bootstrapping environment?

@copumpkin
Copy link
Member

Nah, I'd mostly just repoint this PR against staging (GitHub lets you edit the PR base branch now) since it's a mass rebuild, but I don't expect it to break much. Thanks!

@bdarnell bdarnell changed the base branch from master to staging February 7, 2018 04:05
@bdarnell
Copy link
Contributor Author

bdarnell commented Feb 7, 2018

OK, changed base to staging.

@copumpkin
Copy link
Member

Looks good, thanks!

@copumpkin copumpkin merged commit 30d031b into NixOS:staging Feb 7, 2018
@vcunat
Copy link
Member

vcunat commented Feb 8, 2018

Not urgent, but stdenv bootstrap tools for darwin got broken by this: https://hydra.nixos.org/build/68787762

@bdarnell bdarnell deleted the curl-http2-darwin branch February 8, 2018 14:53
@bdarnell
Copy link
Contributor Author

So should this be reverted and replaced by the original version that only adds http2 support to curlFull, or is there some other fix for the bootstrap tools? (It's unclear to me how the linux version works since it doesn't seem to do anything specific to make nghttp2 available)

@vcunat
Copy link
Member

vcunat commented Feb 10, 2018

I don't think there's any curl in Linux bootstrap tools.

@vcunat
Copy link
Member

vcunat commented Feb 10, 2018

I expect the easiest way would be to override the bootstrapping curl not to support http2, as it's of little use in there.

@vcunat
Copy link
Member

vcunat commented Feb 10, 2018

Probably

--- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix
@@ -15,8 +15,8 @@ in rec {
   # Avoid debugging larger changes for now.
   bzip2_ = bzip2.override (args: { linkStatic = true; });
 
-  # Avoid messing with libkrb5.
-  curl_ = curl.override (args: { gssSupport = false; });
+  # Avoid messing with libkrb5 and libnghttp2.
+  curl_ = curl.override (args: { gssSupport = false; http2Support = false; });
 
   build = stdenv.mkDerivation {
     name = "stdenv-bootstrap-tools";

but I don't have a Darwin machine at hand.

@bdarnell
Copy link
Contributor Author

Looks like that works (with nix-build pkgs/stdenv/darwin/make-bootstrap-tools.nix -A test ). I'll send a PR.

@vcunat
Copy link
Member

vcunat commented Feb 10, 2018

I can push it directly, if it works.

@bdarnell
Copy link
Contributor Author

OK, go ahead.

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

7 participants