Skip to content
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

[Bazel 6.x.x] sim_arm64 middleman fixes #767

Merged
merged 2 commits into from
Sep 14, 2023

Conversation

jerrymarino
Copy link
Contributor

In Bazel 6.x.x the static_framework_file was migrated onto imported_library this PR completes the migration and is followup to the Bazel 6 work.

The related rules_apple change which updated static_framework_file: bazelbuild/rules_apple@8d84134

@jerrymarino jerrymarino changed the title [6.x.x] sim_arm64 middleman fixes [Bazel 6.x.x] sim_arm64 middleman fixes Sep 14, 2023
if use_lts_5_rules_apple_api:
objc_provider_fields["static_framework_file"] = depset(replaced_static_framework.inputs)
else:
# See comment in file above regarding this name in 6.x.x
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this referring to L103? It might be more straightforward to repeat it here

Copy link
Contributor

Choose a reason for hiding this comment

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

+1, since there's a few occurrences one suggestion is to move the comment in L103 to where use_lts_5_rules_apple_api is initialized? This way readers wondering about the conditionals can simply go back to that one line for context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

replaced_frameworks = replaced_dyanmic_framework.values() + replaced_static_framework.replaced.values()
all_replaced_frameworks = replaced_dyanmic_framework.values() + replaced_static_framework.replaced.values()

# This slightly varies in Bazel 6.x.x
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you expand this comment to explain what is different between the versions and needs unique handling for each?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jerrymarino correct me if I'm wrong but I believe what this is doing is handling only dynamic fmws in Bazel 6 since static fmws are handled here: #766. If that's the case a small comment with this context would be preferred IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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


compat_link_opt = ["-L__BAZEL_XCODE_DEVELOPER_DIR__/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator", "-Wl,-weak-lswiftCompatibility51"]

if len(replaced_frameworks):
if len(all_replaced_frameworks):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it intentional that linkopt below is still using replaced_frameworks instead of all_replaced_frameworks?

["\"\"\"-F" + "/".join(f.path.split("/")[:-2]) + "\"\"\"" for f in replaced_frameworks] + compat_link_opt,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is the gist of it - 6.x.x static_framework was transitioned to imported_library and is in the filelist not here

In Bazel 6.x.x the `static_framework_file` was migrated onto
`imported_library` this PR completes the migration and is followup to
the Bazel 6 work.

The related rules_apple change which updated `static_framework_file`:
bazelbuild/rules_apple@8d84134
@jerrymarino jerrymarino force-pushed the jmarino/6.x.x_arm64_middleman_fixes branch from 94cb5b1 to 53c0d54 Compare September 14, 2023 17:42
@jerrymarino jerrymarino force-pushed the jmarino/6.x.x_arm64_middleman_fixes branch from 53c0d54 to d7e2f50 Compare September 14, 2023 17:44
@jerrymarino jerrymarino merged commit ac2ceab into master Sep 14, 2023
@jerrymarino jerrymarino deleted the jmarino/6.x.x_arm64_middleman_fixes branch September 14, 2023 18:18
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.

3 participants