-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: use suffixed repo name as package name #1072
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my quick read, it looks like passing package_name
will be a noop if the package does not use the package
access modifier. Is that correct?
That's my understanding, yes. I believe SwiftPM does this by default, using the package name in Package.swift. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Seems that downstream compilation workers got confused by the @-prefixed package name and that caused tests to fail in CI. I've tweaked this slightly to trim the leading @. |
I'm having trouble confirming locally, but it seems like the failing tests are running with Xcode 14.3/Swift 5.8, which doesn't support the |
We should be using 15.0.1 in CI. However, we are not locking the Xcode version for most of the examples. @brentleyjones @luispadron Should we put this functionality behind a flag or settable on the Bazel module tag class/repository rule? |
rules_swift should ignore that attribute when it's not supported. If it doesn't, we should fix it. |
@brentleyjones Should I open an issue on |
I can look at fixing that tomorrow if no one else has time, but rules_swift releases are sort of blocked right now as we get some other stuff merged so not sure when this repo could pick that fix up |
Could/should we flag this in this repo based on the swift tools version of the Package.swift? |
@watt @cgrindel Brentley and I discussed a lil and it probably makes more sense to gate the setting of |
SGTM. What is the correct gate? The Swift tools version? |
Yeah I imagine that's how it works in SPM but haven't checked |
Head branch was pushed to by a user without write access
Just pushed an update that gates |
…#318) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | rules_swift_package_manager | bazel_dep | minor | `0.30.0` -> `0.31.1` | | [rules_swift_package_manager](https://togithub.com/cgrindel/rules_swift_package_manager) | http_archive | minor | `v0.30.0` -> `v0.31.1` | --- ### Release Notes <details> <summary>cgrindel/rules_swift_package_manager (rules_swift_package_manager)</summary> ### [`v0.31.1`](https://togithub.com/cgrindel/rules_swift_package_manager/releases/tag/v0.31.1) [Compare Source](https://togithub.com/cgrindel/rules_swift_package_manager/compare/v0.31.0...v0.31.1) #### What's Changed - fix: synchronize the Bazel version for the BCR presubmit by [@​cgrindel](https://togithub.com/cgrindel) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1097](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1097) **Full Changelog**: cgrindel/rules_swift_package_manager@v0.31.0...v0.31.1 #### Bazel Module Snippet ```python bazel_dep(name = "rules_swift_package_manager", version = "0.31.1") ``` #### Workspace Snippet ```python load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_swift_package_manager", sha256 = "181507e9d5401ca52b23e84c182a923f2c072e975bccf41fb7d2a1aa17c70bca", urls = [ "https://github.com/cgrindel/rules_swift_package_manager/releases/download/v0.31.1/rules_swift_package_manager.v0.31.1.tar.gz", ], ) load("@​rules_swift_package_manager//:deps.bzl", "swift_bazel_dependencies") swift_bazel_dependencies() load("@​cgrindel_bazel_starlib//:deps.bzl", "bazel_starlib_dependencies") bazel_starlib_dependencies() ### MARK: - Gazelle ### gazelle:repo bazel_gazelle load("@​bazel_gazelle//:deps.bzl", "gazelle_dependencies") load("@​rules_swift_package_manager//:go_deps.bzl", "swift_bazel_go_dependencies") load("@​io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") ### Declare Go dependencies before calling go_rules_dependencies. swift_bazel_go_dependencies() go_rules_dependencies() go_register_toolchains(version = "1.21.1") gazelle_dependencies() ### MARK: - Swift Toolchain http_archive( name = "build_bazel_rules_swift", ### Populate with your preferred release ### https://github.com/bazelbuild/rules_swift/releases ) load( "@​build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies", ) load("//:swift_deps.bzl", "swift_dependencies") ### gazelle:repository_macro swift_deps.bzl%swift_dependencies swift_dependencies() swift_rules_dependencies() load( "@​build_bazel_rules_swift//swift:extras.bzl", "swift_rules_extra_dependencies", ) swift_rules_extra_dependencies() ``` ### [`v0.31.0`](https://togithub.com/cgrindel/rules_swift_package_manager/releases/tag/v0.31.0) [Compare Source](https://togithub.com/cgrindel/rules_swift_package_manager/compare/v0.30.0...v0.31.0) #### What's Changed - chore: update README.md for v0.30.0 by [@​cgrindel-app-token-generator](https://togithub.com/cgrindel-app-token-generator) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1031](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1031) - chore(deps): update dependency apple/swift-nio to v2.65.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1029](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1029) - chore(deps): update dependency nicklockwood/swiftformat to from: "0.53.8" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1032](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1032) - chore(deps): update dependency rules_swift to v1.18.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1034](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1034) - chore(deps): update dependency stripe/stripe-ios to from: "23.27.1" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1030](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1030) - chore(deps): update dependency vapor/vapor to v4.93.1 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1035](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1035) - chore(deps): update dependency io_bazel_rules_go to v0.47.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1036](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1036) - chore(deps): update dependency rules_apple to v3.5.1 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1033](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1033) - fix: Don't use legacy UTF8 handling when writing files by [@​jflan-dd](https://togithub.com/jflan-dd) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1040](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1040) - chore(deps): update dependency bazel_skylib to v1.6.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1041](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1041) - chore(deps): update dependency bazel_skylib_gazelle_plugin to v1.6.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1042](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1042) - chore(deps): update dependency bazel_skylib to v1.6.1 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1045](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1045) - chore(deps): update dependency bazel_skylib_gazelle_plugin to v1.6.1 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1046](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1046) - chore: upgrade `gazelle` and `rules_go` manually by [@​cgrindel](https://togithub.com/cgrindel) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1048](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1048) - fix: use constants instead of string for directive names by [@​cgrindel](https://togithub.com/cgrindel) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1050](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1050) - chore(deps): update dependency rules_proto to v6 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1051](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1051) - chore(deps): update dependency sdwebimage/sdwebimageswiftui to from: "3.0.4" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1053](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1053) - chore(deps): update dependency pointfreeco/swift-composable-architecture to from: "1.10.0" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1052](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1052) - chore(deps): update dependency pointfreeco/swift-composable-architecture to from: "1.10.1" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1054](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1054) - chore(deps): update dependency pointfreeco/swift-composable-architecture to from: "1.10.2" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1055](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1055) - chore(deps): update dependency firebase/firebase-ios-sdk to from: "10.25.0" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1056](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1056) - fix(deps): update module golang.org/x/text to v0.15.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1058](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1058) - fix(deps): update golang.org/x/exp digest to [`9bf2ced`](https://togithub.com/cgrindel/rules_swift_package_manager/commit/9bf2ced) by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1060](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1060) - chore(deps): update dependency stripe/stripe-ios to from: "23.27.2" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1062](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1062) - chore(deps): update dependency pointfreeco/swift-composable-architecture to from: "1.10.3" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1063](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1063) - chore(deps): update dependency bazel to v7.1.2 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1064](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1064) - chore(deps): update dependency rules_xcodeproj to v2.3.1 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1066](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1066) - fix: don't include directories in resources by [@​jflan-dd](https://togithub.com/jflan-dd) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1039](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1039) - chore(deps): update dependency quick/quick to from: "7.6.0" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1069](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1069) - chore(deps): update dependency pointfreeco/swift-composable-architecture to from: "1.10.4" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1067](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1067) - chore(deps): update dependency iterable/swift-sdk to from: "6.5.2" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1068](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1068) - chore(deps): update dependency nicklockwood/swiftformat to from: "0.53.9" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1070](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1070) - chore(deps): update dependency firebase/firebase-ios-sdk to from: "10.26.0" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1071](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1071) - chore(deps): update dependency shakebugs/shake-ios to from: "16.2.5" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1038](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1038) - fix: add apple_support to create_example template by [@​jflan-dd](https://togithub.com/jflan-dd) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1075](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1075) - chore(deps): update dependency nicklockwood/swiftformat to from: "0.53.10" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1077](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1077) - chore(deps): update dependency apple/swift-argument-parser to from: "1.4.0" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1080](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1080) - chore(deps): update dependency iterable/swift-sdk to from: "6.5.3" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1082](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1082) - chore(deps): update dependency com_github_apple_swift_argument_parser to v1.4.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1081](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1081) - chore(deps): update dependency ashleymills/reachability.swift to from: "5.2.3" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1083](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1083) - fix: Remove unused source `module.modulemap` files by [@​brentleyjones](https://togithub.com/brentleyjones) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1085](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1085) - feat: recursively initialize external Swift packages to match SPM behavior by [@​cgrindel](https://togithub.com/cgrindel) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1095](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1095) - fix: specify all defines as local using `copts` by [@​cgrindel](https://togithub.com/cgrindel) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1094](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1094) - feat: use suffixed repo name as package name by [@​watt](https://togithub.com/watt) in [https://github.com/cgrindel/rules_swift_package_manager/pull/1072](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1072) #### New Contributors - [@​watt](https://togithub.com/watt) made their first contribution in [https://github.com/cgrindel/rules_swift_package_manager/pull/1072](https://togithub.com/cgrindel/rules_swift_package_manager/pull/1072) **Full Changelog**: cgrindel/rules_swift_package_manager@v0.30.0...v0.31.0 #### Bazel Module Snippet ```python bazel_dep(name = "rules_swift_package_manager", version = "0.31.0") ``` #### Workspace Snippet ```python load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_swift_package_manager", sha256 = "944cfe2cb348a6cc19e27967d572fe1f28944a67f3318e10956f0c51db706ab5", urls = [ "https://github.com/cgrindel/rules_swift_package_manager/releases/download/v0.31.0/rules_swift_package_manager.v0.31.0.tar.gz", ], ) load("@​rules_swift_package_manager//:deps.bzl", "swift_bazel_dependencies") swift_bazel_dependencies() load("@​cgrindel_bazel_starlib//:deps.bzl", "bazel_starlib_dependencies") bazel_starlib_dependencies() ### MARK: - Gazelle ### gazelle:repo bazel_gazelle load("@​bazel_gazelle//:deps.bzl", "gazelle_dependencies") load("@​rules_swift_package_manager//:go_deps.bzl", "swift_bazel_go_dependencies") load("@​io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") ### Declare Go dependencies before calling go_rules_dependencies. swift_bazel_go_dependencies() go_rules_dependencies() go_register_toolchains(version = "1.21.1") gazelle_dependencies() ### MARK: - Swift Toolchain http_archive( name = "build_bazel_rules_swift", ### Populate with your preferred release ### https://github.com/bazelbuild/rules_swift/releases ) load( "@​build_bazel_rules_swift//swift:repositories.bzl", "swift_rules_dependencies", ) load("//:swift_deps.bzl", "swift_dependencies") ### gazelle:repository_macro swift_deps.bzl%swift_dependencies swift_dependencies() swift_rules_dependencies() load( "@​build_bazel_rules_swift//swift:extras.bzl", "swift_rules_extra_dependencies", ) swift_rules_extra_dependencies() ``` </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/bazel-contrib/rules_bazel_integration_test). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNzcuOCIsInVwZGF0ZWRJblZlciI6IjM3LjM3Ny44IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Resolves #1057.
Following the recommendation from the discussion there, this uses the repo name suffixed with
.rspm
as the package name.