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

Add visionOS support #18905

Closed
wants to merge 1 commit into from
Closed

Conversation

keith
Copy link
Member

@keith keith commented Jul 11, 2023

No description provided.

@keith keith force-pushed the ks/add-visionos-support branch 2 times, most recently from 038c87a to 7578c68 Compare July 11, 2023 18:13
@keith
Copy link
Member Author

keith commented Jul 11, 2023

CI can't be green here until we update to include bazelbuild/platforms#71

keith added a commit to bazelbuild/apple_support that referenced this pull request Jul 11, 2023
keith added a commit to bazelbuild/apple_support that referenced this pull request Jul 11, 2023
keith added a commit to bazelbuild/apple_support that referenced this pull request Jul 14, 2023
@keith keith force-pushed the ks/add-visionos-support branch 4 times, most recently from b6fc6b2 to 47626a5 Compare August 3, 2023 16:32
src/MODULE.tools Show resolved Hide resolved
@keith keith mentioned this pull request Aug 3, 2023
@keith keith marked this pull request as ready for review August 3, 2023 17:11
@keith keith requested review from lberki and a team as code owners August 3, 2023 17:11
@github-actions github-actions bot added awaiting-review PR is awaiting review from an assigned reviewer team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. labels Aug 3, 2023
@keith
Copy link
Member Author

keith commented Aug 3, 2023

Ok this is green! sounds like @nglevin is going to review

Copy link
Contributor

@nglevin nglevin left a comment

Choose a reason for hiding this comment

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

Overall looks good to me.

I have some feedback regarding where bits will go, and some concern about introducing a minimum OS version CLI flag for visionOS specifically when there's a shared attribute that we have an opportunity to adopt before it has users depending on it.

help =
"Minimum compatible visionOS version for target simulators and devices. "
+ "If unspecified, uses 'visionos_sdk_version'.")
public DottedVersion.Option visionosMinimumOs;
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you considered using the existing --minimum_os_version flag instead of establishing a new --visionos_minimum_os flag, here?

Context; the flag was established for Android Crosstool purposes, to be shared by Apple Crosstools. You can access it from Starlark via the cpp fragment.

Ideally every Apple platform should source from a shared flag instead of platform-specific --*_minimum_os-es since the Apple transitions set it based on rule-level attributes, the minimum_os_version is typically set from an Apple bundling rule, and as far as building a _library rule for a given SDK with support for a minimum OS version, there shouldn't be a need to separate that for iOS vs watchOS between a _library and its explicit deps.

There's quite a few folks around Bazel who support the effort, and it'd be easier to go straight for that as we introduce the new Apple platform rather than attempt to add a new --*_minimum_os command line option that we'd then have to try to rapidly depreciate.

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely an option, the first I heard about the desire to not have these platform specific flags was from TVL after I submitted this so if you think we should avoid adding it here that's fine. I think as far as bazel users go there aren't many folks relying on this for building library rules (doing that for a specific platform is not easy given the intermediate state around migrating to platforms). Do you think we should commit and not add this flag?

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 it'd be best to avoid adding this flag in this PR, absolutely.

At least that would keep the scope of changes smaller, until a better solution for sourcing the minimum OS version for visionOS is available.

Copy link
Member Author

Choose a reason for hiding this comment

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

I looked into removing this and it's not super straight-forward. The current issue is that the CppOptions / CppConfiguration depend on the AppleConfiguration, which is where we compute the minimum OS and we would need to reference CppOptions.minimumOsVersion. Unless we want to move the Apple specific logic / flags from that into the CppConfiguration, which I don't think we would? Although we have done that for some other flags like --apple_generate_dsym

Copy link
Contributor

@nglevin nglevin Aug 3, 2023

Choose a reason for hiding this comment

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

We spoke about this in another shared channel. I see the issue, and I've relayed it to folks who own those options.

As agreed, we shouldn't do anything about that in this PR, but it would also be best not to introduce a --visionos_minimum_os flag in this PR.

For now, in the absence of any versions of visionOS to support besides "1.0" until shipping products come sometime next year, we'll stub this out and I'll look into addressing --minimum_os_version as the source of truth for visionOS builds in follow up work for myself.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is for J2ObjC, correct? Just making sure I understand the existing client usage.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this one is on its way out but it's still used here as well

@Override
public RuleClass build(RuleClass.Builder builder, RuleDefinitionEnvironment env) {
return builder
.cfg(AppleCrosstoolTransition.APPLE_CROSSTOOL_TRANSITION)
.build();
}

src/main/starlark/builtins_bzl/common/objc/transitions.bzl Outdated Show resolved Hide resolved
@nglevin
Copy link
Contributor

nglevin commented Aug 3, 2023

Added two more comments as I was really looking up and down to see what the other CLI options were being used for these days... some of which might just be historical inertia.

If there's an odd dependency of Bazel Apple crosstool or a similar service that needs it, that may be alright for now.

@keith keith force-pushed the ks/add-visionos-support branch 4 times, most recently from ada9410 to 94e5052 Compare August 3, 2023 22:53
@keith keith force-pushed the ks/add-visionos-support branch from d67ae1c to b773227 Compare August 4, 2023 23:24
@copybara-service copybara-service bot closed this in c113e62 Aug 8, 2023
@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Aug 8, 2023
@comius
Copy link
Contributor

comius commented Aug 9, 2023

@comius
Copy link
Contributor

comius commented Aug 9, 2023

@nglevin
Copy link
Contributor

nglevin commented Aug 9, 2023

All of those downstream projects should update to the platforms repo at 0.0.7 , as the change @ bazelbuild/platforms#71 was rolled in to that release.

Is there a common process for that? Or are all downstream builds expected to manually update to the latest platforms repo independently?

@lberki
Copy link
Contributor

lberki commented Aug 10, 2023

Downstream projects we track are on BuildKite are expected to update themselves, cc @meteorcloudy

@aiuto
Copy link
Contributor

aiuto commented Aug 10, 2023 via email

@keith keith deleted the ks/add-visionos-support branch August 10, 2023 16:10
keith added a commit to bazelbuild/apple_support that referenced this pull request Aug 10, 2023
keith added a commit to bazelbuild/apple_support that referenced this pull request Aug 10, 2023
keith added a commit to bazelbuild/apple_support that referenced this pull request Aug 12, 2023
keith added a commit to bazelbuild/apple_support that referenced this pull request Aug 12, 2023
keith added a commit to keith/bazel that referenced this pull request Sep 6, 2023
@keith
Copy link
Member Author

keith commented Sep 6, 2023

6.x cherry pick #19436

keith added a commit to keith/bazel that referenced this pull request Sep 8, 2023
keith added a commit to keith/bazel that referenced this pull request Sep 8, 2023
iancha1992 pushed a commit that referenced this pull request Sep 11, 2023
This cherry picks #18905 and
#19133

Co-authored-by: nglevin <122120823+nglevin@users.noreply.github.com>
@iancha1992
Copy link
Member

The changes in this PR have been included in Bazel 6.4.0 RC1. Please test out the release candidate and report any issues as soon as possible. If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=last_rc.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants