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

buildGoModule might produce different checksum depending on the platform (linux <> darwin) #129730

Closed
Mic92 opened this issue Jul 9, 2021 · 7 comments

Comments

@Mic92
Copy link
Member

Mic92 commented Jul 9, 2021

Describe the bug

Discovered in https://github.com/NixOS/nixpkgs/pull/129649/files#r666294752

To investigate this we would need someone with both Linux and macOS to provide the module derivations for both.

@zowoq
Copy link
Contributor

zowoq commented Jul 9, 2021

diff -rq /nix/store/9d1rp6pmfaa1sxj5ni40jd5xwwzwdhfc-telegraf-1.19.1-go-modules /nix/store/izq65v2jbqjfb29289hcpkwfkwb8yfqc-telegraf-1.19.1-go-modules
Only in /nix/store/izq65v2jbqjfb29289hcpkwfkwb8yfqc-telegraf-1.19.1-go-modules/github.com/Microsoft: ApplicationInsights-Go
Only in /nix/store/9d1rp6pmfaa1sxj5ni40jd5xwwzwdhfc-telegraf-1.19.1-go-modules/github.com: microsoft~nix~case~hack~1

vendorSha256 = if stdenv.isDarwin
then "0anw3l6pq8yys2g2607ndhklb9m1i9krgjrw4wb99igavjzp3wpj"
else "04h463d2d7g6wqp5mzkqlszwzdbq0pix6j7n2s9s80lwg7nh8k3h";

diff -rq /nix/store/x3mqwlqzrpgbnczsy8ca02ynnc1nsijv-opentelemetry-collector-0.26.0-go-modules /nix/store/naii9fxpfcr2kcj845g3b7hp9ghh6xbm-opentelemetry-collector-0.26.0-go-modules
Only in /nix/store/x3mqwlqzrpgbnczsy8ca02ynnc1nsijv-opentelemetry-collector-0.26.0-go-modules/github.com/Microsoft: ApplicationInsights-Go
Only in /nix/store/naii9fxpfcr2kcj845g3b7hp9ghh6xbm-opentelemetry-collector-0.26.0-go-modules/github.com: microsoft~nix~case~hack~1

@Mic92
Copy link
Member Author

Mic92 commented Jul 10, 2021

diff -rq /nix/store/9d1rp6pmfaa1sxj5ni40jd5xwwzwdhfc-telegraf-1.19.1-go-modules /nix/store/izq65v2jbqjfb29289hcpkwfkwb8yfqc-telegraf-1.19.1-go-modules
Only in /nix/store/izq65v2jbqjfb29289hcpkwfkwb8yfqc-telegraf-1.19.1-go-modules/github.com/Microsoft: ApplicationInsights-Go
Only in /nix/store/9d1rp6pmfaa1sxj5ni40jd5xwwzwdhfc-telegraf-1.19.1-go-modules/github.com: microsoft~nix~case~hack~1

vendorSha256 = if stdenv.isDarwin
then "0anw3l6pq8yys2g2607ndhklb9m1i9krgjrw4wb99igavjzp3wpj"
else "04h463d2d7g6wqp5mzkqlszwzdbq0pix6j7n2s9s80lwg7nh8k3h";

diff -rq /nix/store/x3mqwlqzrpgbnczsy8ca02ynnc1nsijv-opentelemetry-collector-0.26.0-go-modules /nix/store/naii9fxpfcr2kcj845g3b7hp9ghh6xbm-opentelemetry-collector-0.26.0-go-modules
Only in /nix/store/x3mqwlqzrpgbnczsy8ca02ynnc1nsijv-opentelemetry-collector-0.26.0-go-modules/github.com/Microsoft: ApplicationInsights-Go
Only in /nix/store/naii9fxpfcr2kcj845g3b7hp9ghh6xbm-opentelemetry-collector-0.26.0-go-modules/github.com: microsoft~nix~case~hack~1

I don't really understand the diff. Are there different files in both?

@zowoq
Copy link
Contributor

zowoq commented Jul 10, 2021

Seems to be a case-insensitive conflict with github.com/Microsoft and github.com/microsoft.

@Mic92
Copy link
Member Author

Mic92 commented Jul 15, 2021

Could we normalize this in our code for buildGoModule?

@zowoq
Copy link
Contributor

zowoq commented Jul 16, 2021

I'd be a bit concerned that any normalization we do ourselves may end up causing more problems with other workarounds or the go 1.17 vendor changes, especially if we end up with 1.17 as default on linux and keeping 1.16 for darwin.

I think I've got a fix that just uses go itself, I'll open a PR in the next couple of days.

@zowoq
Copy link
Contributor

zowoq commented Jul 25, 2021

Draft fix: #131452

@zowoq
Copy link
Contributor

zowoq commented Aug 7, 2021

Should be resolved by #131452

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants