-
Notifications
You must be signed in to change notification settings - Fork 523
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
node_urls
parameter to bzlmod toolchain
in the node
e…
…xtension (#3763) --------- Co-authored-by: Paolo Tranquilli <[email protected]>
- Loading branch information
Showing
19 changed files
with
197 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../.bazelversion |
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 @@ | ||
error.txt |
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,13 @@ | ||
# this is set up to make bazel test //... pass | ||
load("@bazel_skylib//rules:write_file.bzl", "write_file") | ||
|
||
write_file( | ||
name = "empty", | ||
out = "empty.sh", | ||
content = [], | ||
) | ||
|
||
sh_test( | ||
name = "dummy", | ||
srcs = [":empty"], | ||
) |
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,2 @@ | ||
# this is set up to make bazel test //... pass | ||
bazel_dep(name = "bazel_skylib", version = "1.7.1", dev_dependency = True) |
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,22 @@ | ||
#!/bin/bash | ||
# this is the integration test checking various combinations of conflicting nodejs toolchain definitions | ||
|
||
set -eu | ||
|
||
for test_attr in test_*; do | ||
pushd $test_attr > /dev/null | ||
attr=${test_attr#test_} | ||
echo -n "testing conflict on $attr... " | ||
if bazel mod tidy &> error.txt; then | ||
echo "ERROR: bazel mod tidy should have failed with following MODULE.bazel:" | ||
cat MODULE.bazel | ||
exit 1 | ||
elif ! grep "conflicting toolchains" error.txt > /dev/null; then | ||
echo "ERROR: expected bazel mod tidy to mention conflicting toolchains, found:" | ||
cat error.txt | ||
exit 1 | ||
else | ||
echo "PASS" | ||
fi | ||
popd > /dev/null | ||
done |
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 @@ | ||
../.bazelversion |
14 changes: 14 additions & 0 deletions
14
e2e/conflicting_toolchains/test_include_headers/MODULE.bazel
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,14 @@ | ||
bazel_dep(name = "rules_nodejs", version = "0.0.0", dev_dependency = True) | ||
local_path_override( | ||
module_name = "rules_nodejs", | ||
path = "../../..", | ||
) | ||
|
||
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True) | ||
node.toolchain( | ||
name = "mynode", | ||
) | ||
node.toolchain( | ||
name = "mynode", | ||
node_urls = ["file://whatever"], | ||
) |
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 @@ | ||
../.bazelversion |
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,14 @@ | ||
bazel_dep(name = "rules_nodejs", version = "0.0.0", dev_dependency = True) | ||
local_path_override( | ||
module_name = "rules_nodejs", | ||
path = "../../..", | ||
) | ||
|
||
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True) | ||
node.toolchain( | ||
name = "mynode", | ||
) | ||
node.toolchain( | ||
name = "mynode", | ||
include_headers = True, | ||
) |
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 @@ | ||
../.bazelversion |
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,14 @@ | ||
bazel_dep(name = "rules_nodejs", version = "0.0.0", dev_dependency = True) | ||
local_path_override( | ||
module_name = "rules_nodejs", | ||
path = "../../..", | ||
) | ||
|
||
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True) | ||
node.toolchain( | ||
name = "mynode", | ||
) | ||
node.toolchain( | ||
name = "mynode", | ||
node_version = "15.14.0", | ||
) |
1 change: 1 addition & 0 deletions
1
e2e/conflicting_toolchains/test_node_version_from_nvmrc/.bazelversion
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 @@ | ||
../.bazelversion |
Empty file.
Empty file.
14 changes: 14 additions & 0 deletions
14
e2e/conflicting_toolchains/test_node_version_from_nvmrc/MODULE.bazel
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,14 @@ | ||
bazel_dep(name = "rules_nodejs", version = "0.0.0", dev_dependency = True) | ||
local_path_override( | ||
module_name = "rules_nodejs", | ||
path = "../../..", | ||
) | ||
|
||
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True) | ||
node.toolchain( | ||
name = "mynode", | ||
) | ||
node.toolchain( | ||
name = "mynode", | ||
node_version_from_nvmrc = "//:.nvmrc", | ||
) |
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