Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.55.0 is broken without blzmod #5568

Closed
2 tasks done
marcelofabri opened this issue May 12, 2024 · 2 comments · Fixed by #5580
Closed
2 tasks done

0.55.0 is broken without blzmod #5568

marcelofabri opened this issue May 12, 2024 · 2 comments · Fixed by #5580

Comments

@marcelofabri
Copy link
Collaborator

New Issue Checklist

Describe the bug

We haven't migrated our project to blzmod yet, instead relying on WORKSPACE instructions defined in each release page (eg https://github.com/realm/SwiftLint/releases/tag/0.55.0).

When updating to 0.55.0, I'm getting an error:

ERROR: no such package '@@sourcekitten_com_github_apple_swift_argument_parser//': The repository '@@sourcekitten_com_github_apple_swift_argument_parser' could not be resolved: Repository '@@sourcekitten_com_github_apple_swift_argument_parser' is not defined
ERROR: /private/var/tmp/_bazel_marcelo.fabri/5b377781e64cb78dd85e0283d3c57ba1/external/SwiftLint/BUILD:140:14: no such package '@@sourcekitten_com_github_apple_swift_argument_parser//': The repository '@@sourcekitten_com_github_apple_swift_argument_parser' could not be resolved: Repository '@@sourcekitten_com_github_apple_swift_argument_parser' is not defined and referenced by '@@SwiftLint//:swiftlint.library'
ERROR: Analysis of target '@@SwiftLint//:universal_swiftlint' failed; build aborted: Analysis failed

I believe this was caused by #5563 + jpsim/SourceKitten#772 on the SourceKitten side.

I imagine the fix is that we should depend on sourcekitten_com_github_apple_swift_argument_parser explicitly in https://github.com/realm/SwiftLint/blob/main/bazel/repos.bzl

@SimplyDanny
Copy link
Collaborator

I imagine the fix is that we should depend on sourcekitten_com_github_apple_swift_argument_parser explicitly in https://github.com/realm/SwiftLint/blob/main/bazel/repos.bzl

Could you try if that helps?

@marcelofabri
Copy link
Collaborator Author

Had to apply this patch to make it work:

index 93a8cce26..db6d27dbe 100644
--- bazel/repos.bzl
+++ bazel/repos.bzl
@@ -17,6 +17,29 @@ def swiftlint_repos(bzlmod = False):
             url = "https://github.com/apple/swift-syntax/archive/refs/tags/510.0.2.tar.gz",
         )
 
+        http_archive(
+            name = "sourcekitten_com_github_apple_swift_argument_parser",
+            url = "https://github.com/apple/swift-argument-parser/archive/refs/tags/1.3.1.tar.gz",
+            sha256 = "4d964f874b251abc280ee28f0f187de3c13a6122a9561524f66a10768ca2d837",
+            build_file = "@com_github_jpsim_sourcekitten//bazel:SwiftArgumentParser.BUILD",
+            strip_prefix = "swift-argument-parser-1.3.1",
+        )
+
+        http_archive(
+            name = "sourcekitten_com_github_jpsim_yams",
+            url = "https://github.com/jpsim/Yams/releases/download/5.0.6/Yams-5.0.6.tar.gz",
+            sha256 = "a81c6b93f5d26bae1b619b7f8babbfe7c8abacf95b85916961d488888df886fb",
+            strip_prefix = "Yams-5.0.6",
+        )
+
+        http_archive(
+            name = "sourcekitten_com_github_drmohundro_SWXMLHash",
+            url = "https://github.com/drmohundro/SWXMLHash/archive/refs/tags/7.0.1.tar.gz",
+            build_file = "@com_github_jpsim_sourcekitten//bazel:SWXMLHash.BUILD",
+            sha256 = "bafa037a09aa296f180e5613206748db5053b79aa09258c78d093ae9f8102a18",
+            strip_prefix = "SWXMLHash-7.0.1",
+        )
+
     http_archive(
         name = "swiftlint_com_github_scottrhoyt_swifty_text_table",
         sha256 = "b77d403db9f33686caeb2a12986997fb02a0819e029e669c6b9554617c4fd6ae",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants