-
Notifications
You must be signed in to change notification settings - Fork 387
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update rules_go + other changes (#558)
* Updated to rules_go at master to get compatibility fixes, new features for minimal module compatibility, and go_bazel_test. * Rewrote //internal:repository_rules_test to //internal:go_repository_test. The old test was broken by incompatible changes in new versions of Bazel. The new test uses a new integration testing framework. We should be able to improve go_repository test coverage in the future. * Added //internal/language/test_filegroup, an extension that generates all_files filegroup targets in each package. This is needed for go_bazel_test, since it explicitly depends files in repositories under test. * Generated filegroups with the new extension.
- Loading branch information
Jay Conrod
authored
Jun 23, 2019
1 parent
221457a
commit 9baa0ab
Showing
38 changed files
with
611 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
filegroup( | ||
name = "all_files", | ||
testonly = True, | ||
srcs = [ | ||
"//cmd/autogazelle:all_files", | ||
"//cmd/fetch_repo:all_files", | ||
"//cmd/gazelle:all_files", | ||
"//cmd/move_labels:all_files", | ||
], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* Copyright 2019 The Bazel Authors. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package go_repository_test | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/bazelbuild/rules_go/go/tools/bazel_testing" | ||
) | ||
|
||
const mainWorkspace = ` | ||
-- WORKSPACE -- | ||
local_repository( | ||
name = "io_bazel_rules_go", | ||
path = "../io_bazel_rules_go", | ||
) | ||
load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains") | ||
go_rules_dependencies() | ||
go_register_toolchains(go_version = "host") | ||
local_repository( | ||
name = "bazel_gazelle", | ||
path = "../bazel_gazelle", | ||
) | ||
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") | ||
gazelle_dependencies() | ||
go_repository( | ||
name = "errors_go_git", | ||
importpath = "github.com/pkg/errors", | ||
commit = "30136e27e2ac8d167177e8a583aa4c3fea5be833", | ||
patches = ["@bazel_gazelle//internal:repository_rules_test_errors.patch"], | ||
patch_args = ["-p1"], | ||
) | ||
go_repository( | ||
name = "errors_go_mod", | ||
importpath = "github.com/pkg/errors", | ||
version = "v0.8.1", | ||
sum ="h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=", | ||
) | ||
-- BUILD.bazel -- | ||
` | ||
|
||
func TestMain(m *testing.M) { | ||
bazel_testing.TestMain(m, bazel_testing.Args{Main: mainWorkspace}) | ||
} | ||
|
||
func TestBuild(t *testing.T) { | ||
if err := bazel_testing.RunBazel("build", "@errors_go_git//:errors", "@errors_go_mod//:go_default_library"); err != nil { | ||
t.Fatal(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
filegroup( | ||
name = "all_files", | ||
testonly = True, | ||
srcs = ["//internal/language/test_filegroup:all_files"], | ||
visibility = ["//visibility:public"], | ||
) |
Oops, something went wrong.