Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bazel-contrib/rules_go
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.22.3
Choose a base ref
...
head repository: bazel-contrib/rules_go
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.22.4
Choose a head ref
  • 6 commits
  • 12 files changed
  • 1 contributor

Commits on Apr 14, 2020

  1. Set RULES_GO_VERSION to 0.21.4

    Jay Conrod committed Apr 14, 2020
    Copy the full SHA
    7443688 View commit details
  2. Copy the full SHA
    1c4aa36 View commit details
  3. nogo: disable cgocall (#2399)

    Updates #2396
    Jay Conrod committed Apr 14, 2020
    Copy the full SHA
    e26e939 View commit details
  4. Update bazel_toolchains for bazel 2.2.0 (#2408)

    Jay Conrod committed Apr 14, 2020
    Copy the full SHA
    a900c12 View commit details
  5. go_embed_data: don't include srcs in GoLibrary or GoSource (#2413)

    None of the attributes passed to go_embed_data rules are relevant for
    other rules embedding them. Include the output file as a generated
    source file, but don't pass other attributes.
    
    Fixes #2411
    Jay Conrod committed Apr 14, 2020
    Copy the full SHA
    9f4a92f View commit details
  6. Copy the full SHA
    9036cf6 View commit details
46 changes: 23 additions & 23 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
@@ -159,6 +159,17 @@ platforms:
- "-//tests/core/coverage:coverage_test"
- "-//tests/core/cross:cross_test"
- "-//tests/core/go_binary:go_default_test"
- "-//tests/core/go_embed_data:go_default_test"
- "-//tests/core/go_embed_data:go_default_library"
- "-//tests/core/go_embed_data:unpack"
- "-//tests/core/go_embed_data:str"
- "-//tests/core/go_embed_data:single"
- "-//tests/core/go_embed_data:local"
- "-//tests/core/go_embed_data:flat"
- "-//tests/core/go_embed_data:ext"
- "-//tests/core/go_embed_data:empty"
- "-//tests/core/go_embed_data:embedded_zip"
- "-//tests/core/go_embed_data:embedded_tar"
- "-//tests/core/go_path:go_path"
- "-//tests/core/go_path:go_path_test"
- "-//tests/core/go_path:nodata_path"
@@ -226,17 +237,6 @@ platforms:
- "-//tests/legacy/examples/proto:proto_pure_test"
- "-//tests/legacy/examples/proto:proto_test"
- "-//tests/legacy/extldflags_rpath:extldflags_rpath_test"
- "-//tests/legacy/go_embed_data:go_default_test"
- "-//tests/legacy/go_embed_data:go_default_library"
- "-//tests/legacy/go_embed_data:unpack"
- "-//tests/legacy/go_embed_data:str"
- "-//tests/legacy/go_embed_data:single"
- "-//tests/legacy/go_embed_data:local"
- "-//tests/legacy/go_embed_data:flat"
- "-//tests/legacy/go_embed_data:ext"
- "-//tests/legacy/go_embed_data:empty"
- "-//tests/legacy/go_embed_data:embedded_zip"
- "-//tests/legacy/go_embed_data:embedded_tar"
- "-//tests/legacy/info:info"
- "-//tests/legacy/proto_ignore_go_package_option:a_go_proto"
- "-//tests/legacy/proto_ignore_go_package_option:a_proto"
@@ -292,6 +292,18 @@ platforms:
- "-//tests/core/cross:cross_test"
- "-//tests/core/go_binary:go_default_test"
- "-//tests/core/go_binary:stamp_test"
- "-//tests/core/go_embed_data:go_default_test"
- "-//tests/core/go_embed_data:go_default_test"
- "-//tests/core/go_embed_data:go_default_library"
- "-//tests/core/go_embed_data:unpack"
- "-//tests/core/go_embed_data:str"
- "-//tests/core/go_embed_data:single"
- "-//tests/core/go_embed_data:local"
- "-//tests/core/go_embed_data:flat"
- "-//tests/core/go_embed_data:ext"
- "-//tests/core/go_embed_data:empty"
- "-//tests/core/go_embed_data:embedded_zip"
- "-//tests/core/go_embed_data:embedded_tar"
- "-//tests/core/go_path:go_path"
- "-//tests/core/go_path:go_path_test"
- "-//tests/core/go_path:link_path"
@@ -326,18 +338,6 @@ platforms:
- "-//tests/legacy/examples/proto:proto_pure_test"
- "-//tests/legacy/examples/proto:proto_test"
- "-//tests/legacy/extldflags_rpath:extldflags_rpath_test"
- "-//tests/legacy/go_embed_data:go_default_test"
- "-//tests/legacy/go_embed_data:go_default_test"
- "-//tests/legacy/go_embed_data:go_default_library"
- "-//tests/legacy/go_embed_data:unpack"
- "-//tests/legacy/go_embed_data:str"
- "-//tests/legacy/go_embed_data:single"
- "-//tests/legacy/go_embed_data:local"
- "-//tests/legacy/go_embed_data:flat"
- "-//tests/legacy/go_embed_data:ext"
- "-//tests/legacy/go_embed_data:empty"
- "-//tests/legacy/go_embed_data:embedded_zip"
- "-//tests/legacy/go_embed_data:embedded_tar"
- "-//tests/legacy/info:info"
- "-//tests/legacy/test_chdir:go_default_test"
- "-//tests/legacy/test_rundir:go_default_test"
3 changes: 2 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -32,7 +32,8 @@ nogo(
"@org_golang_x_tools//go/analysis/passes/bools:go_tool_library",
"@org_golang_x_tools//go/analysis/passes/buildssa:go_tool_library",
"@org_golang_x_tools//go/analysis/passes/buildtag:go_tool_library",
"@org_golang_x_tools//go/analysis/passes/cgocall:go_tool_library",
# TODO(#2396): pass raw cgo sources to cgocall and re-enable.
# "@org_golang_x_tools//go/analysis/passes/cgocall:go_tool_library",
"@org_golang_x_tools//go/analysis/passes/composite:go_tool_library",
"@org_golang_x_tools//go/analysis/passes/copylock:go_tool_library",
"@org_golang_x_tools//go/analysis/passes/ctrlflow:go_tool_library",
8 changes: 4 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -66,11 +66,11 @@ llvm_toolchain(

http_archive(
name = "bazel_toolchains",
sha256 = "4d348abfaddbcee0c077fc51bb1177065c3663191588ab3d958f027cbfe1818b",
strip_prefix = "bazel-toolchains-2.1.0",
sha256 = "1342f84d4324987f63307eb6a5aac2dff6d27967860a129f5cd40f8f9b6fd7dd",
strip_prefix = "bazel-toolchains-2.2.0",
urls = [
"https://github.com/bazelbuild/bazel-toolchains/releases/download/2.1.0/bazel-toolchains-2.1.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/2.1.0/bazel-toolchains-2.1.0.tar.gz",
"https://github.com/bazelbuild/bazel-toolchains/releases/download/2.2.0/bazel-toolchains-2.2.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/2.2.0/bazel-toolchains-2.2.0.tar.gz",
],
)

4 changes: 2 additions & 2 deletions extras/embed_data.bzl
Original file line number Diff line number Diff line change
@@ -66,8 +66,8 @@ def _go_embed_data_impl(ctx):
args.add("-multi")
args.add_all(srcs)

library = go.new_library(go, srcs = srcs)
source = go.library_to_source(go, ctx.attr, library, ctx.coverage_instrumented())
library = go.new_library(go, srcs = [out])
source = go.library_to_source(go, {}, library, ctx.coverage_instrumented())

ctx.actions.run(
outputs = [out],
2 changes: 1 addition & 1 deletion go/def.bzl
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ load(

# Current version or next version to be tagged. Gazelle and other tools may
# check this to determine compatibility.
RULES_GO_VERSION = "0.22.3"
RULES_GO_VERSION = "0.22.4"

declare_toolchains = _declare_toolchains
go_context = _go_context
2 changes: 1 addition & 1 deletion proto/core.rst
Original file line number Diff line number Diff line change
@@ -190,7 +190,7 @@ Attributes
| :param:`protos` | :type:`label` | |mandatory| |
+---------------------+----------------------+-------------------------------------------------+
| List of ``proto_library`` targets containing the .proto sources this rule should generate |
| code from. This argument should be used instead of ``proto`` argument. |
| code from. This argument should be used instead of ``proto`` argument. |
+---------------------+----------------------+-------------------------------------------------+
| :param:`deps` | :type:`label_list` | :value:`[]` |
+---------------------+----------------------+-------------------------------------------------+
1 change: 1 addition & 0 deletions tests/core/README.rst
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ Contents
* `.. _#2067: https://github.com/bazelbuild/rules_go/issues/2067 <cgo/README.rst>`_
* `Runfiles functionality <runfiles/README.rst>`_
* `go_download_sdk <go_download_sdk/README.rst>`_
* ```go_embed_data`` <go_embed_data/README.rst>`_
* `race instrumentation <race/README.rst>`_
* `stdlib functionality <stdlib/README.rst>`_
* `Basic go_binary functionality <go_binary/README.rst>`_
Original file line number Diff line number Diff line change
@@ -9,13 +9,14 @@ go_test(
"//:AUTHORS",
"@com_google_protobuf//:LICENSE",
],
deps = ["//go/tools/bazel:go_default_library"],
embed = [":go_default_library"],
deps = ["//go/tools/bazel:go_default_library"],
)

go_library(
name = "go_default_library",
srcs = [
":cgo",
":empty",
":ext",
":flat",
@@ -27,6 +28,13 @@ go_library(
importpath = "github.com/bazelbuild/rules_go/tests/go_embed_data",
)

go_embed_data(
name = "cgo",
srcs = ["error.c"],
package = "go_embed_data",
var = "cgo",
)

go_embed_data(
name = "empty",
package = "go_embed_data",
11 changes: 11 additions & 0 deletions tests/core/go_embed_data/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
go_embed_data
=============

.. _go_embed_data: /extras.rst#go-embed-data

Tests to ensure basic features of `go_embed_data`_ are working correctly.

embed_test
----------

Depends on multiple ``go_embed_data`` targets and verifies their contents.
Original file line number Diff line number Diff line change
@@ -30,6 +30,12 @@ func TestMain(m *testing.M) {
os.Exit(m.Run())
}

func TestCgo(t *testing.T) {
if len(cgo) == 0 {
t.Fatalf("cgo is empty")
}
}

func TestEmpty(t *testing.T) {
if len(empty) != 0 {
t.Fatalf("empty is not empty")
@@ -68,7 +74,7 @@ func TestString(t *testing.T) {

func TestUnpack(t *testing.T) {
for _, data := range unpack {
checkFile(t, "tests/legacy/go_embed_data/BUILD.bazel", data)
checkFile(t, "tests/core/go_embed_data/BUILD.bazel", data)
}
for _, key := range []string{
"from-zip/BUILD.bazel",
1 change: 1 addition & 0 deletions tests/core/go_embed_data/error.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#error do not compile
Loading