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

nixos/znapzend: Use generic mbuffer path #87280

Merged
merged 1 commit into from May 12, 2020

Conversation

SlothOfAnarchy
Copy link
Contributor

Motivation for this change

The configured mbuffer path will be called on both the source and target
system. If you use pkgs.mbuffer from the source host and the target host
does not have this exact derivation, you will get a broken pipe when
sending snapshots.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@infinisil
Copy link
Member

I think znapzend should also be usable on non-NixOS systems, for either source or target, and this would not work in favor of that.

Does znapzend work with a non-absolute path perhaps? That would be better

@SlothOfAnarchy
Copy link
Contributor Author

The original version also wouldn't have worked with other operating systems. I don't think this can work at all between NixOS and non-NixOS systems because the specified mbuffer path is used both on the source and target system. If we set something like /usr/bin/mbuffer, we will not have that available on NixOS.

@infinisil
Copy link
Member

It will have worked previously if both source and target had the same mbuffer in the Nix store, which can happen (though probably unlikely).

What I'm suggesting now though is to see if just using mbuffer will work, hopefully znapzend will look up the binary in PATH then, which would be system-agnostic

@SlothOfAnarchy
Copy link
Contributor Author

SlothOfAnarchy commented May 10, 2020

It used to work for my systems until I upgraded only one of them to 20.03, that's how I found this bug.

What I'm suggesting now though is to see if just using mbuffer will work, hopefully znapzend will look up the binary in PATH then, which would be system-agnostic

Good suggestion, I replaced the path with just mbuffer, this also works on my systems.

The configured mbuffer path will be called on both the source and target
system. If you use pkgs.mbuffer from the source host and the target host
does not have this exact derivation, you will get a broken pipe when
sending snapshots. This is the case when transferring to a non-NixOS
system or to a host with a different mbuffer version.
@infinisil infinisil merged commit fea6394 into NixOS:master May 12, 2020
@SlothOfAnarchy SlothOfAnarchy deleted the znapzend-mbuffer-path branch May 12, 2020 13:41
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