Skip to content

Commit e46cddf

Browse files
mattnworbalexeagle
andauthored
fix undocumented dependency on aspect_bazel_lib for WORKSPACE users (#138)
* fix undocumented dependency on aspect_bazel_lib for WORKSPACE users I noticed that the instructions in each release for using aspect-build/rules_lint with WORKSPACE don't include the dependency that it has on aspect-build/bazel-lib, and so if you follow the setup instructions literally you'll end up with errors when `bazel run`-ing your formatter target: ``` $ bazel run //tools:format ERROR: Skipping '//tools:format': error loading package 'tools': at /private/var/tmp/_bazel_mattbrown/d7cfcf96ac70d7089c913ecc8b613cd1/external/aspect_rules_lint/format/defs.bzl:33:6: at /private/var/tmp/_bazel_mattbrown/d7cfcf96ac70d7089c913ecc8b613cd1/external/aspect_rules_lint/format/private/formatter_binary.bzl:3:6: Unable to find package for @@aspect_bazel_lib//lib:paths.bzl: The repository '@@aspect_bazel_lib' could not be resolved: Repository '@@aspect_bazel_lib' is not defined. ``` I suppose ideally this library would export a deps.bzl file following the usual convention, so that setting up rules_lint in a project requires less to copy and paste; happy to change this PR to do that if desired. * Update release_prep.sh remove unused load symbol --------- Co-authored-by: Alex Eagle <[email protected]>
1 parent c58b3a1 commit e46cddf

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/release_prep.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,19 @@ http_archive(
3737
strip_prefix = "${PREFIX}",
3838
url = "https://github.com/aspect-build/rules_lint/releases/download/${TAG}/${ARCHIVE}",
3939
)
40+
41+
# aspect_rules_lint depends on aspect_bazel_lib. Either 1.x or 2.x works.
42+
http_archive(
43+
name = "aspect_bazel_lib",
44+
sha256 = "979667bb7276ee8fcf2c114c9be9932b9a3052a64a647e0dcaacfb9c0016f0a3",
45+
strip_prefix = "bazel-lib-2.4.1",
46+
url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.4.1/bazel-lib-v2.4.1.tar.gz",
47+
)
48+
load("@aspect_bazel_lib//lib:repositories.bzl", "aspect_bazel_lib_dependencies")
49+
50+
# aspect_bazel_lib depends on bazel_skylib
51+
aspect_bazel_lib_dependencies()
4052
EOF
4153

4254
awk 'f;/--SNIP--/{f=1}' example/WORKSPACE.bazel
43-
echo "\`\`\`"
55+
echo "\`\`\`"

0 commit comments

Comments
 (0)