Go rules for Bazel

Overview

Go rules for Bazel

Mailing list: bazel-go-discuss

Slack: #go on Bazel Slack, #bazel on Go Slack

Announcements

2021-10-06
Release v0.29.0 is now available. This enables nogo analyzers to depend on go_library rules, removes the rules_cc dependency, adds automatic target detection to gopackagesdriver, and fixes some cgo-related bugs. See the release notes for details.
2021-07-07
Release v0.28.0 is now available. This adds experimental editor support, plus a few other changes. See the release notes for details. Thanks to all who contributed!
2021-03-18
Release v0.27.0 is now available. This updates org_golang_x_tools and adds org_golang_x_sys. This should have been done in v0.26.0. Additionally, v0.24.14 is now available with support for Go 1.16.2, 1.16.1, 1.15.10, and 1.15.9. This will be the last release on the 0.24 branch. 0.27 and 0.25 are now the two supported branches.
2021-03-08
Release v0.26.0 is now available. This provides support for the new //go:embed attribute, plus several other improvements. Gazelle v0.23.0 is also available with support for embedsrcs attributes (needed for //go:embed) and a few other improvements.

Contents

Documentation

Quick links

Overview

The rules are in the beta stage of development. They support:

They currently do not support or have limited support for:

The Go rules are tested and supported on the following host platforms:

  • Linux, macOS, Windows
  • amd64

Users have reported success on several other platforms, but the rules are only tested on those listed above.

Note: The latest version of these rules (v0.28.0) requires Bazel ≥ 4.0.0 to work.

The master branch is only guaranteed to work with the latest version of Bazel.

Setup

System setup

To build Go code with Bazel, you will need:

  • A recent version of Bazel.
  • A C/C++ toolchain (if using cgo). Bazel will attempt to configure the toolchain automatically.
  • Bash, patch, cat, and a handful of other Unix tools in PATH.

You normally won't need a Go toolchain installed. Bazel will download one.

See Using rules_go on Windows for Windows-specific setup instructions. Several additional tools need to be installed and configured.

Initial project setup

Create a file at the top of your repository named WORKSPACE, and add the snippet below (or add to your existing WORKSPACE). This tells Bazel to fetch rules_go and its dependencies. Bazel will download a recent supported Go toolchain and register it for use.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_rules_go",
    sha256 = "2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
        "https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
    ],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.17.1")

You can use rules_go at master by using git_repository instead of http_archive and pointing to a recent commit.

Add a file named BUILD.bazel in the root directory of your project. You'll need a build file in each directory with Go code, but you'll also need one in the root directory, even if your project doesn't have Go code there. For a "Hello, world" binary, the file should look like this:

load("@io_bazel_rules_go//go:def.bzl", "go_binary")

go_binary(
    name = "hello",
    srcs = ["hello.go"],
)

You can build this target with bazel build //:hello.

Generating build files

If your project can be built with go build, you can generate and update your build files automatically using gazelle.

Add the bazel_gazelle repository and its dependencies to your WORKSPACE. It should look like this:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "io_bazel_rules_go",
    sha256 = "8e968b5fcea1d2d64071872b12737bbb5514524ee5f0a4f54f5920266c261acb",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
        "https://github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
    ],
)

http_archive(
    name = "bazel_gazelle",
    sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
    ],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.17.2")

gazelle_dependencies()

Add the code below to the BUILD.bazel file in your project's root directory. Replace the string after prefix with an import path prefix that matches your project. It should be the same as your module path, if you have a go.mod file.

load("@bazel_gazelle//:def.bzl", "gazelle")

# gazelle:prefix github.com/example/project
gazelle(name = "gazelle")

This declares a gazelle binary rule, which you can run using the command below:

bazel run //:gazelle

This will generate a BUILD.bazel file with go_library, go_binary, and go_test targets for each package in your project. You can run the same command in the future to update existing build files with new source files, dependencies, and options.

Writing build files by hand

If your project doesn't follow go build conventions or you prefer not to use gazelle, you can write build files by hand.

In each directory that contains Go code, create a file named BUILD.bazel Add a load statement at the top of the file for the rules you use.

load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

For each library, add a go_library rule like the one below. Source files are listed in the srcs attribute. Imported packages outside the standard library are listed in the deps attribute using Bazel labels that refer to corresponding go_library rules. The library's import path must be specified with the importpath attribute.

go_library(
    name = "foo_library",
    srcs = [
        "a.go",
        "b.go",
    ],
    importpath = "github.com/example/project/foo",
    deps = [
        "//tools",
        "@org_golang_x_utils//stuff",
    ],
    visibility = ["//visibility:public"],
)

For tests, add a go_test rule like the one below. The library being tested should be listed in an embed attribute.

go_test(
    name = "foo_test",
    srcs = [
        "a_test.go",
        "b_test.go",
    ],
    embed = [":foo_lib"],
    deps = [
        "//testtools",
        "@org_golang_x_utils//morestuff",
    ],
)

For binaries, add a go_binary rule like the one below.

go_binary(
    name = "foo",
    srcs = ["main.go"],
)

Adding external repositories

For each Go repository, add a go_repository rule to WORKSPACE like the one below. This rule comes from the Gazelle repository, so you will need to load it. gazelle update-repos can generate or update these rules automatically from a go.mod or Gopkg.lock file.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Download the Go rules.
http_archive(
    name = "io_bazel_rules_go",
    sha256 = "2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
        "https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
    ],
)

# Download Gazelle.
http_archive(
    name = "bazel_gazelle",
    sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
    ],
)

# Load macros and repository rules.
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")

# Declare Go direct dependencies.
go_repository(
    name = "org_golang_x_net",
    importpath = "golang.org/x/net",
    sum = "h1:zK/HqS5bZxDptfPJNq8v7vJfXtkU7r9TLIoSr1bXaP4=",
    version = "v0.0.0-20200813134508-3edf25e44fcc",
)

# Declare indirect dependencies and register toolchains.
go_rules_dependencies()

go_register_toolchains(version = "1.17")

gazelle_dependencies()

protobuf and gRPC

To generate code from protocol buffers, you'll need to add a dependency on com_google_protobuf to your WORKSPACE.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "com_google_protobuf",
    sha256 = "d0f5f605d0d656007ce6c8b5a82df3037e1d8fe8b121ed42e536f569dec16113",
    strip_prefix = "protobuf-3.14.0",
    urls = [
        "https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.14.0.tar.gz",
        "https://github.com/protocolbuffers/protobuf/archive/v3.14.0.tar.gz",
    ],
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

You'll need a C/C++ toolchain registered for the execution platform (the platform where Bazel runs actions) to build protoc.

The proto_library rule is provided by the rules_proto repository. protoc-gen-go, the Go proto compiler plugin, is provided by the com_github_golang_protobuf repository. Both are declared by go_rules_dependencies. You won't need to declare an explicit dependency unless you specifically want to use a different version. See Overriding dependencies for instructions on using a different version.

gRPC dependencies are not declared by default (there are too many). You can declare them in WORKSPACE using go_repository. You may want to use gazelle update-repos to import them from go.mod.

See Proto dependencies, gRPC dependencies for more information. See also Avoiding conflicts.

Once all dependencies have been registered, you can declare proto_library and go_proto_library rules to generate and compile Go code from .proto files.

load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")

proto_library(
    name = "foo_proto",
    srcs = ["foo.proto"],
    deps = ["//bar:bar_proto"],
    visibility = ["//visibility:public"],
)

go_proto_library(
    name = "foo_go_proto",
    importpath = "github.com/example/protos/foo_proto",
    protos = [":foo_proto"],
    visibility = ["//visibility:public"],
)

A go_proto_library target may be imported and depended on like a normal go_library.

Note that recent versions of rules_go support both APIv1 (github.com/golang/protobuf) and APIv2 (google.golang.org/protobuf). By default, code is generated with github.com/golang/protobuf/cmd/protoc-gen-gen for compatibility with both interfaces. Client code may import use either runtime library or both.

FAQ

Go

Protocol buffers

Dependencies and testing

Can I still use the go command?

Yes, but not directly.

rules_go invokes the Go compiler and linker directly, based on the targets described with go_binary and other rules. Bazel and rules_go together fill the same role as the go command, so it's not necessary to use the go command in a Bazel workspace.

That said, it's usually still a good idea to follow conventions required by the go command (e.g., one package per directory, package paths match directory paths). Tools that aren't compatible with Bazel will still work, and your project can be depended on by non-Bazel projects.

Does this work with Go modules?

Yes, but not directly. Bazel ignores go.mod files, and all package dependencies must be expressed through deps attributes in targets described with go_library and other rules.

You can download a Go module at a specific version as an external repository using go_repository, a workspace rule provided by gazelle. This will also generate build files using gazelle.

You can import go_repository rules from a go.mod file using gazelle update-repos.

What's up with the go_default_library name?

This was used to keep import paths consistent in libraries that can be built with go build before the importpath attribute was available.

In order to compile and link correctly, rules_go must know the Go import path (the string by which a package can be imported) for each library. This is now set explicitly with the importpath attribute. Before that attribute existed, the import path was inferred by concatenating a string from a special go_prefix rule and the library's package and label name. For example, if go_prefix was github.com/example/project, for a library //foo/bar:bar, rules_go would infer the import path as github.com/example/project/foo/bar/bar. The stutter at the end is incompatible with go build, so if the label name was go_default_library, the import path would not include it. So for the library //foo/bar:go_default_library, the import path would be github.com/example/project/foo/bar.

Since go_prefix was removed and the importpath attribute became mandatory (see #721), the go_default_library name no longer serves any purpose. We may decide to stop using it in the future (see #265).

How do I cross-compile?

You can cross-compile by setting the --platforms flag on the command line. For example:

$ bazel build [email protected]_bazel_rules_go//go/toolchain:linux_amd64 //cmd

By default, cgo is disabled when cross-compiling. To cross-compile with cgo, add a _cgo suffix to the target platform. You must register a cross-compiling C/C++ toolchain with Bazel for this to work.

$ bazel build [email protected]_bazel_rules_go//go/toolchain:linux_amd64_cgo //cmd

Platform-specific sources with build tags or filename suffixes are filtered automatically at compile time. You can selectively include platform-specific dependencies with select expressions (Gazelle does this automatically).

go_library(
    name = "foo",
    srcs = [
        "foo_linux.go",
        "foo_windows.go",
    ],
    deps = select({
        "@io_bazel_rules_go//go/platform:linux_amd64": [
            "//bar_linux",
        ],
        "@io_bazel_rules_go//go/platform:windows_amd64": [
            "//bar_windows",
        ],
        "//conditions:default": [],
    }),
)

To build a specific go_binary or go_test target for a target platform, set the goos and goarch attributes on that rule. This is useful for producing multiple binaries for different platforms in a single build. You can equivalently depend on a go_binary or go_test rule through a Bazel configuration transition on //command_line_option:platforms (there are problems with this approach prior to rules_go 0.23.0).

How do I access testdata?

Bazel executes tests in a sandbox, which means tests don't automatically have access to files. You must include test files using the data attribute. For example, if you want to include everything in the testdata directory:

go_test(
    name = "foo_test",
    srcs = ["foo_test.go"],
    data = glob(["testdata/**"]),
    importpath = "github.com/example/project/foo",
)

By default, tests are run in the directory of the build file that defined them. Note that this follows the Go testing convention, not the Bazel convention followed by other languages, which run in the repository root. This means that you can access test files using relative paths. You can change the test directory using the rundir attribute. See go_test.

Gazelle will automatically add a data attribute like the one above if you have a testdata directory unless it contains buildable .go files or build files, in which case, testdata is treated as a normal package.

Note that on Windows, data files are not directly available to tests, since test data files rely on symbolic links, and by default, Windows doesn't let unprivileged users create symbolic links. You can use the github.com/bazelbuild/rules_go/go/tools/bazel library to access data files.

How do I access go_binary executables from go_test?

The location where go_binary writes its executable file is not stable across rules_go versions and should not be depended upon. The parent directory includes some configuration data in its name. This prevents Bazel's cache from being poisoned when the same binary is built in different configurations. The binary basename may also be platform-dependent: on Windows, we add an .exe extension.

To depend on an executable in a go_test rule, reference the executable in the data attribute (to make it visible), then expand the location in args. The real location will be passed to the test on the command line. For example:

go_binary(
    name = "cmd",
    srcs = ["cmd.go"],
)

go_test(
    name = "cmd_test",
    srcs = ["cmd_test.go"],
    args = ["$(location :cmd)"],
    data = [":cmd"],
)

See //tests/core/cross for a full example of a test that accesses a binary.

Alternatively, you can set the out attribute of go_binary to a specific filename. Note that when out is set, the binary won't be cached when changing configurations.

go_binary(
    name = "cmd",
    srcs = ["cmd.go"],
    out = "cmd",
)

go_test(
    name = "cmd_test",
    srcs = ["cmd_test.go"],
    data = [":cmd"],
)

How do I avoid conflicts with protocol buffers?

See Avoiding conflicts in the proto documentation.

Can I use a vendored gRPC with go_proto_library?

This is not supported. When using go_proto_library with the @io_bazel_rules_go//proto:go_grpc compiler, an implicit dependency is added on @org_golang_google_grpc//:go_default_library. If you link another copy of the same package from //vendor/google.golang.org/grpc:go_default_library or anywhere else, you may experience conflicts at compile or run-time.

If you're using Gazelle with proto rule generation enabled, imports of google.golang.org/grpc will be automatically resolved to @org_golang_google_grpc//:go_default_library to avoid conflicts. The vendored gRPC should be ignored in this case.

If you specifically need to use a vendored gRPC package, it's best to avoid using go_proto_library altogether. You can check in pre-generated .pb.go files and build them with go_library rules. Gazelle will generate these rules when proto rule generation is disabled (add # gazelle:proto disable_global to your root build file).

How do I use different versions of dependencies?

See Overriding dependencies for instructions on overriding repositories declared in go_rules_dependencies.

How do I run Bazel on Travis CI?

References:

In order to run Bazel tests on Travis CI, you'll need to install Bazel in the before_install script. See our configuration file linked above.

You'll want to run Bazel with a number of flags to prevent it from consuming a huge amount of memory in the test environment.

  • --host_jvm_args=-Xmx500m --host_jvm_args=-Xms500m: Set the maximum and initial JVM heap size. Keeping the same means the JVM won't spend time growing the heap. The choice of heap size is somewhat arbitrary; other configuration files recommend limits as high as 2500m. Higher values mean a faster build, but higher risk of OOM kill.
  • --bazelrc=.test-bazelrc: Use a Bazel configuration file specific to Travis CI. You can put most of the remaining options in here.
  • build --spawn_strategy=standalone --genrule_strategy=standalone: Disable sandboxing for the build. Sandboxing may fail inside of Travis's containers because the mount system call is not permitted.
  • test --test_strategy=standalone: Disable sandboxing for tests as well.
  • --local_resources=1536,1.5,0.5: Set Bazel limits on available RAM in MB, available cores for compute, and available cores for I/O. Higher values mean a faster build, but higher contention and risk of OOM kill.
  • --noshow_progress: Suppress progress messages in output for cleaner logs.
  • --verbose_failures: Get more detailed failure messages.
  • --test_output=errors: Show test stderr in the Travis log. Normally, test output is written log files which Travis does not save or report.

Downloads on Travis are relatively slow (the network is heavily contended), so you'll want to minimize the amount of network I/O in your build. Downloading Bazel and a Go SDK is a huge part of that. To avoid downloading a Go SDK, you may request a container with a preinstalled version of Go in your .travis.yml file, then call go_register_toolchains(go_version = "host") in a Travis-specific WORKSPACE file.

You may be tempted to put Bazel's cache in your Travis cache. Although this can speed up your build significantly, Travis stores its cache on Amazon, and it takes a very long time to transfer. Clean builds seem faster in practice.

How do I test a beta version of the Go SDK?

rules_go only supports official releases of the Go SDK. However, you can still test beta and RC versions by passing a version like "1.16beta1" to go_register_toolchains. See also go_download_sdk.

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.17beta1")
Issues
  • new_library: remove unused resolver

    new_library: remove unused resolver

    _testmain_library_to_source was introduced in 1c4f6fd1 and last usage of this resolver was in 56e5592c.

    > git log -S'_testmain_library_to_source' --oneline
    56e5592c Move the test library rule to be go_test internal actions (#1267)
    9031d58e Add GoContext (#1140)
    1c4f6fd1 Fix aspect based proto builds (#1131)
    

    Let's remove the unused resolver and replace the documentation with the resolver that is actually being used.

    opened by sluongng 1
  • building with race detection (`@io_bazel_rules_go//go/config:race`) is very slow especially if using Go binaries to generate code

    building with race detection (`@io_bazel_rules_go//go/config:race`) is very slow especially if using Go binaries to generate code

    Over at Cockroach we are having this issue where building a go_test with [email protected]_bazel_rules_go//go/config:race takes a very long time. The fact that the stdlib needs to be recompiled with race detection is a problem, but more relevant seems to be that building a target with race detection invalidates the cache for all go_binarys used to produce that target, including go_binarys that are built as exec_tools for a genrule, and causes all of them to be re-built with race detection. If you use Go code to generate other Go code (as we do), the problem is now twofold:

    • previous builds of the go_binary for code generation cannot be reused, so the binary (and presumably all or most of its dependencies) needs to be rebuilt with race detection enabled (a slower build process in and of itself).
    • because of the overhead imposed by the race detector, running the binary itself becomes much slower (potentially for no reason as I probably don't care about races in code generators, and probably only care about the code under test).

    Since our code generators produce identical output regardless of whether race detection is enabled, it's very wasteful to re-build the code generators and then run a much slower version of the binary as part of the race build.

    Presumably this behavior is OK by default, but there should be a workaround. I have tried updating the go_binary declaration for these code generating binaries to have race = "off" but it appears to have no effect -- setting the value on the command line overrides everything in BUILD files. It would be sufficient if I could have a way to specify that certain targets really do not need to be built with race detection despite the command-line flags.

    What version of rules_go are you using?

    0.32

    What version of gazelle are you using?

    0.25

    What version of Bazel are you using?

    5.1.0

    Does this issue reproduce with the latest releases of all the above?

    Yes

    What operating system and processor architecture are you using?

    Darwin ARM64

    Any other potentially useful information about your toolchain?

    (None)

    What did you do?

    Tried setting race = "off" for code-generating go_binary target when building a target that depends on that target as an exec_tool.

    What did you expect to see?

    Ideally the code-generating binary would not be built with race-detection especially if I set race = "off" manually.

    What did you see instead?

    Code-generating binary is built with race detection, invalidating the cache and slowing the entire build down.

    opened by rickystewart 0
  • nogo: ignore generated source files

    nogo: ignore generated source files

    Under GoCompilePkg actions, there are several ways that source files could have been modified / generated that is out of end users control:

    • go_test would generate an '_empty.go' file for the missing internal/external package to compile it.

    • coverage instrumentation would rewrite test source files with a wrapper source file that collects coverage data into a determined variable.

    • CGO usage would transform the original source files into several output Go and C source files with go tool cgo ...

    Implement a mechanism to ignore the generated source files for the first 2 cases and instruct static analyzers to run over the original source files wherever applicable. This provides a better default for rules_go users as static analysis errors over these generated files are outside of their control and thus, could not be fixed.

    Add a note regarding the CGO case for future investigations.

    Replacement of #2996 Fixes https://github.com/bazelbuild/rules_go/pull/2984

    opened by sluongng 6
  • nogo: instantiate type info for generic types when running under Go >=1.18

    nogo: instantiate type info for generic types when running under Go >=1.18

    This mirrors what golang.org/x/tools/go/packages does when loading packages.

    Should fix #3211 (and probably #3164 as well).

    What type of PR is this?

    Bug fix

    What does this PR do? Why is it needed?

    This PR adds an initialization that is required for the package loader in nogo to load instantiation information for generic types. This takes a lot of inspiration from what the package loader in golang.org/x/tools does.

    Which issues(s) does this PR fix?

    Fixes #3211 and #3164

    Other notes for review

    ~My company signed the CLA, but it looks like that fact has to percolate through something at Google.~

    opened by farhaven 4
  • nogo: compilepkg: panic: 0: got 0 arguments but 1 type parameters when checking Go package that uses generics

    nogo: compilepkg: panic: 0: got 0 arguments but 1 type parameters when checking Go package that uses generics

    What version of rules_go are you using?

    v0.33.0

    What version of gazelle are you using?

    v0.25.0

    What version of Bazel are you using?

    % bazel version
    Bazelisk version: development
    Build label: 5.2.0
    Build target: bazel-out/darwin_arm64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
    Build time: Tue Jun 7 16:11:09 2022 (1654618269)
    Build timestamp: 1654618269
    Build timestamp as int: 1654618269
    

    Does this issue reproduce with the latest releases of all the above?

    Yes

    What operating system and processor architecture are you using?

    % uname -a
    Darwin Gregors-MacBook-Pro.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan  5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 arm64
    

    Any other potentially useful information about your toolchain?

    None that comes to mind.

    What did you do?

    Ran nogo with the nilness checker on a Go package that uses generics. This repository contains a reproducer.

    What did you expect to see?

    I expected the build to pass and the nilness check to be successful.

    What did you see instead?

    % bazel build //...
    Loading:
    Loading: 0 packages loaded
    Analyzing: 3 targets (0 packages loaded, 0 targets configured)
    INFO: Analyzed 3 targets (0 packages loaded, 0 targets configured).
    INFO: Found 3 targets...
    [0 / 2] [Prepa] BazelWorkspaceStatusAction stable-status.txt ... (2 actions, 0 running)
    ERROR: /Users/gregorbest/code/tmp/BUILD.bazel:10:11: GoCompilePkg genset.a failed: (Exit 1): builder failed: error executing command bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix darwin_arm64 -src genset.go -embedroot '' -embedroot ... (remaining 21 arguments skipped)
    
    Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
    compilepkg: panic: 0: got 0 arguments but 1 type parameters
    
    goroutine 19 [running]:
    go/types.(*Checker).validateTArgLen(0x1400018c000?, 0x140001b6000?, 0x1, 0x0)
    	GOROOT/src/go/types/instantiate.go:131 +0x14c
    go/types.(*Checker).instance(0x0, 0x0, {0x1007bd9c8?, 0x1400011c180?}, {0x10092ec60?, 0x0, 0x0}, 0x1400018c000)
    	GOROOT/src/go/types/instantiate.go:89 +0x12c
    go/types.Instantiate(0x0?, {0x1007bd9c8?, 0x1400011c180?}, {0x10092ec60?, 0x14000182b10?, 0x30?}, 0x0?)
    	GOROOT/src/go/types/instantiate.go:59 +0x2a4
    golang.org/x/tools/internal/typeparams.Instantiate(...)
    	external/org_golang_x_tools/internal/typeparams/typeparams_go118.go:150
    golang.org/x/tools/go/ssa.createInstance(0x140001941a0, {0x10092ec60?, 0x0, 0x0}, 0x14000095950, {0x1007bd3b0?, 0x1400009b440}, 0x14000190060)
    	external/org_golang_x_tools/go/ssa/instantiate.go:128 +0xcc
    golang.org/x/tools/go/ssa.(*instanceSet).lookupOrCreate(0x1400018c020, {0x10092ec60, 0x0, 0x0}, 0x140000b6ad8?)
    	external/org_golang_x_tools/go/ssa/instantiate.go:110 +0xe8
    golang.org/x/tools/go/ssa.(*Program).needsInstance(0x100780aa0?, 0x0?, {0x10092ec60, 0x0, 0x0}, 0x140000b6ce8?)
    	external/org_golang_x_tools/go/ssa/instantiate.go:85 +0x110
    golang.org/x/tools/go/ssa.(*builder).expr0(0x140000b79f0, 0x140001944e0, {0x1007be0f8?, 0x140000c0920?}, {0x7, {0x1007bd9c8, 0x1400011ccc0}, {0x0, 0x0}})
    	external/org_golang_x_tools/go/ssa/builder.go:781 +0xac8
    golang.org/x/tools/go/ssa.(*builder).expr(0x140000b6ef8?, 0x140001944e0, {0x1007be0f8?, 0x140000c0920?})
    	external/org_golang_x_tools/go/ssa/builder.go:610 +0x134
    golang.org/x/tools/go/ssa.(*builder).setCallFunc(0x100ae8a68?, 0x80?, 0x14000080480?, 0x14000190140)
    	external/org_golang_x_tools/go/ssa/builder.go:1006 +0x2f4
    golang.org/x/tools/go/ssa.(*builder).setCall(0x10077fa20?, 0x1400009bad0?, 0x140000b3f40, 0x14000190140)
    	external/org_golang_x_tools/go/ssa/builder.go:1085 +0x30
    golang.org/x/tools/go/ssa.(*builder).expr0(0x140000b79f0, 0x140001944e0, {0x1007bddf8?, 0x140000b3f40?}, {0x7, {0x1007bd9a0, 0x14000099b40}, {0x0, 0x0}})
    	external/org_golang_x_tools/go/ssa/builder.go:686 +0x2354
    golang.org/x/tools/go/ssa.(*builder).expr(0x14000080480?, 0x140001944e0, {0x1007bddf8?, 0x140000b3f40?})
    	external/org_golang_x_tools/go/ssa/builder.go:610 +0x134
    golang.org/x/tools/go/ssa.(*builder).stmt(0x140000b7508?, 0x140001944e0, {0x1007be338?, 0x140000c0960?})
    	external/org_golang_x_tools/go/ssa/builder.go:2161 +0x12d8
    golang.org/x/tools/go/ssa.(*builder).stmtList(0x14000182ae0?, 0x1?, {0x140000996b0?, 0x1, 0x30?})
    	external/org_golang_x_tools/go/ssa/builder.go:911 +0x6c
    golang.org/x/tools/go/ssa.(*builder).stmt(0x140001944e0?, 0x140001944e0, {0x1007bdd98?, 0x1400009b740?})
    	external/org_golang_x_tools/go/ssa/builder.go:2218 +0x8b8
    golang.org/x/tools/go/ssa.(*builder).buildFunctionBody(0x14000194000?, 0x140001944e0)
    	external/org_golang_x_tools/go/ssa/builder.go:2327 +0x3a4
    golang.org/x/tools/go/ssa.(*builder).buildFunction(0x1006e2bd0?, 0x140001944e0)
    	external/org_golang_x_tools/go/ssa/builder.go:2267 +0x34
    golang.org/x/tools/go/ssa.(*builder).buildCreated(0x1400010f9f0)
    	external/org_golang_x_tools/go/ssa/builder.go:2349 +0x2c
    golang.org/x/tools/go/ssa.(*Package).build(0x14000190000)
    	external/org_golang_x_tools/go/ssa/builder.go:2529 +0xab8
    sync.(*Once).doSlow(0x1400018e000?, 0x140000959a0?)
    	GOROOT/src/sync/once.go:68 +0x10c
    sync.(*Once).Do(...)
    	GOROOT/src/sync/once.go:59
    golang.org/x/tools/go/ssa.(*Package).Build(...)
    	external/org_golang_x_tools/go/ssa/builder.go:2413
    golang.org/x/tools/go/analysis/passes/buildssa.run(0x14000184000)
    	external/org_golang_x_tools/go/analysis/passes/buildssa/buildssa.go:73 +0x13c
    main.(*action).execOnce(0x140000de510)
    	external/io_bazel_rules_go/go/tools/builders/nogo_main.go:301 +0x764
    sync.(*Once).doSlow(0x0?, 0x0?)
    	GOROOT/src/sync/once.go:68 +0x10c
    sync.(*Once).Do(...)
    	GOROOT/src/sync/once.go:59
    main.(*action).exec(0x0?)
    	external/io_bazel_rules_go/go/tools/builders/nogo_main.go:245 +0x44
    main.execAll.func1(0x0?)
    	external/io_bazel_rules_go/go/tools/builders/nogo_main.go:239 +0x50
    created by main.execAll
    	external/io_bazel_rules_go/go/tools/builders/nogo_main.go:237 +0x48
    INFO: Elapsed time: 0.254s, Critical Path: 0.09s
    INFO: 2 processes: 2 internal.
    FAILED: Build did NOT complete successfully
    FAILED: Build did NOT complete successfully
    

    Manually running the nilness checker works fine:

    % go run golang.org/x/tools/go/analysis/passes/nilness/cmd/[email protected] ./...
    %
    

    The good folks in #tools on the Gophers Slack suggested that the issue might be that nogo doesn't correctly populate the passes' TypesInfo field.

    opened by farhaven 0
Releases(v0.33.0)
  • v0.33.0(Jun 6, 2022)

    Breaking changes

    Deprecations

    • The asm, compile, and pack action generators provided by go_context are deprecated and planned for removal in version v0.36.0. Please leave a comment on the tracking bug if archive and link are not suitable replacements for your use cases.

    Bug Fixes

    • @sluongng fixed a race condition that could cause non-sandboxed builds of go_test targets to fail (https://github.com/bazelbuild/rules_go/pull/3145)
    • @abhinav made //go:embed work with go_path (https://github.com/bazelbuild/rules_go/pull/3163)
    • @xytan0056 made gopackagesdriver work with Go 1.18 (https://github.com/bazelbuild/rules_go/pull/3157)
    • @nickgooding ensured that gomock can be used with any Gazelle naming convention (https://github.com/bazelbuild/rules_go/pull/3155)
    • go_library targets using CGo can now reference unresolved symbols (https://github.com/bazelbuild/rules_go/pull/3174)

    Thanks to all of the contributors!

    Compatibility

    The minimum required version of Bazel remains at 4.2.1.

    Updated dependencies

    • Updated org_golang_x_sys, org_golang_x_xerrors, org_golang_google_genproto, go_googleapis to their most recent commit as of 2022-06-05

    As always, you can use higher versions of rules_go's dependencies by declaring them in WORKSPACE before calling go_rules_dependencies. Lower versions may work but are not supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "685052b498b6ddfe562ca7a97736741d87916fe536623afb7da2824c0211c369",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.33.0/rules_go-v0.33.0.zip",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.33.0/rules_go-v0.33.0.zip",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains(version = "1.18.3")
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.33.0.zip(1.10 MB)
  • v0.32.0(May 11, 2022)

    This release brings many exciting changes

    New features

    • gomock rule is officially supported in rules_go (doc), replacing the original jmhodges/bazel_gomock repository. Thanks to @jmhodges for the original implementation.
    • rules_go now generates coverage reports in LCOV format by default (#3117), to be compatible with Bazel's --combined_report=lcov. To generate reports in the old go tool cover format, please use --//go/config:cover_format=go_cover. Thanks to @fmeum @abhinav
    • supporting windows/arm64 (#3072). Thanks to @nsait-linaro
    • nogo config can now takes analyzer_flags (#3082), thanks to @NavneethJayendran

    Bug fixes

    • Consider volatile and stable status files separately (#3079) Thanks to @siddharthab
    • Reducing duplicate information passed by go_pkg_info_aspect (#3111)
    • Fix include paths for CGo deps in external repositories (#3115) thanks to @fmeum
    • Revert change to use resolved shared lib links (#2907), thanks to @glukasiknuro
    • Fix lost x_defs on test execution (#3135), thanks to @bozaro
    • Let go_binary's executable bit depend on linkmode (#3143) thanks to @fmeum

    Deprecations

    go_embed_data and bindata will be deprecated in rules_go 0.35.0. Users are encourage to migrate to go:embed and embedsrcs.

    Other changes

    • Use output dir for empty packages to be hermetic (#3098), thanks to @joeljeske
    • Prevent downgrading platforms (#3076), thanks to @cpsauer
    • Doc improvements (#3100), thanks to @sluongng
    • Remove legacy proto code for Bazel < 0.21 (#3099), thanks to @cpsauer
    • Remove unused coverage code (#3118), thanks to @fmeum
    • Moving tests for go_embed_data and gomock to tests/extras (#3122)
    • Add command line copts/cxxopts to Cgo compile flags (#3126), thanks to @dchen496
    • Reset Go settings for protoc dependencies (#3005), thanks to @fmeum
    • Trim transitioned Go settings on non-Go dependencies (#3108), thanks to @fmeum

    Updated dependencies

    As always, you can use higher versions of rules_go's dependencies by declaring them in WORKSPACE before calling go_rules_dependencies. Lower versions may work but are not supported.

    • org_golang_google_protobuf updated to v1.28.0
    • org_golang_x_sys, org_golang_x_xerrors, org_golang_google_genproto and go_googleapis updated to master, as of 2022-05-09

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "ab21448cef298740765f33a7f5acee0607203e4ea321219f2a4c85a6e0fb0a27",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.32.0/rules_go-v0.32.0.zip",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.32.0/rules_go-v0.32.0.zip",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains(version = "1.18.2")
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.32.0.zip(1.09 MB)
  • v0.31.0(Mar 21, 2022)

    This is a maintenance release to support Bazel 5.0. No new feature was added since last release.

    Changes

    • Add support for bazel 5.0.0 (#3068). Thanks to @moisesvega
    • Update documents (#3057, #3067). Thanks to @bcspragu and @jeongukjae
    • BUILD file clean up. Thanks to @JamyDev
    • symlink everything under lib/ when using local SDK (#3074). Thanks to @irfansharif

    Updated dependencies

    As always, you can use higher versions of rules_go's dependencies by declaring them in WORKSPACE before calling go_rules_dependencies. Lower versions may work but are not supported.

    • platforms updated to 0.0.5 as of 2022-03-14.
    • bazel_skylib updated to 1.2.1 as of 2022-03-14.
    • org_golang_x_tools updated to v0.1.9 as of 2022-03-14.
    • org_golang_x_sys updated to master as of 2022-03-14.
    • org_golang_google_genproto updated to main as of 2022-03-14.
    • go_googleapis updated to master as of 2022-03-14.

    Thanks @moisesvega for updating the dependencies and preparing the release notes.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "f2dcd210c7095febe54b804bb1cd3a58fe8435a909db2ec04e31542631cf715c",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.31.0/rules_go-v0.31.0.zip",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.31.0/rules_go-v0.31.0.zip",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains(version = "1.18")
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.31.0.zip(1.00 MB)
  • v0.30.0(Jan 24, 2022)

    Changes

    • Add first class support for GOOS=ios (#3013)

    • Always include debug symbols with -c dbg (#3029)

      Previously, debugging a go_test target was only possible with an explicit [email protected]_bazel_rules_go//go/config:debug.

    • go_test: Add env attribute (#3004)

      This allows setting environment variables before static initialisers run, and which reference expanded locations.

    • tests/core/cgo: do not assume test is being run from main repo (#2956)

    • reproducibility_test: explicitly build the go_sdk builder (#3026)

    • map bazel's --test_runner_fail_fast to go's -failfast (#3058)

    Bug Fixes

    • Emit correct header in CGo c-archive (#2874)
    • Append path into trimpath if option already exists (#2994)
    • Fixed issue with go_bazel_test rule on Windows (#3036)
    • Skipping linker flag for versioned dylib on Darwin (#2989)
    • Trim absolute paths in files generated by cgo (#3011)
    • builders/cover: register coverage without changing line numbers (#2993)
    • cover: use Z instead of underscore for variable name separator (#2995)
    • .bazelci/presubmit.yml: remove old flag (#3023)
    • builders/gentestmain: register correct cover mode in the coverage report file when enabling race mode (#3019)
    • -fsanitize-ignorelist should have an absolute path (#3001)
    • internal changes: #2942, #2987, #2988, #2992, #3000, #3035, #3038, #3046

    Thanks to all of the contributors

    Compatibility

    • Bazel 4.2.1 or higher is now required. The previous minimum version was 4.2.0.

    Updated dependencies

    As always, you can use higher versions of rules_go's dependencies by declaring them in WORKSPACE before calling go_rules_dependencies. Lower versions may work but are not supported.

    • org_golang_x_tools updated to v0.1.8 (#3031)
    • org_golang_x_sys updated to master as of 2022-01-24.
    • org_golang_google_genproto updated to master as of 2022-01-24.
    • go_googleapis updated to master as of 2022-01-24.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "d6b2513456fe2229811da7eb67a444be7785f5323c6708b38d851d2b51e54d83",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.30.0/rules_go-v0.30.0.zip",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains(version = "1.17.6")
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.30.0.zip(1.00 MB)
  • v0.29.0(Oct 6, 2021)

    Changes

    • nogo analyzers may now depend on go_library rules (#2922).

      This is a major upgrade to nogo usability that enables the use of the popular staticcheck tool, via https://github.com/sluongng/staticcheck-codegen.

      This requires an update to Gazelle v0.24

      Many thanks to @thomas-wk

    • Editor / IDE integration (gopackagesdriver) now supports automatic target detection (#2932).

      No user input is required after the GOPACKAGESDRIVER setup. This effectively deprecates the following environment variables:

      • GOPACKAGESDRIVER_BAZEL_TARGETS
      • GOPACKAGESDRIVER_BAZEL_QUERY
      • GOPACKAGESDRIVER_BAZEL_TAG_FILTERS

      Many thanks to @steeve for his ongoing development of gopackagesdriver

    • The rules_cc dependency has been removed (#2950).

    • rules_go tool builds are now reproducible (#2952).

    • cgo-related bug fixes: #2930, #2925, #2947, #2926.

    Thanks to all of the contributors.

    Compatibility

    • Bazel 4.2.0 or higher is now required. The previous minimum version was 4.0.0.

    Updated dependencies

    As always, you can use higher versions of rules_go's dependencies by declaring them in WORKSPACE before calling go_rules_dependencies. Lower versions may work but are not supported.

    • bazel_skylib updated to v1.1.1
    • org_golang_x_tools updated to v0.1.7
    • org_golang_x_sys updated to master as of 2021-10-06.
    • org_golang_google_genproto updated to master as of 2021-10-06.
    • go_googleapis updated to master as of 2021-10-06.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains(version = "1.17.1")
    
    http_archive(
        name = "bazel_gazelle",
        sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
            "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
        ],
    )
    
    load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
    
    gazelle_dependencies()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.29.0.zip(952.16 KB)
  • v0.28.0(Jul 7, 2021)

    Changes

    • Experimental editor / IDE integration added in the form of a gopackagesdriver tool that reports information about the Bazel workspace to gopls (or any other tool based on golang.org/x/tools/go/packages). See the Editor setup on the wiki for information and setup instructions. Huge thanks to @steeve for shipping this.
    • Target platform may be automatically inferred from --crosstool_top and --cpu for iOS and Android platforms that still require these flags. Again, thanks to @steeve.
    • go_proto_library no longer implicitly depends on APIv1 Well Known Type packages. Since protoc 3.14, the Well Known Types declare APIv2 package paths, which means generated code that imports them will import APIv2 packages, so the APIv1 dependencies are unnecessary.

    Compatibility

    • Bazel 4.0.0 (LTS) or higher is now required. The previous minimum version was 3.5.0.

    Updated dependencies

    As always, you can use higher versions of rules_go's dependencies by declaring them in WORKSPACE before calling go_rules_dependencies. Lower versions may work but are not supported.

    • org_golang_x_tools updated to v0.1.4
    • org_golang_x_sys updated to master as of 2021-06-30.
    • rules_cc updated to main as of 2021-06-30.
    • org_golang_google_protobuf updated to v1.27.1.
    • org_github_golang_protobuf updated to v1.5.2.
    • org_golang_google_genproto updated to master as of 2021-06-30.
    • go_googleapis updated to master as of 2021-06-30.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "8e968b5fcea1d2d64071872b12737bbb5514524ee5f0a4f54f5920266c261acb",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.28.0/rules_go-v0.28.0.zip",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains(version = "1.16.5")
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.28.0.zip(923.96 KB)
  • v0.27.0(Mar 18, 2021)

    Updated dependencies

    This release updates golang.org/x/tools, which was mistakenly not updated in v0.26.0. Additionally, the latest version of golang.org/x/tools requires golang.org/x/sys/execabs, so that module is added as a new dependency.

    As always, you can use higher versions of rules_go's dependencies by declaring them in WORKSPACE before calling go_rules_dependencies. Lower versions may work but are not supported.

    • org_golang_x_tools is updated to v0.1.0.
    • org_golang_x_sys is added at master as of 2021-03-17.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "69de5c704a05ff37862f7e0f5534d4f479418afc21806c887db544a316f3cb6b",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.27.0/rules_go-v0.27.0.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains(version = "1.16.2")
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.27.0.tar.gz(618.85 KB)
  • v0.24.14(Mar 17, 2021)

    New Go versions

    Go 1.16.2, 1.16.1, 1.15.10, and 1.15.9 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "e0015762cdeb5a2a9c48f96fb079c6a98e001d44ec23ad4fa2ca27208c5be4fb",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.14/rules_go-v0.24.14.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.14/rules_go-v0.24.14.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.14.tar.gz(512.53 KB)
  • v0.26.0(Mar 8, 2021)

    Changes

    • //go:embed directives are supported in Go 1.16. Patterns are matched against both static and generated files, including directory artifacts. Embeddable files must be listed in the new embedsrcs attribute. Gazelle v0.23.0 will generate these attributes automatically.
    • go_binary now provides CcInfo in the c-archive and c-shared link modes. This should let cc_library and other rules reference these targets through deps directly. Thanks @steeve.
    • TEST_TMPDIR is no longer set to TMPDIR in tests. Thanks @mikedanese.
    • Several small improvements in error and diagnostic output.

    Compatibility

    • Bazel 3.5.0 is now required. The previous minimum version was 3.4.0.

    Updated dependencies

    As always, you can use higher versions of rules_go's dependencies by declaring them in WORKSPACE before calling go_rules_dependencies. Lower versions may work but are not supported.

    • platforms is updated to 0.0.4.
    • rules_cc is updated to master as of 2021-03-05.
    • org_golang_x_tools is updated to master as of 2021-03-05.
    • org_golang_google_genproto is updated to master as of 2021-03-05.
    • go_googleapis is updated to master as of 2021-03-05.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "7c10271940c6bce577d51a075ae77728964db285dac0a46614a7934dc34303e6",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.26.0/rules_go-v0.26.0.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.26.0/rules_go-v0.26.0.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains(version = "1.16")
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.26.0.tar.gz(593.15 KB)
  • v0.24.13(Feb 16, 2021)

    New Go versions

    Go 1.16 is now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "52d0a57ea12139d727883c2fef03597970b89f2cc2a05722c42d1d7d41ec065b",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.13/rules_go-v0.24.13.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.13/rules_go-v0.24.13.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.13.tar.gz(510.80 KB)
  • v0.24.12(Feb 5, 2021)

    New Go versions

    Go 1.15.8 and 1.14.15 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "4d838e2d70b955ef9dd0d0648f673141df1bc1d7ecf5c2d621dcc163f47dd38a",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.12/rules_go-v0.24.12.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.12/rules_go-v0.24.12.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.12.tar.gz(510.44 KB)
  • v0.24.11(Jan 19, 2021)

    New Go versions

    Go 1.15.7 and 1.14.14 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "dbf5a9ef855684f84cac2e7ae7886c5a001d4f66ae23f6904da0faaaef0d61fc",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.11/rules_go-v0.24.11.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.11/rules_go-v0.24.11.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.11.tar.gz(509.36 KB)
  • v0.25.1(Dec 23, 2020)

    Bug fixes

    • Fixed an issue in go_test with capturing XML output when changing directories.
    • Paths in error messages are now relativized. This should reduce noise from Bazel sandbox directories. (thanks @robfig)
    • go_local_sdk provides better error messages when Go is built for multiple platforms. (thanks @prattmic)
    • Multiple compatibility fixes for Go 1.16beta1.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "7904dbecbaffd068651916dce77ff3437679f9d20e1a7956bff43826e7645fcc",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.25.1/rules_go-v0.25.1.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.25.1/rules_go-v0.25.1.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains(version = "1.15.6")
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.25.1.tar.gz(552.65 KB)
  • v0.24.10(Dec 23, 2020)

    Bug fixes

    • Paths in error messages are now relativized. This should reduce noise from Bazel sandbox directories. (thanks @robfig)
    • go_local_sdk provides better error messages when Go is built for multiple platforms. (thanks @prattmic)
    • Multiple compatibility fixes for Go 1.16beta1.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "8e9434015ff8f3d6962cb8f016230ea7acc1ac402b760a8d66ff54dc11673ca6",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.10/rules_go-v0.24.10.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.10/rules_go-v0.24.10.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.10.tar.gz(508.39 KB)
  • v0.24.9(Dec 3, 2020)

    New Go versions

    Go 1.15.6 and 1.14.13 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "81eff5df9077783b18e93d0c7ff990d8ad7a3b8b3ca5b785e1c483aacdb342d7",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.9/rules_go-v0.24.9.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.9/rules_go-v0.24.9.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.9.tar.gz(507.69 KB)
  • v0.25.0(Dec 2, 2020)

    Changes

    • go_download_sdk and go_register_toolchains can now download any version of Go from golang.org/dl without the need for hardcoded support in rules_go.
      • Consequently, the version parameter must be set to a string like "1.15.5" or to "host". This requires a change to WORKSPACE for most users. See go_register_toolchains for details.
      • go_download_sdk queries https://golang.org/dl in order to find SHA-256 of toolchains. Bazel won't cache downloaded files without these. If your build has limited network access, use version = "host" or set the sdks and urls attributes in go_download_sdk.
      • As a result of this change, rules_go will no longer need patch releases for new Go versions. The v0.24 branch will still be patched as long as it's supported.
    • Package conflicts are now errors rather than warnings. The linker already reports errors for most of these since Go 1.15.
    • rules_go now uses Bazel's modern C/C++ Starlark linker API.
    • go_path supports the include_transitive attribute, which controls whether transitively imported packages are included (thanks @steeve)
    • go_test changes to the test directory in an init function run before other package inits instead of in main (thanks @dragonsinth)
    • Several deprecated features were removed. See Deprecation schedule for information on removals.
      • go_rule wrapper.
      • go_archive_aspect and GoAspectProvider.
      • It is now an error when a go_binary or go_test depends on another go_binary or go_test.
      • --feature flags are no longer used for configuration. Use flags like [email protected]_bazel_rules_go//go/config:pure instead.

    Compatibility

    • Go 1.13 is no longer supported.
    • Bazel 3.4.0 is now required.
    • This release is expected to be compatible with Bazel 4.0.0. Earlier rules_go releases may not work due to incompatible changes in the C/C++ APIs.

    Updated dependencies

    As always you can use higher versions of rules_go's dependencies by declaring them in WORKSPACE before calling go_rules_dependencies. Lower versions may work but are not supported.

    • platforms is updated to 0.0.1.
    • rules_cc is updated to master as of 2020-12-01.
    • bazel_skylib is updated to 1.0.3.
    • org_golang_x_tools is updated to master as of 2020-12-01.
    • com_github_golang_protobuf is updated to v1.4.3.
    • org_golang_google_genproto is updated to master as of 2020-12-01.
    • go_googleapis is updated to master as of 2020-12-01.

    WORKSPACE code

    NOTE: The code below has changed. In go_register_toolchains, version must be set to a string like "1.15.5" or to "host" unless a Go toolchain is declared earlier.

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "6f111c57fd50baf5b8ee9d63024874dd2a014b069426156c55adbf6d3d22cb7b",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.25.0/rules_go-v0.25.0.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.25.0/rules_go-v0.25.0.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains(version = "1.15.5")
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.25.0.tar.gz(551.47 KB)
  • v0.24.8(Dec 2, 2020)

    Bug fixes

    • go_test no longer requires TestMain to call os.Exit (thanks @rabbbit)
    • @io_bazel_rules_go//proto/wkt:field_mask_go_proto, source_context_go_proto, and type_go_proto are now wrappers around the pre-generated sources in google.golang.org/protobuf. This should eliminate linker conflicts.
    • go_proto_library now declares implicit dependencies on both APIv1 and APIv2 packages. This may increase build time (both sets of packages will be compiled) but is needed for compatibility with protobuf 3.14.0. go_proto_library needs both sets of packages, since we don't know which version of protobuf is used at analysis time.
    • go_binary and go_test now force internal linking in pure mode, since a C/C++ toolchain is not available. This should produce better error messages on platforms that don't support internal linking.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "75c97f089190833ee58872238c98394267d35c32baabf42aac0827102b62af6b",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.8/rules_go-v0.24.8.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.8/rules_go-v0.24.8.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.8.tar.gz(506.55 KB)
  • v0.24.7(Nov 12, 2020)

    New Go versions

    Go 1.15.5 and 1.14.12 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "207fad3e6689135c5d8713e5a17ba9d1290238f47b9ba545b63d9303406209c6",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.7/rules_go-v0.24.7.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.7/rules_go-v0.24.7.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.7.tar.gz(505.66 KB)
  • v0.23.15(Nov 12, 2020)

    New Go versions

    Go 1.15.5 and 1.14.12 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "e3f4c9aef825c2ac023d0d78f74f7bc22b4b918a329b2d1b888b2978ff5ac154",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.15/rules_go-v0.23.15.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.23.15/rules_go-v0.23.15.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.23.15.tar.gz(476.88 KB)
  • v0.24.6(Nov 9, 2020)

    New Go versions

    Go 1.15.4 and 1.14.11 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "b4433651f57560237681cb9caa969106aba614f5b1e66fefa5834c42b8013b42",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.6/rules_go-v0.24.6.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.6/rules_go-v0.24.6.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.6.tar.gz(504.34 KB)
  • v0.23.14(Nov 9, 2020)

    New Go versions

    Go 1.15.4 and 1.14.11 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "e19e73c40511461a2f45ad45ccbfeff15184264a2169bbb10b5a7f4f0b578b90",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.14/rules_go-v0.23.14.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.23.14/rules_go-v0.23.14.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.23.14.tar.gz(475.79 KB)
  • v0.24.5(Oct 26, 2020)

    Bug fixes

    • Fixed an issue with include paths in cgo libraries in external repositories that was exposed in Bazel 3.7.0.
    • Subcommand errors are now less verbose.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "d1ffd055969c8f8d431e2d439813e42326961d0942bdf734d2c95dc30c369566",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.5/rules_go-v0.24.5.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.5/rules_go-v0.24.5.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.5.tar.gz(503.07 KB)
  • v0.23.13(Oct 26, 2020)

    Bug fixes

    • Fixed an issue with include paths in cgo libraries in external repositories that was exposed in Bazel 3.7.0.
    • Subcommand errors are now less verbose.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "efc724310fa2568db33ce3cc9b8fdbe1d0b554435d41e64b7f96d68933a5ca15",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.13/rules_go-v0.23.13.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.23.13/rules_go-v0.23.13.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.23.13.tar.gz(474.72 KB)
  • v0.24.4(Oct 15, 2020)

    New Go versions

    Go 1.15.3 and 1.14.10 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "ac03931e56c3b229c145f1a8b2a2ad3e8d8f1af57e43ef28a26123362a1e3c7e",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.4/rules_go-v0.24.4.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.4/rules_go-v0.24.4.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.4.tar.gz(502.97 KB)
  • v0.23.12(Oct 15, 2020)

    New Go versions

    Go 1.15.3 and 1.14.10 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "df76f2a947aef03979ea0b6b9551d55ecc1821e4097f86a8422fdeac80b9ecd4",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.12/rules_go-v0.23.12.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.23.12/rules_go-v0.23.12.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.23.12.tar.gz(474.66 KB)
  • v0.24.3(Sep 22, 2020)

    Bug fixes

    • The GoPath action uses absolute paths to mitigate path length limits on Windows (thanks @Xjs).
    • The file lib/time/zoneinfo.zip is now exported from downloaded Go distributions (thanks @andrewtar).
    • Multiline package conflict error messages are correctly passed to the builder when Bazel param files are used.
    • Compiler errors are redirected from stdout to stderr.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "b725e6497741d7fc2d55fcc29a276627d10e43fa5d0bb692692890ae30d98d00",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.3/rules_go-v0.24.3.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.3/rules_go-v0.24.3.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.3.tar.gz(501.99 KB)
  • v0.23.11(Sep 22, 2020)

    Bug fixes

    • coverdata is now imported correctly in files with import comments (thanks @linzhp).
    • cdeps are correctly passed to the linker when a split test's packages are recompiled.
    • The GoPath action uses absolute paths to mitigate path length limits on Windows (thanks @Xjs).
    • The file lib/time/zoneinfo.zip is now exported from downloaded Go distributions (thanks @andrewtar).
    • Multiline package conflict error messages are correctly passed to the builder when Bazel param files are used.
    • Compiler errors are redirected from stdout to stderr.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "bca583b49e4705ffa51d793ee4e2403e1eaab4d31222af8d950ef7cfe731ea33",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.11/rules_go-v0.23.11.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.23.11/rules_go-v0.23.11.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.23.11.tar.gz(473.68 KB)
  • v0.24.2(Sep 9, 2020)

    New Go versions

    Go 1.15.2 and 1.14.9 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "08c3cd71857d58af3cda759112437d9e63339ac9c6e0042add43f4d94caf632d",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.2/rules_go-v0.24.2.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.2/rules_go-v0.24.2.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.2.tar.gz(501.50 KB)
  • v0.23.10(Sep 9, 2020)

    New Go versions

    Go 1.15.2 and 1.14.9 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "d9a9d51999acc7d60a5b58e20b391b907b3eaa9c670c1faa07c5e4a93bd8da36",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.23.10/rules_go-v0.23.10.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.23.10/rules_go-v0.23.10.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.23.10.tar.gz(470.27 KB)
  • v0.24.1(Sep 1, 2020)

    New Go versions

    Go 1.15.1 and 1.14.8 are now supported.

    WORKSPACE code

    load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
    
    http_archive(
        name = "io_bazel_rules_go",
        sha256 = "7f1aa43d986df189f7cf30e81dd2dc9d8ed7c74e356341a17267f6d7e5748382",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.1/rules_go-v0.24.1.tar.gz",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.24.1/rules_go-v0.24.1.tar.gz",
        ],
    )
    
    load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains")
    
    go_rules_dependencies()
    
    go_register_toolchains()
    
    Source code(tar.gz)
    Source code(zip)
    rules_go-v0.24.1.tar.gz(500.60 KB)
Owner
Bazel
Bazel organization
Bazel
Generate types and service clients from protobuf definitions annotated with http rules.

protoc-gen-typescript-http Generates Typescript types and service clients from protobuf definitions annotated with http rules. The generated types fol

Einride 17 Apr 16, 2022
The rest api that can manage the iptables rules of the remote host

fiewall-api firewall api是基于firewalld来远程管理iptables规则的rest-api,无需部署agent Features 指定一个主机ip,让这个主机上的iptables增加一个规则 处理单个IP或CIDR范围(xx.xx.xx.xx/mask,mac,inte

seal 0 Mar 24, 2022
Read k8S-source-code notes, help quickly understand the K8S-code organization rules

K8S源码阅读笔记 以下笔记针对 kubernetes V1.23.1(截至2022年01月01日最新版本),并不保证对其它版本的有效性 一、架构图 二、阅读前准备 由于kubernetes项目巧妙的设计和代码高度的封装性,建议在阅读代码前,尽可能的进行以下内容的准备: 1. 编程知识配备 编程语准

kubernetes-based edge-cloud solution 0 Feb 16, 2022
KeeneticRouteToVpn is simple app updating Keenetic Router rules for some hosts to go through VPN interface.

KeeneticRouteToVpn KeeneticRouteToVpn is simple app updating Keenetic Router rules for some hosts to go through VPN interface. It has defaults values

Vasilii Blazhnov 6 May 5, 2022
Squzy - is a high-performance open-source monitoring, incident and alert system written in Golang with Bazel and love.

Squzy - opensource monitoring, incident and alerting system About Squzy - is a high-performance open-source monitoring and alerting system written in

Squzy 454 May 24, 2022
Baize - A minimum implement of bazel remote execution

BAIZE Baize, mythical creatures in ancient Chinese mythology, who can speak with

DashJay 3 Jun 30, 2022
A Golang library to manipulate strings according to the word parsing rules of the UNIX Bourne shell.

shellwords A Golang library to manipulate strings according to the word parsing rules of the UNIX Bourne shell. Installation go get github.com/Wing924

Wei He 17 Mar 15, 2022
A natural language date/time parser with pluggable rules

when when is a natural language date/time parser with pluggable rules and merge strategies Examples tonight at 11:10 pm at Friday afternoon the deadli

Oleg Lebedev 1.2k Jun 27, 2022
A rest application to update firewalld rules on a linux server

Firewalld-rest A REST application to dynamically update firewalld rules on a linux server. Firewalld is a firewall management tool for Linux operating

Prashant Gupta 316 May 3, 2022
⚙️ Convert HTML to Markdown. Even works with entire websites and can be extended through rules.

html-to-markdown Convert HTML into Markdown with Go. It is using an HTML Parser to avoid the use of regexp as much as possible. That should prevent so

Johannes Kaufmann 366 Jun 24, 2022
Validate Golang request data with simple rules. Highly inspired by Laravel's request validation.

Validate golang request data with simple rules. Highly inspired by Laravel's request validation. Installation Install the package using $ go get githu

Saddam H 1.1k Jun 26, 2022
An idiomatic Go (golang) validation package. Supports configurable and extensible validation rules (validators) using normal language constructs instead of error-prone struct tags.

ozzo-validation Description ozzo-validation is a Go package that provides configurable and extensible data validation capabilities. It has the followi

Ozzo Framework 2.8k Jul 1, 2022
Application for HTTP benchmarking via different rules and configs

Go Benchmark App The efficiency and speed of application - our goal and the basic idea. Application for HTTP-benchmarking via different rules and conf

Evgeny Ukhanov 22 Nov 7, 2021
Generate types and service clients from protobuf definitions annotated with http rules.

protoc-gen-typescript-http Generates Typescript types and service clients from protobuf definitions annotated with http rules. The generated types fol

Einride 17 Apr 16, 2022
A natural language date/time parser with pluggable rules

when when is a natural language date/time parser with pluggable rules and merge strategies Examples tonight at 11:10 pm at Friday afternoon the deadli

Oleg Lebedev 1.2k Jun 16, 2022
Generate Prometheus rules for your SLOs

prometheus-slo Generates Prometheus rules for alerting on SLOs. Based on https://developers.soundcloud.com/blog/alerting-on-slos. Usage Build and Run

Ganesh Vernekar 17 Oct 20, 2021
A parser generator where rules defined as go structs and code generation is optional

A parser generator where rules defined as go structs and code generation is optional. The concepts are introduced in the simple example below.

Arnaud Delobelle 5 May 31, 2022
go-linters How to grow Go code as a bonsai: the style, the rules, the linters

How to grow Go code as a bonsai: the style, the rules, the linters (Definition 2021 Hackaton) Build go build -buildmode=plugin plugin/plugin.go Run go

Mercuryo.io 3 Dec 15, 2021
An easy to use relay for cftools webhook events piped to Discord when filter rules match.

CFTools Relay CFTools Relay is an easy-to-use, still in development, tool that allows you to subscribe to CFTools Cloud Webhook events and forward the

Florian 1 Dec 15, 2021
mesh-kridik is an open-source security scanner that performs various security checks on a Kubernetes cluster with istio service mesh and is leveraged by OPA (Open Policy Agent) to enforce security rules.

mesh-kridik Enhance your Kubernetes service mesh security !! mesh-kridik is an open-source security scanner that performs various security checks on a

chenk 22 May 18, 2022
The rest api that can manage the iptables rules of the remote host

fiewall-api firewall api是基于firewalld来远程管理iptables规则的rest-api,无需部署agent Features 指定一个主机ip,让这个主机上的iptables增加一个规则 处理单个IP或CIDR范围(xx.xx.xx.xx/mask,mac,inte

seal 0 Mar 24, 2022
Apisix plug-in to manage the content of custom rules.

Go Plugin The documentation can be found in this website, which is generated from the files under docs/. Introduction Apisix plug-in to manage the con

GoPlatform 1 Apr 13, 2022
Go library for generate serial numbers according to rules.

go-sn - Serial Number Generator Go library for generate serial numbers according to rules. This library is also useful for generating serial numbers i

Kenkyu 5 May 25, 2022
This plugin will analyse the JFrog Platform instance and provide the non conformance against the best practices based on the predefines rules.

hello-frog About this plugin This plugin is a template and a functioning example for a basic JFrog CLI plugin. This README shows the expected structur

null 0 Nov 30, 2021
Quick and easy way to load config files based on a simple set of rules.

config Quick and easy way to load config files based on a simple set of rules. Project inspired by https://github.com/lorenwest/node-config Important

Tarcisio Gruppi 1 Apr 9, 2021
Read k8S-source-code notes, help quickly understand the K8S-code organization rules

K8S源码阅读笔记 以下笔记针对 kubernetes V1.23.1(截至2022年01月01日最新版本),并不保证对其它版本的有效性 一、架构图 二、阅读前准备 由于kubernetes项目巧妙的设计和代码高度的封装性,建议在阅读代码前,尽可能的进行以下内容的准备: 1. 编程知识配备 编程语准

kubernetes-based edge-cloud solution 0 Feb 16, 2022
Tpu-traffic-classifier - This small program creates ipsets and iptables rules for nodes in the Solana network

TPU traffic classifier This small program creates ipsets and iptables rules for

Triton One 7 May 16, 2022
Quick and simple parser for PFSense XML configuration files, good for auditing firewall rules

pfcfg-parser version 0.0.1 : 13 January 2022 A quick and simple parser for PFSense XML configuration files to generate a plain text file of the main c

Rory Campbell-Lange 0 Jan 13, 2022