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

rsync build varies according to kernel cmdline ipv6.disable #360152

Closed
pwaller opened this issue Nov 29, 2024 · 8 comments
Closed

rsync build varies according to kernel cmdline ipv6.disable #360152

pwaller opened this issue Nov 29, 2024 · 8 comments

Comments

@pwaller
Copy link
Contributor

pwaller commented Nov 29, 2024

Issue description

Rsync is not currently reproducible. Upstream issue: RsyncProject/rsync#675

On nixos-unstable:

nix build --rebuild nixpkgs/23e89b7da85c3640bbc2173fe04f4bd114342367#rsync

(or nix-build --check -A rsync from that commit)

Reports:

error: derivation '/nix/store/gppvg32hwnf1h9dvf38mjwfrs74s12jz-rsync-3.3.0.drv' may not be deterministic: output '/nix/store/x850848v3xl4wxjqzc3q9jp7j6fbkh27-rsync-3.3.0' differs from '/nix/store/x850848v3xl4wxjqzc3q9jp7j6fbkh27-rsync-3.3.0.check'

Diffoscope output for the two paths show only the binaries differ, and they differ in various virtual addresses: rsync-diffoscope.txt.gz

Steps to reproduce

  • Grab rsync from cache.nixos.org.
  • Attempt to rebuild it.

Technical details

 - system: `"x86_64-linux"`
 - host os: `Linux 6.11.9, NixOS, 25.05 (Warbler), 25.05.20241119.23e89b7`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.10`
 - nixpkgs: `/nix/store/c9wv7i0af6mysmy65x6nvyfw5izzxv4g-source`
@pwaller
Copy link
Contributor Author

pwaller commented Nov 30, 2024

I have two machines, one reproduces cache.nixos.org, the other does not.

It looks like cache.nixos.org has #define INET6 1, but my local machine doesn't; it looks as though my local machine has ipv6.disable=1 set but the others do not.

Seems slightly odd to me that the rsync build would check if the local machine has ipv6 enabled.

-|  /* AF_INET6 availability check */
-| #include <stdlib.h>
-| #include <sys/types.h>
-| #include <sys/socket.h>
-| int main()
-| {
-|    if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
-|      exit(1);
-|    else
-|      exit(0);
-| }
-|
-configure.sh:7726: result: no
+configure.sh:7718: $? = 0
+configure.sh:7720: result: yes 

@pwaller
Copy link
Contributor Author

pwaller commented Nov 30, 2024

Upstream issue: RsyncProject/rsync#675

@pwaller pwaller changed the title rsync does not reproduce rsync build varies according to kernel cmdline ipv6.disable Nov 30, 2024
@pwaller
Copy link
Contributor Author

pwaller commented Nov 30, 2024

Confirmed that re-enabling ipv6 on the original machine has now caused it to match the cache.nixos.org build.

@pwaller
Copy link
Contributor Author

pwaller commented Nov 30, 2024

Per @raboof's suggestion on matrix, --enable-ipv6 skips the configure check, and defines HAVE_INET6 on my ipv6.disable=1 machine.

pwaller added a commit to pwaller/nixpkgs that referenced this issue Nov 30, 2024
Rsync does a runtime check for ipv6 availability unless explicitly
enabled/disabled, leading to a diverged build between machines if one
machine has `ipv6.disable=1` kernel commandline on linux.

Skip the check by always enabling it.

Ref: RsyncProject/rsync#675
Fix: NixOS#360152
Signed-off-by: Peter Waller <[email protected]>
@paparodeo
Copy link
Contributor

curl has the same check

pwaller added a commit to pwaller/nixpkgs that referenced this issue Nov 30, 2024
Rsync does a runtime check for ipv6 availability unless explicitly
enabled/disabled, leading to a diverged build between machines if one
machine has `ipv6.disable=1` kernel commandline on linux.

Skip the check by always enabling it.

Ref: RsyncProject/rsync#675
Fix: NixOS#360152
Signed-off-by: Peter Waller <[email protected]>
@pwaller
Copy link
Contributor Author

pwaller commented Nov 30, 2024

Hmm. I'm seeing the build id vary in curl so I can't confirm whether the same fix is an improvement there; I'm not seeing the text section vary though, suggesting that at least for now curl is invariant of ipv6.disable.

pwaller added a commit to pwaller/nixpkgs that referenced this issue Nov 30, 2024
Rsync's configure phase does a runtime check for ipv6 availability
unless explicitly enabled/disabled, leading to a diverged build between
machines if one machine has `ipv6.disable=1` kernel commandline on
linux.

Skip the check by always enabling it.

Ref: RsyncProject/rsync#675
Fix: NixOS#360152
Signed-off-by: Peter Waller <[email protected]>
@raboof
Copy link
Member

raboof commented Dec 4, 2024

Hmm. I'm seeing the build id vary in curl

Interestingly I don't see that here.

@pwaller
Copy link
Contributor Author

pwaller commented Dec 7, 2024

Fix for rsync merged in #360445. I haven't time to dig into the curl situation at the moment, if there is one.

@pwaller pwaller closed this as completed Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants