forked from bazelbuild/bazel-central-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
[email protected]
(bazelbuild#1513)
Brings two rules: - `diff_file_test` - `diff_directory_test` Uses `diff` from `ape` so is hermetic and consistent across operating systems, even Windows. Negates the non-hermetic-ness of `bazel_skylib#diff_test` that uses `diff` from the system. A new module for `diff` related rules makes sense, in the future we may want to enable a three file comparison rule with `diff3`, byte-by-byte comparison with `cmp` or other possible differencing rules. This module also exposes the hermetic toolchains for use in other modules: - `@rules_diff//diff/toolchain/diff:type` - `@rules_diff//diff/toolchain/diff3:type` - `@rules_diff//diff/toolchain/sdiff:type` - `@rules_diff//diff/toolchain/cmp:type` At this time, we're in alpha as the rules need to be fleshed out and tested in more situations. For example, we are not fully testing with all possible combinations of runfiles.
- Loading branch information
1 parent
20a5df7
commit fa84fff
Showing
4 changed files
with
74 additions
and
0 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,33 @@ | ||
module( | ||
name = "rules_diff", | ||
version = "1.0.0-alpha.3", | ||
bazel_compatibility = [ | ||
">=7.0.0", | ||
], | ||
compatibility_level = 1, | ||
) | ||
|
||
bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.1") | ||
bazel_dep(name = "ape", version = "1.0.0-alpha.3") | ||
|
||
export = use_extension("@toolchain_utils//toolchain/export:defs.bzl", "toolchain_export") | ||
|
||
resolved = use_repo_rule("@toolchain_utils//toolchain/resolved:defs.bzl", "toolchain_resolved") | ||
|
||
[ | ||
( | ||
use_repo(export, "ape-{}".format(tool)), | ||
export.symlink( | ||
name = tool, | ||
target = "@ape-{}".format(tool), | ||
), | ||
use_repo(export, tool), | ||
resolved( | ||
name = "resolved-{}".format(tool), | ||
toolchain_type = "//diff/toolchain/{}:type".format(tool), | ||
), | ||
) | ||
for tool in ("diff", "diff3", "sdiff", "cmp") | ||
] | ||
|
||
register_toolchains("//diff/toolchain/...") |
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,20 @@ | ||
bcr_test_module: | ||
module_path: e2e | ||
matrix: | ||
bazel: | ||
- 7.x | ||
platform: | ||
- debian10 | ||
- ubuntu2004 | ||
- macos | ||
# TODO: we need `ape` to support `macos_arm64` | ||
# - macos_arm64 | ||
# TODO: enable this once the `gitlab.arm.com` certificate is validated on BuildKite runner | ||
# - windows | ||
tasks: | ||
run_tests: | ||
name: Run end-to-end Tests | ||
bazel: ${{ bazel }} | ||
platform: ${{ platform }} | ||
test_targets: | ||
- "//..." |
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 @@ | ||
{ | ||
"url": "https://gitlab.arm.com/bazel/rules_diff/-/releases/v1.0.0-alpha.3/downloads/src.tar.gz", | ||
"integrity": "sha512-g8eVWXWcRpkiWjxs54Zua9tjdX/mTZV2yWslBrFqftvHDaCLxJQ1uXb4fRqC3pM1XKFouelMkviYZSMJaVAT8w==", | ||
"strip_prefix": "rules_diff-v1.0.0-alpha.3" | ||
} |
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,16 @@ | ||
{ | ||
"homepage": "https://gitlab.arm.com/bazel/rules_diff", | ||
"repository": [ | ||
"https://gitlab.arm.com/bazel/rules_diff" | ||
], | ||
"versions":[ | ||
"1.0.0-alpha.3" | ||
], | ||
"maintainers": [ | ||
{ | ||
"email": "[email protected]", | ||
"github": "mattyclarkson", | ||
"name": "Matt Clarkson" | ||
} | ||
] | ||
} |