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

Bug: Internal precondition failure when generating xcode project. #3090

Open
ztzhang opened this issue Sep 20, 2024 · 0 comments
Open

Bug: Internal precondition failure when generating xcode project. #3090

ztzhang opened this issue Sep 20, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ztzhang
Copy link

ztzhang commented Sep 20, 2024

Description

Under incremental generation mode, we hit Internal precondition failure when generating the xcode project. Specifically, the top level target is an ios_application with extensions. The error seems to indicate when creating scheme, the extension target ID is not found:

tools/generators/xcschemes/src/Generator/CreateScheme.swift:181: Extension Target ID "@@//:example_extension ios_arm64-dbg-ios-arm64-min18.0-applebin_ios-ST-a34dd529b319" not found in:
[@@//:example_control_widget ios_arm64-dbg-ios-arm64-min18.0-applebin_ios-ST-a34dd529b319, @@//:example_control_widget ios_sim_arm64-dbg-ios-sim_arm64-min18.0-applebin_ios-ST-3e8967f1473a]
Please file a bug report at https://github.com/MobileNativeFoundation/rules_xcodeproj/issues/new?template=bug.md

The project generation works fine if I set generation_mode = "legacy". But under legacy mode, building the project inside xcode will throw an error suggeting ld in the sandbox does not have the right permission:

error: unable to spawn process  `PATH_TO_PROJECT/example.xcodeproj/rules_xcodeproj/bazel/ld' (permission denied).

Indeed, ld only has permission -rw-r--r--. It goes away when I mannually grant +x permission.

Reproduction steps

Here's a self-contained, reproducible repo:
https://github.com/ztzhang/rules_xcodeproj_bug.

Expected behavior

Project generation works as expected, and build inside xcode works as expected.

rules_xcodeproj version

2.6.1, or 2.7.0

Xcode version

16.1 (beta) or 16.0

Bazel version

7.1.0

rules_apple version

3.8.0

rules_swift version

No response

Additional information

No response

@ztzhang ztzhang added the bug Something isn't working label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant