Skip to content

Conversation

@thiagohmcruz
Copy link
Contributor

Regressed in #773

],
sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d",
)
elif bazel_version.major == "6" and bazel_version.minor == "1":
Copy link
Collaborator

@justinseanmartin justinseanmartin Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thiagohmcruz and I discussed offline - This feels like a weird special behavior to have for handling the CI use-case (per this comment). I like that the proposed change makes the rules_apple 2.x support a bit more explicit in the API contract. Before this change, someone using 6.1 and accidentally getting some weird default dependencies would probably be confusing.

I think we're going to omit the Bazel version check here and have this be defaults that we know work for rules_apple 2.x based on an explicit use_rules_apple_2 = True param. We're also going to reset this back to the values used prior to #773 (rules_apple v2.5.0 and rules_swift v1.10.0) as the defaults. For CI, Thiago is going to mutate the WORKSPACE file in the CI script to pass use_rules_apple_2 = True (default in the WORKSPACE will be False). Separately to this, we could bump everything to run on Bazel 6.4 as well and things should continue to work.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you both, that's easier to reason about

@thiagohmcruz
Copy link
Contributor Author

thiagohmcruz commented Oct 26, 2023

@justinseanmartin To confirm the sed to use rules_apple 2.x on CI + Bazel 6.1.2 is working I checked the events here and saw this:

  {
    "id": {
      "fetch": {
        "url": "https://github.com/bazelbuild/rules_apple/releases/download/2.5.0/rules_apple.2.5.0.tar.gz"
      }
    },
    "fetch": {
      "success": true
    }
  },

Copy link
Collaborator

@justinseanmartin justinseanmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth adding a comment on on the elsif block and updating the one on the else block. You technically don't need to specify load_rules_apple_2_dependencies in order to load the rules_apple 2.x, given the _maybe()'s, this is just a convenience for folks that want to use the defaults and making the rules_apple 2.x support a bit more clear in the API contract.

@thiagohmcruz thiagohmcruz changed the title Allow Bazel 6 users to opt-in for rules_apple 2.x Allow Bazel 6 users to explicitly opt-in for rules_apple 2.x Oct 26, 2023
@thiagohmcruz thiagohmcruz changed the title Allow Bazel 6 users to explicitly opt-in for rules_apple 2.x Allow Bazel 6 users to explicitly opt-in to rules_apple 2.x Oct 26, 2023
Copy link
Collaborator

@mattrobmattrob mattrobmattrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this should be a major version bump since we're changing the public API? I'm curious how many folks are using this definition vs. the maybe support outside of Block.

@luispadron
Copy link
Collaborator

luispadron commented Oct 27, 2023

Think this should be a major version bump since we're changing the public API? I'm curious how many folks are using this definition vs. the maybe support outside of Block.

I personally wouldn't consider that public api, IMO it shouldn't have been merged to begin with since again users in Bazel can simply define the version they want to use. I think this PR is better than what we have right now as it makes it more clear but ideally, we wouldn't have this at flag all.

If we wanted to test in CI with 6.x and rules_apple 2 we can configure that in CI

@thiagohmcruz
Copy link
Contributor Author

thiagohmcruz commented Oct 27, 2023

+1 to treating this as an improved contract but not necessarily a major version bump (no strong opinions though if folks want to do so). To hard code it to "Bazel 6.1.x" was a bit hack-y and would make folks on that version hit rules_apple 2.x without them knowing.

With this new flag at least it's now an opt-in for "I'm using whatever Bazel version <=6.x.x and I want to use rules_apple 2.x".

@thiagohmcruz thiagohmcruz enabled auto-merge (squash) October 27, 2023 15:26
@mattrobmattrob
Copy link
Collaborator

I don't feel strongly. Please just call it out in the release notes. 🙏

@thiagohmcruz thiagohmcruz merged commit 5b434f7 into master Oct 27, 2023
@thiagohmcruz thiagohmcruz deleted the thiago/bazel-6-rules_apple-2.x-opt-in branch October 27, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants