Open cgrindel opened 7 months ago
Notes regarding Gazelle plugin
update_repos
.rules_swift_package_manager
will define a repository called swift_direct_deps_info
. Package.swift
).swift_direct_deps_info
and read the information written there. (NOTE: We could just read the list of repo names by parsing the MODULE.bazel
. However, I think that we want to support non-bzlmod a bit longer.)pkg_info.json
file that lives at the root of every Swift package repository.DependencyIndex
.See below for new plan.
What do we need DependencyIndex
for anymore? Aren't product names deterministic now?
What do we need DependencyIndex for anymore? Aren't product names deterministic now?
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 bazel test //...
, no index file required. 🙂 I started updating the Gazelle plugin to work properly in this new world. Here is the basic plan:
swift_deps_info
repository rule that generates a JSON file with the module/product/package information that is needed to resolve modules to Bazel targets.DependencyIndex
.DependencyIndex
. So, I hope that there won't be any other major changes to the resolve and generate portions of the Gazelle plugin.Can we add #1079 to this?
Can we add https://github.com/cgrindel/rules_swift_package_manager/issues/1079 to this?
Done.
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 rules_xcodeproj
no-sandbox build. Unfortunately, that fails with duplicate definitions. I see and mostly understand why this is happening. Unfortunately, I am struggling to prevent the duplicate module map files causing the errors.
I put together #1266 which attempts to prevent objc_library
from creating its own module map file by specifying the one that rules_swift_package_manager
creates. Unfortunately, this causes an error:
In file included from external/rules_swift_package_manager~~swift_deps~swiftpkg_firebase_ios_sdk/FirebaseInstallations/Source/Library/FIRInstallations.m:25:
external/rules_swift_package_manager~~swift_deps~swiftpkg_firebase_ios_sdk/FirebaseCore/Extension/FirebaseCoreInternal.h:15:1: error: use of '@import' when modules are disabled
@import FirebaseCore;
^
1 error generated.
Looking through the actual command-line, I do not see the -fmodules
flag. I thought that this was added by setting enable_modules = True
.
If anyone has any thoughts or suggestions, please send them my way.
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
.