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

nghttp2: 1.16.1 -> 1.17.0 #21029

Closed
wants to merge 3 commits into from
Closed

nghttp2: 1.16.1 -> 1.17.0 #21029

wants to merge 3 commits into from

Conversation

c0bw3b
Copy link
Contributor

@c0bw3b c0bw3b commented Dec 9, 2016

Motivation for this change

v1.17.0 fixes crashes, issue with memcpy and compilation with BoringSSL

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.

See release notes :
https://github.com/nghttp2/nghttp2/releases/tag/v1.17.0

@mention-bot
Copy link

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

@c0bw3b
Copy link
Contributor Author

c0bw3b commented Dec 9, 2016

$ nix-build --expr 'with import <nixpkgs> {}; callPackage ./localnixpkgs/pkgs/development/libraries/nghttp2/default.nix {}'
was successful and created the derivation /nix/store/1r7qclqb7rbl16hdlmbw0ijpa1vznl61-nghttp2-1.17.0

$ nix-build --expr 'with import <nixpkgs> {}; callPackage ../localnixpkgs/pkgs/development/libraries/nghttp2/default.nix { openssl=pkgs.openssl_1_1_0; libxml2=pkgs.limxml2; jansson=pkgs.jansson; jemalloc=pkgs.jemalloc; }'
was successful and created the derivation /nix/store/ybnfgsa5f27l6clmbfccj4a5a2s70ks0-nghttp2-1.17.0

Building on 16.09-small

$ nixos-version
16.09.1240.c43a79e (Flounder)

@vcunat vcunat self-assigned this Dec 9, 2016
vcunat added a commit that referenced this pull request Dec 9, 2016
@vcunat
Copy link
Member

vcunat commented Dec 9, 2016

Staged.

@c0bw3b
Copy link
Contributor Author

c0bw3b commented Dec 11, 2016

Hello,

Looking back at the nghttp2 Nix definition : the postPatch action is not needed anymore since it has been patched upstream a long time ago. See :

I also noticed that the optional dependencies [ jansson boost libxml2 jemalloc ] will never be used even if passed as arguments. They are not added to the build inputs if not null.

@vcunat you can judge if the correction (and another mass-rebuild) is worthwhile at this point.

vcunat added a commit that referenced this pull request Dec 11, 2016
@vcunat
Copy link
Member

vcunat commented Dec 11, 2016

Thanks to some canonicalization during evaluation, it's only mass-rebuild on Darwin and Hydra's currently idling on that platform.

@LnL7
Copy link
Member

LnL7 commented Dec 11, 2016

I tried to get rid of curl in the darwin stdenv a while ago, but cmake does not want to build without it.

@c0bw3b
Copy link
Contributor Author

c0bw3b commented Dec 11, 2016

@vcunat
I'd rather keep the possibility of building with those inputs.
It would allow users to build the libnghttp2_asio C++ library (needs boost). Or reduce heap fragmentation with long-running processes when using nghttpd or nghttpx on a webserver (my own case -- needs jemalloc).

Replacing buildInputs = [ openssl libev zlib ]; with the following should do the trick :

  buildInputs = [ openssl libev zlib ]
    ++ optional (!isNull jansson) jansson
    ++ optional (!isNull boost) boost
    ++ optional (!isNull libxml2) libxml2
    ++ optional (!isNull jemalloc) jemalloc;

@vcunat
Copy link
Member

vcunat commented Dec 11, 2016

We would need a different approach, as by default all parameters are passed as non-null (callPackage passes all available matching names).

EDIT: maybe allow two standard variants, for simplicity – one light as it's now to use in curl, and another using all the features. Still, it seems to make little sense to me until some packages actually uses the full version.

@LnL7
Copy link
Member

LnL7 commented Dec 11, 2016

I think options are better for this eg. development/interpreters/erlang/R18.nix
Using null values for packages can result in confusing errors when trying to use them in paths for example and it's easier to disable an option by default.

@c0bw3b
Copy link
Contributor Author

c0bw3b commented Dec 11, 2016

Ah ok lesson learned about CallPackage.
Yes boolean option flags seems like the way to go. I've seen that done in the lighttpd definition also.

Turning the dependencies unrelated to the base libnghttp2 into proper
options.
@c0bw3b
Copy link
Contributor Author

c0bw3b commented Dec 15, 2016

@vcunat
I proposed a light refactor of the nghttp2 definition which doesn't break the 'normal' build but allows for options to be used if desired. See commit 745ea7a above.

@vcunat vcunat closed this in 6d3183e Jan 6, 2017
@c0bw3b c0bw3b deleted the nghttp2-1.17.0 branch January 7, 2017 15:00
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

5 participants