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: Error: 'struct' value has no field or method 'inputs' with xcodeproj <- ios_unit_test <- swift_library <- mixed_language_library #3103

Open
vakhidbetrakhmadov opened this issue Nov 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@vakhidbetrakhmadov
Copy link

vakhidbetrakhmadov commented Nov 4, 2024

Description

Hi,

I have the following setup: xcodeproj <- ios_unit_test <- swift_library <- mixed_language_library.

When i try to generate Xcode project i get the following error:

$ make proj
...
Generating "Sources.xcodeproj"
ERROR: /Users/vakhid.betrakhmadov/Downloads/xcodeproj_repro/BUILD:6:23: in @@rules_xcodeproj_generated//generator/SourcesXcodeproj:defs.bzl%_aspect aspect on mixed_language_library rule //:Sources: 
Traceback (most recent call last):
        File "/private/var/tmp/_bazel_vakhid.betrakhmadov/ab443e025f65f734bd19129783791644/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj/xcodeproj/internal/xcodeproj_incremental_aspect.bzl", line 110, column 47, in _xcodeproj_incremental_aspect_impl
                info = incremental_xcodeprojinfos.make(
        File "/private/var/tmp/_bazel_vakhid.betrakhmadov/ab443e025f65f734bd19129783791644/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj/xcodeproj/internal/incremental_xcodeprojinfos.bzl", line 807, column 61, in _make_xcodeprojinfo
                info_fields = _make_non_skipped_target_xcodeprojinfo(
        File "/private/var/tmp/_bazel_vakhid.betrakhmadov/ab443e025f65f734bd19129783791644/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj/xcodeproj/internal/incremental_xcodeprojinfos.bzl", line 577, column 51, in _make_non_skipped_target_xcodeprojinfo
                ) = mixed_language_library_targets.process(
        File "/private/var/tmp/_bazel_vakhid.betrakhmadov/ab443e025f65f734bd19129783791644/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj/xcodeproj/internal/processed_targets/mixed_language_library_targets.bzl", line 106, column 77, in _process_mixed_language_library_target
                mergeable_info_and_ids = mergeable_infos_module.calculate_mixed_language(
        File "/private/var/tmp/_bazel_vakhid.betrakhmadov/ab443e025f65f734bd19129783791644/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj/xcodeproj/internal/processed_targets/mergeable_infos.bzl", line 123, column 50, in _calculate_mixed_language_mergeable_info
                return _handle_mixed_language_mergeable_infos(
        File "/private/var/tmp/_bazel_vakhid.betrakhmadov/ab443e025f65f734bd19129783791644/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj/xcodeproj/internal/processed_targets/mergeable_infos.bzl", line 161, column 37, in _handle_mixed_language_mergeable_infos
                return _swift_mergeable_info(
        File "/private/var/tmp/_bazel_vakhid.betrakhmadov/ab443e025f65f734bd19129783791644/rules_xcodeproj.noindex/build_output_base/external/rules_xcodeproj/xcodeproj/internal/processed_targets/mergeable_infos.bzl", line 266, column 46, in _swift_mergeable_info
                extra_file_paths = mergeable_info.inputs.extra_file_paths,
Error: 'struct' value has no field or method 'inputs'

Reproduction steps

I have created a minimal repro: https://github.com/vakhidbetrakhmadov/xcodeproj_repro/tree/main
Run: make proj

Expected behavior

Xcode project is successfully generated

rules_xcodeproj version

2.8.1

Xcode version

15.4.0 (15F31d)

Bazel version

7.4.0

rules_apple version

3.11.2

rules_swift version

2.2.2

Additional information

If i replace mixed_language_library with

swift_library(
    name = "Sources",
    srcs = [
        "Sources/Dummy.swift",
    ],
)

it works as expected.

@vakhidbetrakhmadov vakhidbetrakhmadov added the bug Something isn't working label Nov 4, 2024
@brentleyjones brentleyjones self-assigned this Nov 4, 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

2 participants