Skip to content

Conversation

@dostrander
Copy link
Collaborator

This will need to wait until this is merged

rules/test.bzl Outdated
tests.append(test_name)
split_rule(
name = test_name,
product_module_name = name.replace("-", "_"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this use kwargs.module_name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes! I thought this was a thing but I couldn't find it initially

@dostrander dostrander force-pushed the dostrander/pass-product-module-name branch from d508a8b to c155dd3 Compare December 9, 2022 19:41
@mattrobmattrob
Copy link
Collaborator

Have we solved additions to rules_apple like this in a backwards compatible way in the future or just assume you'll need to bump to be on this change or newer?

@dostrander dostrander force-pushed the dostrander/pass-product-module-name branch 2 times, most recently from 3f04150 to 8eddfd0 Compare December 12, 2022 15:12
rules/test.bzl Outdated
tests.append(test_name)
split_rule(
name = test_name,
module_name = kwargs["module_name"],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would adding "module_name" to _IOS_TEST_KWARGS accomplish the same thing while keeping all the important keys in one place?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah it should. Tried it at first but it failed for a way i didn't understand and din't have to time to debug. I actually didn't mean to push this up but was int he wrong repo :). I need to debug why it wasn't working and hopefully get it to work

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So this wasn't able to be done because the kwargs["module_name"] was also used in apple_library our current implementation of _IOS_TEST_KWARGS pops them off so they aren't passed into apple_library. I added a comment explaining in code so it's not as confusing int he future

@dostrander
Copy link
Collaborator Author

Have we solved additions to rules_apple like this in a backwards compatible way in the future or just assume you'll need to bump to be on this change or newer?

@mattrobmattrob I was thinking of looking into some patching for this PR as well but i'm not sure how future-proof that is

@dostrander dostrander force-pushed the dostrander/pass-product-module-name branch from 8eddfd0 to fb01225 Compare December 13, 2022 23:57
@dostrander dostrander force-pushed the dostrander/pass-product-module-name branch from fb01225 to 3fdaa96 Compare December 14, 2022 00:01
@dostrander
Copy link
Collaborator Author

@mattrobmattrob @jerrymarino PTAL at how I plan on doing patching. LMK if there is something else we may want to do

Copy link
Contributor

@jerrymarino jerrymarino left a comment

Choose a reason for hiding this comment

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

Filtering looks fine - my main comment is on maintaining patch files for rules_apple bumps.. Do you have PRs linked for that? We can take the other approach for a subset of rules_apple if they aren't upstreamable.

@jerrymarino
Copy link
Contributor

Also are there concerns the rules_apple patch will break for people even with landing this? I gave it a stamp assuming we'll fix it - but it might cause an issue.

@jerrymarino
Copy link
Contributor

Have we solved additions to rules_apple like this in a backwards compatible way in the future or just assume you'll need to bump to be on this change or newer?

➕ to @mattrobmattrob comment on this


rule(
name = name,
module_name = module_name,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this will break other people that have a different version of rules_apple ( similar of @mattrobmattrob's comment )

@jerrymarino
Copy link
Contributor

We already keep a fork ofxctestrunner for our patches from time to time. To better integrate with how we do things, and to integrate with github workflows I'd like to use that instead of patch files: https://github.com/bazel-ios/xctestrunner - similar for rules_apple as well.

This said - we'll still need to make it backwards compatible.

@mattrobmattrob
Copy link
Collaborator

FWIW, I don't want to block a merge because of backwards compatibility, necessarily. Just want it to be a conversation. 👍 We are essentially on trunk so it shouldn't cause any issues for us.

@jerrymarino
Copy link
Contributor

The "backwards compatibility" issue I encountered was the PR seemed to require me to use the rules_apple version generated by the patch: in other words, if it needs argument module_name which doesn't exist outside of the patches. So if you have a different version of rules_apple than rules_ios gives you it won't work.

@jerrymarino
Copy link
Contributor

@dostrander if you want to add an if statement in a macro - I came up with a mechansim to add this:
#628

load("@rules_ios_cfg//:config.bzl", "using_internal_rules_apple")

if using_internal_rules_apple:
   # some
else:
   # other

We might want this anyhow - but let me know what you're thoughts are. I added some suggestions to simplify rules_apple in that review BTW - both which can be backwards compatible.

@dostrander
Copy link
Collaborator Author

Declining this as I've made a better fix in rules_apple itself. May need to open up a new PR to use that and xctesturnner fixes

@dostrander dostrander closed this Dec 16, 2022
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