diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index dad1f5094e..cc36bf5d73 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -131,16 +131,11 @@ load("//bazel/toolchains:go_module_deps.bzl", "go_dependencies") # gazelle:repository_macro bazel/toolchains/go_module_deps.bzl%go_dependencies go_dependencies() -load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies") +load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") go_rules_dependencies() -load("@io_tweag_rules_nixpkgs//nixpkgs:toolchains/go.bzl", "nixpkgs_go_configure") - -nixpkgs_go_configure( - nix_file = "//bazel/go:go.nix", - repository = "@nixpkgs", -) +go_register_toolchains(version = "1.21.5") load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") diff --git a/bazel/go/go.nix b/bazel/go/go.nix deleted file mode 100644 index 9a3985be92..0000000000 --- a/bazel/go/go.nix +++ /dev/null @@ -1,21 +0,0 @@ -let - pkgs = import { }; - goAttr = pkgs.go_1_21.overrideAttrs (_: rec { - version = "1.21.5"; - src = pkgs.fetchurl { - url = "https://go.dev/dl/go${version}.src.tar.gz"; - hash = "sha256-KFy730tubmLtWPNw8/bYwwgl1uVsWFPGbTwjvNsJ2xk="; - }; - }); -in -pkgs.buildEnv - { - name = "bazel-go-toolchain"; - paths = [ goAttr ]; - postBuild = '' - touch $out/ROOT - ln -s $out/share/go/{api,doc,lib,misc,pkg,src,go.env} $out/ - ''; - } // { - version = goAttr.version; -} diff --git a/dev-docs/workflows/bump-go-version.md b/dev-docs/workflows/bump-go-version.md index a8e8973085..4d0d23de2d 100644 --- a/dev-docs/workflows/bump-go-version.md +++ b/dev-docs/workflows/bump-go-version.md @@ -3,15 +3,8 @@ ## Steps -1. Replace "1.xx.x" with the new version (see [example](https://github.com/edgelesssys/constellation/commit/9e1a0c06bfda0171958f0776633a9a53f521144d)) -2. Update the nix hash +Replace "1.xx.x" with the new version in [WORKSPACE.bazel](/WORKSPACE.bazel): - Once updated run `bazel run //:tidy` and you will see a failure such as: - - ``` - > error: hash mismatch in fixed-output derivation '/nix/store/r85bdj6vrim7m5vlybdmzgca7d0kcb4n-go1.21.4.src.tar.gz.drv': - > specified: sha256-GG8rb4yLcE5paCGwmrIEGlwe4T3LwxVqE63PdZMe5Ig= - > got: sha256-R7Jqg9K2WjwcG8rOJztpvuSaentRaKdgTe09JqN714c= - ``` - Simple replace the hash with the got value. -3. Ask @katexochen to build the thing and push it into his cache. +```starlark +go_register_toolchains(version = "1.xx.x") +```