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

Make netcat-openbsd the default netcat #19982

Merged
merged 2 commits into from
Nov 2, 2016
Merged

Conversation

sternenseemann
Copy link
Member

@sternenseemann sternenseemann commented Oct 30, 2016

Motivation for this change

See Issue #19411.

TL;DR: netcat-gnu does neither support IPv6 nor unix sockets and is therefore not a good idea for a default netcat.

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
    • OS X
    • Linux
  • Fixed and tested compilation of all pkgs that depend on this change
    • NixOS tests
      • nixos/tests/hibernate.nix
      • nixos/tests/virtualbox.nix
    • playonlinux
    • xfce4-sensors-plugin
    • build-support/vm/windows
  • Fits CONTRIBUTING.md.

I am open for suggestions on, how to test the windows vm build-support with GNU netcat.


A problem I see here is, that there is no standard deprecation process in nixpkgs (#15357). This change would certainly benefit from a warnSemanticChange which I proposed in this PR: #19315.

@mention-bot
Copy link

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

@sternenseemann sternenseemann changed the title Netcat Make netcat-openbsd the default netcat Oct 30, 2016
netcat = callPackage ../tools/networking/netcat { };
netcat = netcat-openbsd;

netcat-gnu = callPackage ../tools/networking/gnu-netcat { };
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick: the naming is rather inconsistent. I think it would be better to use netcat-gnu even for the directory name.

Copy link
Member Author

@sternenseemann sternenseemann Oct 30, 2016

Choose a reason for hiding this comment

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

Yeah, I had named it differently before, so a bit of regression, good point.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@@ -36,7 +36,7 @@ import ./make-test.nix (pkgs: {
$machine->waitForShutdown;
$machine->start;
$probe->waitForUnit("network.target");
$probe->waitUntilSucceeds("echo test | nc -c machine 4444");
$probe->waitUntilSucceeds("echo test | nc -q 0 machine 4444");
Copy link
Member

Choose a reason for hiding this comment

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

Why is the timeout here 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.

Oh, it is not needed indeed, let me fix that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

The motivation for this change is the following: As gnu-netcat,
e. g. does not support ipv6, it is not suitable as default netcat.

This commit also fixes all obvious build issues caused by this change.
@sternenseemann
Copy link
Member Author

\o/

@sternenseemann sternenseemann deleted the netcat branch November 3, 2016 00:03
johbo added a commit to johbo/nixops that referenced this pull request Mar 9, 2017
Noticed that a call to "nixops ssh" did not work anymore after I upgraded the
target host to the current 17.03 channel.

Tracked the issue down to a change of the default netcat in the following PR:
NixOS/nixpkgs#19982
rbvermaa pushed a commit to NixOS/nixops that referenced this pull request Jul 24, 2017
Noticed that a call to "nixops ssh" did not work anymore after I upgraded the
target host to the current 17.03 channel.

Tracked the issue down to a change of the default netcat in the following PR:
NixOS/nixpkgs#19982
aszlig added a commit that referenced this pull request Apr 29, 2018
I'm not sure why 024b501 used -q 0
because even netcat-openbsd has the -N flag which IMO is the better way
to shutdown the socket on EOF.

Our default netcat implementation has changed once again[1] in
3c3b822 and we're now using LibreSSL's
implementation, which doesn't have a -q flag.

See #39634 for the pull request
introducing the switch.

[1]: #19982

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @matthewbauer, @dtzWill, @Mic92
Synthetica9 pushed a commit to Synthetica9/nixpkgs that referenced this pull request May 3, 2018
I'm not sure why 024b501 used -q 0
because even netcat-openbsd has the -N flag which IMO is the better way
to shutdown the socket on EOF.

Our default netcat implementation has changed once again[1] in
3c3b822 and we're now using LibreSSL's
implementation, which doesn't have a -q flag.

See NixOS#39634 for the pull request
introducing the switch.

[1]: NixOS#19982

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @matthewbauer, @dtzWill, @Mic92
PsyanticY pushed a commit to PsyanticY/nixops-container that referenced this pull request Jul 25, 2019
Noticed that a call to "nixops ssh" did not work anymore after I upgraded the
target host to the current 17.03 channel.

Tracked the issue down to a change of the default netcat in the following PR:
NixOS/nixpkgs#19982
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants