-
Notifications
You must be signed in to change notification settings - Fork 33
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
fix: only add dependency when unresolved #749
Merged
luispadron
merged 1 commit into
main
from
luis/fix-extra-dep-bug-when-unresolved-module
Nov 15, 2023
Merged
fix: only add dependency when unresolved #749
luispadron
merged 1 commit into
main
from
luis/fix-extra-dep-bug-when-unresolved-module
Nov 15, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
luispadron
force-pushed
the
luis/fix-extra-dep-bug-when-unresolved-module
branch
2 times, most recently
from
November 15, 2023 05:22
9c3f18f
to
fef4e51
Compare
2 tasks
cgrindel
approved these changes
Nov 15, 2023
luispadron
force-pushed
the
luis/fix-extra-dep-bug-when-unresolved-module
branch
from
November 15, 2023 15:00
fef4e51
to
042a92f
Compare
jpsim
added a commit
to jpsim/rules_swift_package_manager
that referenced
this pull request
Nov 15, 2023
* upstream/main: fix: only add dependency when unresolved (cgrindel#749) chore(deps): update dependency nicklockwood/swiftformat to from: "0.52.10" (cgrindel#745) chore(deps): update dependency firebase/firebase-ios-sdk to from: "10.18.0" (cgrindel#739)
renovate bot
referenced
this pull request
in bazel-contrib/rules_bazel_integration_test
Nov 27, 2023
…#253) [![Mend Renovate logo banner](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [rules_swift_package_manager](https://togithub.com/cgrindel/rules_swift_package_manager) | http_archive | minor | `v0.21.0` -> `v0.22.0` | --- ### Release Notes <details> <summary>cgrindel/rules_swift_package_manager (rules_swift_package_manager)</summary> ### [`v0.22.0`](https://togithub.com/cgrindel/rules_swift_package_manager/releases/tag/v0.22.0) [Compare Source](https://togithub.com/cgrindel/rules_swift_package_manager/compare/v0.21.0...v0.22.0) #### What's Changed - chore: update README.md for v0.21.0 by [@​cgrindel-app-token-generator](https://togithub.com/cgrindel-app-token-generator) in [https://github.com/cgrindel/rules_swift_package_manager/pull/736](https://togithub.com/cgrindel/rules_swift_package_manager/pull/736) - fix: only configure remote cache if the API key is available by [@​cgrindel](https://togithub.com/cgrindel) in [https://github.com/cgrindel/rules_swift_package_manager/pull/746](https://togithub.com/cgrindel/rules_swift_package_manager/pull/746) - chore(deps): update dependency firebase/firebase-ios-sdk to from: "10.18.0" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/739](https://togithub.com/cgrindel/rules_swift_package_manager/pull/739) - chore(deps): update dependency nicklockwood/swiftformat to from: "0.52.10" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/745](https://togithub.com/cgrindel/rules_swift_package_manager/pull/745) - fix: only add dependency when unresolved by [@​luispadron](https://togithub.com/luispadron) in [https://github.com/cgrindel/rules_swift_package_manager/pull/749](https://togithub.com/cgrindel/rules_swift_package_manager/pull/749) - chore(deps): update dependency pointfreeco/swift-composable-architecture to from: "1.4.2" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/737](https://togithub.com/cgrindel/rules_swift_package_manager/pull/737) - feat: add support for Swift macros by [@​jpsim](https://togithub.com/jpsim) in [https://github.com/cgrindel/rules_swift_package_manager/pull/753](https://togithub.com/cgrindel/rules_swift_package_manager/pull/753) - fix: correctly differentiate built-in and local modules with same name by [@​luispadron](https://togithub.com/luispadron) in [https://github.com/cgrindel/rules_swift_package_manager/pull/756](https://togithub.com/cgrindel/rules_swift_package_manager/pull/756) - chore(deps): update dependency apple/swift-nio to v2.62.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/754](https://togithub.com/cgrindel/rules_swift_package_manager/pull/754) - feat: add more built in frameworks by [@​luispadron](https://togithub.com/luispadron) in [https://github.com/cgrindel/rules_swift_package_manager/pull/750](https://togithub.com/cgrindel/rules_swift_package_manager/pull/750) - chore: upgrade Bazel to 7.0.0rc4 by [@​cgrindel](https://togithub.com/cgrindel) in [https://github.com/cgrindel/rules_swift_package_manager/pull/757](https://togithub.com/cgrindel/rules_swift_package_manager/pull/757) - chore(deps): update dependency marmelroy/phonenumberkit to from: "3.7.5" by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/759](https://togithub.com/cgrindel/rules_swift_package_manager/pull/759) - chore: update CI to use Xcode 15 and Swift 5.9 by [@​jpsim](https://togithub.com/jpsim) in [https://github.com/cgrindel/rules_swift_package_manager/pull/760](https://togithub.com/cgrindel/rules_swift_package_manager/pull/760) - chore: add more Xcode 14.3.1 CI exceptions by [@​jpsim](https://togithub.com/jpsim) in [https://github.com/cgrindel/rules_swift_package_manager/pull/765](https://togithub.com/cgrindel/rules_swift_package_manager/pull/765) - chore: update TCA example by [@​jpsim](https://togithub.com/jpsim) in [https://github.com/cgrindel/rules_swift_package_manager/pull/755](https://togithub.com/cgrindel/rules_swift_package_manager/pull/755) - chore(deps): update dependency vapor/vapor to v4.87.1 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/767](https://togithub.com/cgrindel/rules_swift_package_manager/pull/767) - fix: only add `generates_header` attribute if target is a library by [@​cgrindel](https://togithub.com/cgrindel) in [https://github.com/cgrindel/rules_swift_package_manager/pull/766](https://togithub.com/cgrindel/rules_swift_package_manager/pull/766) - chore(deps): update dependency io_bazel_rules_go to v0.43.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/763](https://togithub.com/cgrindel/rules_swift_package_manager/pull/763) - fix(deps): update module github.com/deckarep/golang-set/v2 to v2.4.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/768](https://togithub.com/cgrindel/rules_swift_package_manager/pull/768) - chore: upgrade gazelle to 0.34.0 and rules_go to 0.43.0 by [@​cgrindel](https://togithub.com/cgrindel) in [https://github.com/cgrindel/rules_swift_package_manager/pull/588](https://togithub.com/cgrindel/rules_swift_package_manager/pull/588) - fix(deps): update module github.com/bazelbuild/bazel-gazelle to v0.34.0 by [@​cgrindel-self-hosted-renovate](https://togithub.com/cgrindel-self-hosted-renovate) in [https://github.com/cgrindel/rules_swift_package_manager/pull/486](https://togithub.com/cgrindel/rules_swift_package_manager/pull/486) - chore: avoid adding `.build` directory to client's workspace by [@​cgrindel](https://togithub.com/cgrindel) in [https://github.com/cgrindel/rules_swift_package_manager/pull/771](https://togithub.com/cgrindel/rules_swift_package_manager/pull/771) **Full Changelog**: cgrindel/rules_swift_package_manager@v0.21.0...v0.22.0 #### Bazel Module Snippet ```python bazel_dep(name = "rules_swift_package_manager", version = "0.22.0") ``` #### Workspace Snippet ```python load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_swift_package_manager", sha256 = "f1ddf074651bf7b3f4977026ae49f9182e44ade975df29740e8ff6666a136f3a", urls = [ "https://github.com/cgrindel/rules_swift_package_manager/releases/download/v0.22.0/rules_swift_package_manager.v0.22.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.19.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 this update 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:eyJjcmVhdGVkSW5WZXIiOiIzNy41OS44IiwidXBkYXRlZEluVmVyIjoiMzcuNTkuOCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Works towards the issues in #742.
This particular bug can be seen when adding an
import
to a built-in framework when it is not already in thebuiltin_modules.go
file.For example, adding
import os
would warn with:Which is correct but it would also erroneously add a dependency in the generated
BUILD.bazel
file for@swiftpkg_swift_argument_parser//:Plugins_GenerateManual
which then fails the build entirely.The reason for this bug is because the logic in
dependency_index.go
was not ensuring that the product being added as a dep was actually a product that needed to be resolved.In the case where all modules are resolvable (i.e. all builtin frameworks accounted for) this isn't hit as the list of
modulesToResolve
is exhausted before any unused products are ever considered.