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: Adding a derivation for the 1.8 Go compiler #23122
Conversation
CGO_ENABLED = 1; | ||
GOROOT_BOOTSTRAP = "${goBootstrap}/share/go"; | ||
|
||
# The go build actually checks for CC=*/clang and does something different, so we don't |
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.
❤️ seeing comments like this
I get one test failure on Darwin, but otherwise this looks good:
|
My builds both passed. I don't think switching the |
@LnL7 and @copumpkin since you both got different test results, how do you want to proceed? @LnL7 updating |
Okay, updated |
I tested that the compiler built by this derivation builds our own internal application and its vendor libraries and all of our tests pass. |
That test failure looks like it's something timezone related, setting |
Didn't fix it 😦 This looks related though: golang/go#8814 Supposedly fixed ages ago, but perhaps the way we inject TZ data is weird? I'm on US East Coast time, if that helps. |
I'm not sure if it does help, I'd appreciate help in figuring it out if you feel it's important as I can't reproduce (I'm on a NixOS laptop not MacOS). |
Sure, I'll poke at it a bit later or over the weekend. Given that this is a compiler, I assume you also tested that a few common go tools compile properly with it? I'd check vault, terraform, docker, etc. Once (or if 😉) I get this working on my Mac, I'll do the same. |
@copumpkin I have not tested building common tools, I was going to do so this weekend or tonight or see if anyone else could get to it before me. I have tested that an internal web application with a large dependency graph does build successfully and all tests pass, so that's a start. But it isn't strong enough confidence. Thank you for helping :) |
Thank you for the contribution! |
We could also just disable the test if everything works properly. |
Those also look good on both NixOS and darwin. |
''; | ||
|
||
patches = | ||
[ ./remove-tools-1.8.patch |
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.
Are these patches all different from the 1.7 versions?
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.
No not all, I think one of them is the same but I wanted to "copy it" just to make sure it was distinct because the others needed tweaks.
hardeningDisable = [ "all" ]; | ||
|
||
preCheck = '' | ||
export TZ=UTC |
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 just realised that the go build doesn't have a checkPhase, adding it to preInstall
might still fix the timezone issue in the tests.
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.
Ah! I hadn't realized that, adding now.
CC: @copumpkin
Turns out the timezone is actually already set by the stdenv. |
Anyway, not really sure what causes the failure. Perhaps let's just turn off that test for now until we figure it out? Then merge with a comment in there? |
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.
Looks good, can you squash this.
4b31a9d
to
91abe63
Compare
Hmm, I think I confused myself trying to squash by rebasing. I will try again. |
91abe63
to
51f3f77
Compare
@LnL7 finally got around to cleaning up the history. |
@ixmatus LGTM. Can you please just change the commit message to match contributing.md? You can do this via |
@the-kenny sure, I can. Are you wanting me to add more detail like removing the test for the time formatting failure? This line in the contributing.md had me thinking my one-liner was fine:
|
@ixmatus No the one liner is fine :) I just think it's beneficial to follow the usual |
I think |
51f3f77
to
d753ba4
Compare
Applied in 8d6fbd0, thank you! |
@grahamc, thanks! Also why did you close (and commit elsewhere) instead of merging this PR? Is there something I should have done differently? |
I have some tools to apply-and-test in one go which is easier, and also
I reworded the commit message. You did nothing wrong, really :)
|
For what it's worth, I ran into the same timezone issue with the go 1.4 bootstrap on my machine, so I think it's an impurity everywhere 😄 This is from 1.4
|
@ixmatus I figured it out, and I'll push a fix soon. See golang/go@91563ce for details 😄 luckily for us, the patch actually applies to older versions of Go as well, so the change to nixpkgs is pretty easy. |
Motivation for this change
Go 1.8 was recently released.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)This should resolve issue #20082.
I haven't fully tested all packages that may depend on this (Real Life time constraints). If there are people using Go that are interested in this, I'd appreciate the help testing that this doesn't produce major breakage.
Maintainers: not sure if it's "correct" for me to
go = go_1_8
instead of keeping it atgo_1_7
? Maybe if I didn't retarget that attribute it would be more "okay" to not test as many packages as may depend on Go?