-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid using
local_path_override
in extension rules
- Loading branch information
1 parent
c9f561f
commit 7942272
Showing
25 changed files
with
134 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
filegroup( | ||
name = "extension_presubmits", | ||
srcs = glob([ | ||
"extensions/**/presubmit.yml", | ||
]), | ||
visibility = ["//test/bzl_version:__pkg__"], | ||
) |
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 |
---|---|---|
|
@@ -25,3 +25,4 @@ rust-project.json | |
|
||
# BazelCI | ||
bazelci.py | ||
.bcr/core |
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,5 @@ | ||
# A Bazel configuration flag used to locate the core rules when developing | ||
# within the `rules_rust` repository. This file should not be used by | ||
# external consumers | ||
|
||
common --override_module=rules_rust=../../ |
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 |
---|---|---|
|
@@ -25,3 +25,4 @@ rust-project.json | |
|
||
# BazelCI | ||
bazelci.py | ||
.bcr/core |
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,5 @@ | ||
# A Bazel configuration flag used to locate the core rules when developing | ||
# within the `rules_rust` repository. This file should not be used by | ||
# external consumers | ||
|
||
common --override_module=rules_rust=../../ |
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 |
---|---|---|
|
@@ -25,3 +25,4 @@ rust-project.json | |
|
||
# BazelCI | ||
bazelci.py | ||
.bcr/core |
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,5 @@ | ||
# A Bazel configuration flag used to locate the core rules when developing | ||
# within the `rules_rust` repository. This file should not be used by | ||
# external consumers | ||
|
||
common --override_module=rules_rust=../../ |
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 |
---|---|---|
|
@@ -25,3 +25,4 @@ rust-project.json | |
|
||
# BazelCI | ||
bazelci.py | ||
.bcr/core |
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,5 @@ | ||
# A Bazel configuration flag used to locate the core rules when developing | ||
# within the `rules_rust` repository. This file should not be used by | ||
# external consumers | ||
|
||
common --override_module=rules_rust=../../ |
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,32 @@ | ||
//! Tests to verify bazel-central-registry CI is configured for the current | ||
//! version of rules_rust. | ||
use runfiles::Runfiles; | ||
|
||
/// If this test fails, it means the vendoring of the core rules is not in | ||
/// sync with the current version of rules_rust and the urls need to be updated. | ||
#[test] | ||
fn vendered_core_rules_version_in_sync() { | ||
let r = Runfiles::create().unwrap(); | ||
let rlocationpaths = env!("PRESUBMIT_RLOCATIONPATHS") | ||
.split(" ") | ||
.collect::<Vec<_>>(); | ||
|
||
let core_cmd_unix = format!("\"mkdir -p .bcr/core && curl -L https://github.com/bazelbuild/rules_rust/releases/download/{0}/rules_rust-{0}.tar.gz | tar -xz -C .bcr/core && echo 'common --override_module=rules_rust=.bcr/core' > user.bazelrc\"", env!("RULES_RUST_VERSION")); | ||
let core_cmd_windows = format!("\"(if not exist .bcr\\\\core mkdir .bcr\\\\core) && curl -L https://github.com/bazelbuild/rules_rust/releases/download/{0}/rules_rust-{0}.tar.gz | tar -xz -C .bcr\\\\core && echo common --override_module=rules_rust=.bcr/core > user.bazelrc\"", env!("RULES_RUST_VERSION")); | ||
|
||
let cmds = [core_cmd_unix, core_cmd_windows]; | ||
|
||
for rlocationpath in rlocationpaths { | ||
let path = runfiles::rlocation!(r, rlocationpath).unwrap(); | ||
let content = std::fs::read_to_string(path).unwrap(); | ||
for cmd in &cmds { | ||
assert!( | ||
content.contains(cmd), | ||
"{} did not contain the expected vendor command:\n{}", | ||
rlocationpath, | ||
cmd | ||
); | ||
} | ||
} | ||
} |