-
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
fix: specify all defines as local using copts
#1094
Conversation
We can emulate |
@brentleyjones Can you elaborate on that? Do you mean specifying |
Yes 👍. But without |
So, do we want to keep all defines local or just the |
I don't see any code that propagates the define values. So, I will update the code to set all defines as local. @brentleyjones Is there any background why the |
Yes. It would make more sense to behave that way if you could have a source-less |
4418f1b
to
e281883
Compare
cc_library
targetscopts
@brentleyjones @luispadron This PR is ready for review. It now uses |
…#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>
In an attempt to localize defines to specific targets, we specify defines/macros for all target types (e.g., `swift_library`, `objc_library`, and `cc_library`) targets using `copts`. Fixes cgrindel#1093.
In an attempt to localize defines to specific targets, we specify defines/macros for all target types (e.g.,
swift_library
,objc_library
, andcc_library
) targets usingcopts
.Fixes #1093.