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: index is 1, but sequence has 1 elements pbxproj_partials.bzl #3092

Closed
louwers opened this issue Oct 22, 2024 · 3 comments
Closed

Bug: index is 1, but sequence has 1 elements pbxproj_partials.bzl #3092

louwers opened this issue Oct 22, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@louwers
Copy link
Contributor

louwers commented Oct 22, 2024

Description

After updating to rules_apple 3.9.2 I get the error below.

ERROR: /private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~~internal~rules_xcodeproj_generated/generator/platform/ios/xcodeproj/BUILD:12:10: Writing file external/rules_xcodeproj~~internal~rules_xcodeproj_generated/generator/platform/ios/xcodeproj/xcodeproj_pbxproj_partials/generated_folder_paths_file failed: 

/private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~/xcodeproj/internal/pbxproj_partials.bzl:534:40: Traceback (most recent call last):
        File "/private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~/xcodeproj/internal/pbxproj_partials.bzl", line 112, column 37, in _generated_folder
                return _generated_file_or_folder(
        File "/private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~/xcodeproj/internal/pbxproj_partials.bzl", line 82, column 24, in _generated_file_or_folder
                config = components[1]
Error: index out of range (index is 1, but sequence has 1 elements): 

/private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~/xcodeproj/internal/pbxproj_partials.bzl:534:40: Traceback (most recent call last):
        File "/private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~/xcodeproj/internal/pbxproj_partials.bzl", line 112, column 37, in _generated_folder
                return _generated_file_or_folder(
        File "/private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~/xcodeproj/internal/pbxproj_partials.bzl", line 82, column 24, in _generated_file_or_folder
                config = components[1]
Error: index out of range (index is 1, but sequence has 1 elements)
ERROR: /private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~~internal~rules_xcodeproj_generated/generator/platform/ios/xcodeproj/BUILD:12:10 Generating bazel-out/darwin_arm64-dbg/bin/external/rules_xcodeproj~~internal~rules_xcodeproj_generated/generator/platform/ios/xcodeproj/xcodeproj.project.pbxproj failed: 

/private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~/xcodeproj/internal/pbxproj_partials.bzl:534:40: Traceback (most recent call last):
        File "/private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~/xcodeproj/internal/pbxproj_partials.bzl", line 112, column 37, in _generated_folder
                return _generated_file_or_folder(
        File "/private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~/xcodeproj/internal/pbxproj_partials.bzl", line 82, column 24, in _generated_file_or_folder
                config = components[1]
Error: index out of range (index is 1, but sequence has 1 elements): 

/private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~/xcodeproj/internal/pbxproj_partials.bzl:534:40: Traceback (most recent call last):
        File "/private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~/xcodeproj/internal/pbxproj_partials.bzl", line 112, column 37, in _generated_folder
                return _generated_file_or_folder(
        File "/private/var/tmp/_bazel_bart/cebca26739145e4f0245c6428f550948/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj~/xcodeproj/internal/pbxproj_partials.bzl", line 82, column 24, in _generated_file_or_folder
                config = components[1]

Reproduction steps

git clone --recurse-submodules git@github.com:maplibre/maplibre-native.git
cd maplibre-native
# update rules_apple to 3.9.2 in MODULE.bazel
bazel run //platform/ios:xcodeproj --@rules_xcodeproj//xcodeproj:extra_common_flags="--//:renderer=metal"

Expected behavior

Xcode project is generated

rules_xcodeproj version

2.7.0

Xcode version

16

Bazel version

7.3.1

rules_apple version

3.9.2

rules_swift version

No response

Additional information

Krishna Ersson mentioned on Slack:

I also ran into this. For us, we weren’t able to generate a project when there was a data dependency on a custom rule that included a platform transition.
I’m not sure if it was due to the transition or something else we were doing in our custom rule, though. I didn’t dive deep into it yet.
My workaround was to use a bool_flag and config_setting that would get set to True when the rules_xcodeproj_generator config is active. Then I used a select to remove the data dependency so the Xcode project could be generated.

@brentleyjones
Copy link
Contributor

bazelbuild/rules_apple@91be02a is the offending change in rules_apple. I'm looking into a fix.

@brentleyjones
Copy link
Contributor

#3098 should fix this. Can you give it a try?

@louwers
Copy link
Contributor Author

louwers commented Oct 28, 2024

Fixed 🥳

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

2 participants