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

go, buildGoModule, buildGoPackage: default to 1.18 #164320

Closed
wants to merge 1 commit into from
Closed

go, buildGoModule, buildGoPackage: default to 1.18 #164320

wants to merge 1 commit into from

Conversation

zowoq
Copy link
Contributor

@zowoq zowoq commented Mar 15, 2022

Description of changes
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@zowoq
Copy link
Contributor Author

zowoq commented Mar 16, 2022

cc @NixOS/golang

@Mic92 Can we create a job for this on the community hydra?

euank added a commit to euank/nixpkgs that referenced this pull request Mar 19, 2022
Update gopls.

This also changes the version of go used to build it to go1.18. This is
required for gopls to work with go1.18 code.

It's still backwards compatible with go1.17 code, so building with 1.18
should allow us to support all supported go versions (1.17+1.18)
correctly, while building with 1.17 does not.

Once NixOS#164320 merges, this should switch back to buildGoModule.
@euank euank mentioned this pull request Mar 19, 2022
12 tasks
@zowoq
Copy link
Contributor Author

zowoq commented Mar 21, 2022

Now hydra is catching up after the openssl mass rebuild this is a bit easier to work on, seems besides the usual broken builds we also have some vendor breakage that needs to be addressed as well.

@endocrimes
Copy link
Member

We might want to be a bit careful about bumping the defaults here - the X509 changes aren't necessarily easy to bump everything to wholesale (they broke a lot of kubernetes tests for example), and should be fixed in go 1.18.1 (golang/go#41682 (comment))

@zowoq
Copy link
Contributor Author

zowoq commented Apr 1, 2022

Seeing some build failures due to our outdated stdenv on x86_64-darwin, missing _SecTrustEvaluateWithError and _utimensat (so far).

go upstream stated >= 10.13 stdenv was required with 1.17 but didn't end up being a problem for us, seems it is required for some packages with 1.18.

@euank euank mentioned this pull request Apr 5, 2022
12 tasks
SuperSandro2000 pushed a commit to euank/nixpkgs that referenced this pull request Apr 8, 2022
This updates errcheck to a newer version which has go1.18 support.

There's no tagged release yet for this, but without this change, this
package breaks under go1.18, so it seems worth updating before upstream
tags.

Related to NixOS#164320

The switch to 'subPackages' was added because 'testdata' contains a
'main_test.go' file which is not meant to be actually tested, and the
default checkPhase will try to run 'cd testdata && go test' unless you
do _something_ to override it. Since checkPhase doesn't respect
'excludedPackages', but does respect 'subPackages', this seemed like a
reasonable way to do that.
@mweinelt mweinelt linked an issue Apr 13, 2022 that may be closed by this pull request
@ivan
Copy link
Member

ivan commented May 10, 2022

I applied this PR to NixOS master and did not have problems with grafana, victoriametrics, prometheus-node-exporter, prometheus-statsd-exporter, lego.

@zowoq
Copy link
Contributor Author

zowoq commented May 12, 2022

Due to the recent actions of another committer I don't really have much motivation to continue working on go / buildGo*.


To finish this PR:

  1. check all vendorSha256 hashes treewide and fix any that are broken (example below)
  2. fix or pin packages that fail to build
  • plenty of packages will have new breakage on x86_64-darwin due to the outdated (10.12) SDK, really need to go through them and mark as broken to avoid people wasting time filing issues or trying to fix them (they may not realise what the root cause is and that it currently can't be fixed).
  1. fix or pin packages with failing nixosTests
nix-build -A cni-plugin-flannel.go-modules --check
unpacking sources
unpacking source archive /nix/store/5palv2cyrzjx6mgxhaf4ajphr1v2l1vj-source
source root is source
patching sources
configuring
building
go: github.com/containernetworking/[email protected]: missing go.sum entry; to add it:
        go mod download github.com/containernetworking/cni
go: downloading github.com/containernetworking/cni v1.0.0
go: downloading github.com/containernetworking/plugins v1.0.0
go: downloading github.com/onsi/ginkgo v1.16.4
go: github.com/containernetworking/[email protected]: missing go.sum entry; to add it:
        go mod download github.com/containernetworking/cni
error: builder for '/nix/store/lxx49mf12pmnaa5hpkyi9ddfn3a8zhx7-cni-plugin-flannel-1.0.0-go-modules.drv' failed with exit code 1;
       last 10 log lines:
       > patching sources
       > configuring
       > building
       > go: github.com/containernetworking/[email protected]: missing go.sum entry; to add it:
       >  go mod download github.com/containernetworking/cni
       > go: downloading github.com/containernetworking/cni v1.0.0
       > go: downloading github.com/containernetworking/plugins v1.0.0
       > go: downloading github.com/onsi/ginkgo v1.16.4
       > go: github.com/containernetworking/[email protected]: missing go.sum entry; to add it:
       >  go mod download github.com/containernetworking/cni
       For full logs, run 'nix log /nix/store/lxx49mf12pmnaa5hpkyi9ddfn3a8zhx7-cni-plugin-flannel-1.0.0-go-modules.drv'.

@zowoq zowoq closed this May 12, 2022
@zowoq zowoq deleted the go118 branch May 12, 2022 02:58
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.

Upgrade to go 1.18 by default for 22.05
5 participants