-
Notifications
You must be signed in to change notification settings - Fork 38
Road to 1.0.0 #924
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
Comments
Notes regarding Gazelle plugin
See below for new plan. |
What do we need |
The Gazelle plugin needs to resolve module names to Bazel labels. |
Ahh, so that won't be in this repo in the end? Got it. |
For anyone following along at home, this branch has the examples working if you run
|
Can we add #1079 to this? |
Done. |
…er big updates (#957) Lots of big changes in this PR: - The SPM-related rules no longer depend upon a Swift deps index JSON file. - Remove the `from_file` module extension tag class, as the ruleset no longer needs to read the Swift deps index file. - Remove the `swift_update_packages` macro as it is no longer required. - Remove support for `byName` references outside of a Swift package. This was supported in early SPM versions. It was one of the driving factors for having to pre-process the Swift dependencies and generate a Swift deps index file. Removing this support reduces the complexity of the `rules_swift_package_manager` implementation. - Remove `update_repos` command from the Gazelle plugin. - Add `swift_deps_info` repository rule to generate a Swift deps index JSON file as part of the build, not in the Gazelle plugin. This index file is used by the Gazelle plugin to resolve Swift module names to their respective Bazel target. - Introduce `from_package` module extension tag class telling the ruleset where the `Package.swift` and `Package.resolved` files for the workspace live. These are used to identify the Swift package transitive dependencies for the project. - Remove the `http_archive_ext_deps` example. The example existed to demonstrate and test indexing of Swift targets that were downloaded using `http_archive`. The Gazelle internals no longer provide some of the information needed for this to work properly with bzlmod enabled. Given that SPM has been widely adopted and there are some workarounds, we are removing support for this functionality in the Gazelle plugin when bzlmod is enabled. - Add output to the example test runner that demarcates different phases for the testing. Related to #924.
Just a quick update regarding the v1 release. I have been working on #1079. I have a draft PR (#1217) with everything working except the I put together #1266 which attempts to prevent
Looking through the actual command-line, I do not see the If anyone has any thoughts or suggestions, please send them my way. |
…#1) - Brought over the Swift gazelle files from `rules_swift_package_manager`. - Set up CI. Related to cgrindel/rules_swift_package_manager#924.
The |
@brentleyjones @jpsim @luispadron I think we are all set to create release 1.0.0. Is there anything else that we need to consider before pulling the trigger? |
Only thing I can think of is if fixing #892 would introduce any breaking changes, maybe we'd want to wait for that? But I think changes should be contained to the upstream rules |
@luispadron TBH, I have not been following that issue very closely. It sounds like the gist is Xcode allows building different packages with different flags, while Bazel's rules, by default, want to build everything with the same set of flags. I can see imagine that |
@cgrindel I think we should not cut 1.0 without this and Xcode 16 / Swift 6 support: There are popular SPM packages like grpc-swift using Swift 6 features that will fail with RSPM. Additionally, can we break the dependencies on gazelle, swift_gazelle_plugin and rules_go for the module, even if they're used in some examples? |
Swift 6 support was never part of the release 1.0.0 plan. Adding support should not be a breaking change. With regard to gazelle dependencies in the examples, I have no intention of removing it there. They help with the maintenance of the examples. With regard to Go deps in rspm, if someone wants to reimplement the Swift deps tool in Swift, that is fine with me. However, I don't anticipate working on it at any time soon. Since it will not be a breaking change for the ruleset, I don't see it as a blocker for release 1.0.0. |
@AttilaTheFun What is needed to support Swift 6? |
@cgrindel There are several SwiftSettings introduced in Swift 6 for enabling various language features like private imports, strict concurrency checks, requiring existential any etc. RSPM will fail on packages that use them. Re: go deps, it's fine for them to be dev dependencies but IMHO it would be a surprise to me as a developer if a repository rule for swift packages added a dependency on rules_go for no apparent reason. With gazelle it makes sense because it's a go tool, but for people just using RSPM they shouldn't need it. |
It shouldn't unless you're using the |
But to Chucks point, i dont think adding Swift 6 support changes anything about the public API for rules_swift_package_manager and so its not really a blocker for 1.0.0 |
@luispadron is it smart enough to not load the go dependencies if the module depends on them but the specific rule does not? At the very least it could cause versioning issues. @cgrindel not sure about your feelings regarding AI tools but I have found Claude to be very good at translating things between languages. I'd be happy to try feeding the deps tool into it and asking it to translate it to Swift + fixing it up. |
Some details from @fmeum:
tl;dr It is not downloading the Go toolchain implementation unless you enable the swift deps info functionality. |
I am happy to review. However, I still do not believe that this is required for release 1.0.0. Again, swapping out the underlying tool should not be a breaking change. Keep in mind, you are only enabling this functionality, if you want to use the Swift gazelle plugin. Using gazelle will bring down the Go toolchain among other things. |
Much of the work that went into release 1.0.0 was mitigating the Go dependencies. We have it squirreled away such that you don't take the hit unless you want that functionality. |
Ok that seems reasonable though I would still like to help break the non-dev go dependencies at some point. People might see them on registry.bazel.build, not know how or when they're used, and be confused. |
Regarding the SwiftSettings, I understand it's not a breaking change, but I still think announcing the 1.0 release while not supporting an increasing number of packages is strange. |
That's fair, what's left for swift 6 support? |
@luispadron I have a pr for the swift settings but it's blocked on the CI running Xcode 15. @cgrindel said there were some errors when he tried to upgrade but we haven't had time to debug them yet. |
@AttilaTheFun So, we need to drop support for Xcode 15? |
@cgrindel I don't know if we have to drop support for Xcode 15, but some packages like grpc-swift now require Swift 6. Specifically I believe it was my new example exercising these Swift 6 features that was failing in CI |
Adjust the documentation now that the [Swift gazelle plugin](https://github.com/cgrindel/swift_gazelle_plugin) has its own repository. Related to #924.
@AttilaTheFun Do you think that merging #1423 is sufficient to declare victory for release 1.0.0? |
@cgrindel yeah I think so -- I just rebased it. It would be nice to mark rules_go as a dev_dependency but I suppose that's not a hard blocker. Not sure if removing it later would be considered a breaking change @brentleyjones ? |
It is not a dev dependency, at this time. Removing a dep should never be a breaking change. |
Yeah, it wouldn't be a breaking change. It's fine as is for 1.0. I would like to land #1516, but I don't have time right now to add the example for it. |
Let's create a release candidate (e.g., 1.0.0-rc1). It will signal our intention to create a 1.0.0 release. It may encourage folks to try it out before we declare victory. |
Goals
Tasks
Package.swift
andPackage.resolved
in the repository rule.mod tidy
will update theMODULE.bazel
file with the correctuse_repos
declaration.swift_deps START
andswift_deps END
comments.bzlmod/workspace
to usefrom_package()
.UpdateFor now, I removed//:swift_update_pkgs
to just run SPM commands without using Go. Be sure to use the Swift toolchain, not the Swift installed on the system. (Possibly, create a new macro that creates the commands for running Swift package commands.)swift_update_packages
. If people would like a way to update Swift packages using Bazel, we will do it as a separate feature.grpc_package_example
symlink_example
ios_sim
rules_swift_package_manager
and set up CI swift_gazelle_plugin#1rules_swift_package_manager
. chore: useswift_gazelle_plugin
for examples and other integration tests #1538The text was updated successfully, but these errors were encountered: