-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MODULE.bazel to rules_jsonnet (#179)
* Make fewer assumptions about Bazel's pathname structure When using bzlmod, there is no guarantee that the underlying name of the external is "examples". This may currently cause these tests to fail due to non-matching regular expressions. * Give rules_jsonnet a MODULE.bazel * Document how rules_jsonnet may be used with bzlmod * Stop referencing WORKSPACE file in tests * Let the examples repository use MODULE.bazel Instead of using local_repository() inside of the root WORKSPACE, give examples/ its own MODULE.bazel that uses local_repository() to access the copy of rules_jsonnet at the repository's root. This allows us to move the bazelrc and workspace_status command we have at the root directory into the examples/ directory as well. * Update CI to match reality It looks like it's not easy to make the WORKSPACE based build work properly, as jsonnet_go depends on copies of Gazelle and rules_go that are far too old. At least make sure that the MODULE.bazel based builds are tested.
- Loading branch information
1 parent
2ff602d
commit 8f4598f
Showing
18 changed files
with
61 additions
and
59 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 |
---|---|---|
@@ -1,16 +1,22 @@ | ||
--- | ||
platforms: | ||
ubuntu1804: | ||
matrix: | ||
platform: | ||
- ubuntu2204 | ||
- macos | ||
|
||
tasks: | ||
rules_jsonnet: | ||
name: rules_jsonnet | ||
platform: ${{ platform }} | ||
build_targets: | ||
- "//..." | ||
- "@examples//..." | ||
- //... | ||
|
||
examples: | ||
name: examples | ||
platform: ${{ platform }} | ||
working_directory: examples | ||
test_flags: | ||
- --define | ||
- jsonnet_port=${{ jsonnet_port }} | ||
test_targets: | ||
- "//..." | ||
- "@examples//..." | ||
macos: | ||
build_targets: | ||
- "//..." | ||
- "@examples//..." | ||
test_targets: | ||
- "//..." | ||
- "@examples//..." | ||
- //... |
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 @@ | ||
examples |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
/bazel-* | ||
bazel-* | ||
# These files are not determinstic/stable, so don't check them in for now. | ||
MODULE.bazel.lock |
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,8 @@ | ||
module( | ||
name = "rules_jsonnet", | ||
version = "0.5.0", | ||
repo_name = "io_bazel_rules_jsonnet", | ||
) | ||
|
||
bazel_dep(name = "jsonnet", version = "0.20.0") | ||
bazel_dep(name = "jsonnet_go", version = "0.20.0", repo_name = "google_jsonnet_go") |
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
File renamed without changes.
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,10 @@ | ||
module( | ||
name = "examples", | ||
version = "0.0.0", | ||
) | ||
|
||
bazel_dep(name = "rules_jsonnet", version = "0.5.0") | ||
local_path_override( | ||
module_name = "rules_jsonnet", | ||
path = "..", | ||
) |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
local test = std.extVar('1-test'); | ||
local workspace = std.extVar('0-workspace'); | ||
local codefile = std.extVar('codefile'); | ||
local codefile2 = std.extVar('codefile2'); | ||
{ | ||
file1: test, | ||
file2: codefile.weather, | ||
file3: codefile2.weather, | ||
file4: workspace, | ||
} |
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
{ | ||
"file1": "this is great\n", | ||
"file2": "Finally spring!", | ||
"file3": "Finally summer!", | ||
"file4": "workspace(name = \"examples\")\n" | ||
"file3": "Finally summer!" | ||
} |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
^RUNTIME ERROR: Foo\. | ||
../examples/invalid\.jsonnet:15:1-13 ($|\$ | ||
.*invalid\.jsonnet:15:1-13 ($|\$ | ||
During evaluation ) |
File renamed without changes.