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

nmap: fix build with new Darwin stdenv #61733

Merged
merged 1 commit into from May 21, 2019

Conversation

thefloweringash
Copy link
Member

@thefloweringash thefloweringash commented May 20, 2019

Motivation for this change

Fixes #61595.

Brings in changes from unmerged upstream PR nmap/nmap#1363.

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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label May 20, 2019
@thefloweringash thefloweringash force-pushed the nmap-new-stdenv branch 2 times, most recently from fc512c4 to 983358a Compare May 20, 2019 03:45
@ofborg ofborg bot requested review from fpletz and thoughtpolice May 20, 2019 03:51
Copy link
Contributor

@marsam marsam left a comment

Choose a reason for hiding this comment

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

I can confirm it builds on darwin

patches = ./zenmap.patch;
patches = [ ./zenmap.patch ]
++ optional stdenv.cc.isClang (
# https://github.com/nmap/nmap/pull/1363
Copy link
Contributor

Choose a reason for hiding this comment

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

please add a comment about why this patch is needed

Copy link
Member Author

Choose a reason for hiding this comment

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

I added a comment here with the details of what the patch fixes. I don't know why it's only necessary in clang, since the code looks invalid in any c++11 environment. I'm trusting the description of upstream PR.

pkgs/tools/security/nmap/default.nix Outdated Show resolved Hide resolved
@@ -27,7 +27,14 @@ in stdenv.mkDerivation rec {
sha256 = "063fg8adx23l4irrh5kn57hsmi1xvjkar4vm4k6g94ppan4hcyw4";
};

patches = ./zenmap.patch;
patches = [ ./zenmap.patch ]
++ optional stdenv.cc.isClang (
Copy link
Contributor

Choose a reason for hiding this comment

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

very minorly, use optionals here

Copy link
Member Author

Choose a reason for hiding this comment

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

The thread isn't clear: is optionals [(fetchpatch {})] preferred over optional (fetchpatch {}) due to the increased type safety?

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for humor me, this is more of a personal preference, since it's easy to mix optional/optionals (e.g. #60123) I'm inclined to use optionals even when is not necessary

@marsam marsam merged commit f9bda36 into NixOS:master May 21, 2019
@marsam
Copy link
Contributor

marsam commented May 21, 2019

Tested locally on Darwin
Thanks @thefloweringash

@thefloweringash thefloweringash deleted the nmap-new-stdenv branch May 21, 2019 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nmap broken on new Darwin stdenv
2 participants