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
go: do not replace path to zoneinfo.zip and mime.types #75013
Conversation
Prepend the nix path to the zoneinfo.zip file and keep the original alternatives to allow go programs built using nix to run on non nix servers. see #54603
The $ git clone https://github.com/fmpwizard/nixpkgs
$ cd nixpkgs
$nixpkgs> git checkout issue_54603
$nixpkgs> nix-env -i go -f . |
@GrahamcOfBorg build go |
The same thing is happening with the mime types. I suggest fixing that as well if we want full support outside of Nix. Our side: nixpkgs/pkgs/development/compilers/go/1.13.nix Lines 59 to 61 in 5a0be78
Upstream code: https://github.com/golang/go/blob/da4d58587e0e4028ea384580053c3c455127e446/src/mime/type_unix.go#L19-L23 I'll wait for the second fix before merging to avoid rebuilding twice. |
@kalbasit great idea, I added a new commit. I tried to test this locally by running
(at the root of this repo) but I get this error:
I'm on Fedora 30 5.3.14-200.fc30.x86_64 Thanks! |
it works locally for me. Can you please fix the commit, it should Once that's done, I'll submit it for build by ofborg and test locally on Linux/Mac. |
@kalbasit thanks, I updated the commit message and the PR title |
@GrahamcOfBorg build go pet jx |
sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/time/zoneinfo_unix.go | ||
# prepend the nix path to the zoneinfo files but also leave the original value for static binaries | ||
# that run outside a nix server | ||
sed -i 's,\"/usr/share/zoneinfo/,"${tzdata}/share/zoneinfo/\"\,\n\t&,' src/time/zoneinfo_unix.go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why are using the zoneinfo from Nix on Linux only. Is there something I'm not aware of @LnL7?
go: do not replace path to zoneinfo.zip and mime.types (cherry picked from commit b0db7c4)
Prepend the nix path to the zoneinfo.zip file and keep the original alternatives
to allow go programs built using nix to run on non nix servers.
see #54603
Motivation for this change
Fixes: #54603
Allow Go programs built using nix to run on servers that don't have nix
Things done
I am very new to nix and could not figure out how to test this branch locally, reading
https://nixos.org/nixpkgs/manual/#chap-submitting-changes
I don't know what to replace this like with:
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @veprbl