MobileNativeFoundation / MobileNativeFoundation/rules_xcodeproj

Bug: Missing clangs arg count

Open
#2,881 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Swift
Stars
626
Forks
124
PR merge metrics
No merged PRs in 30d

Description

Description

A user reported an issue where they were on one commit using Xcode 15.1 where things were working correctly. They switched to a commit which uses Xcode 15.0.1 and run into generation errors during project generation:

Generating ".cashcli/Projects/CashApp.xcodeproj"
Starting local Bazel server and connecting to it...
INFO: Invocation ID: fda96df3-b7f4-47d2-96c0-3eeca4eae007
INFO: Analyzed target @rules_xcodeproj~1.15.0~internal~rules_xcodeproj_generated//generator/.cashcli/Projects/CashApp:CashApp (799 packages loaded, 53174 targets configured).
INFO: Found 1 target...
ERROR: Code/SystemResources/AppDependencies/BUILD.bazel:12:15: Generating bazel-out/ios-arm64-min14.0-applebin_ios-ios_arm64-dbg-ST-1085b1e95571/bin/Code/SystemResources/AppDependencies/AppDependencies.rules_xcodeproj.build_settings failed: (Exit 1): universal_target_build_settings failed: error executing command (from target //Code/SystemResources/AppDependencies:AppDependencies) 
  (cd /private/var/tmp/_bazel_<bradfol>/907fcb5025b8b52c1255ae7b70e7bf3a/rules_xcodeproj.noindex/build_output_base/execroot/_main && \
  exec env - \
  bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-477482371507/bin/external/rules_xcodeproj~1.15.0/tools/generators/target_build_settings/universal_target_build_settings 1 bazel-out/ios-arm64-min14.0-applebin_ios-ios_arm64-dbg-ST-1085b1e95571/bin/Code/SystemResources/AppDependencies/AppDependencies.rules_xcodeproj.build_settings bazel-out/ios-arm64-min14.0-applebin_ios-ios_arm64-dbg-ST-1085b1e95571/bin/Code/SystemResources/AppDependencies/AppDependencies.rules_xcodeproj.debug_settings 0 1 bazel-out/ios-arm64-min14.0-applebin_ios-ios_arm64-dbg-ST-1085b1e95571/bin/Code/SystemResources/AppDependencies/AppDependencies_swift.rules_xcodeproj.debug_settings '' 0 0 '' '' 0 '' '' '' 0 '' '' bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-477482371507/bin/external/rules_swift~1.13.0/tools/worker/worker swiftc @bazel-out/ios-arm64-min14.0-applebin_ios-ios_arm64-dbg-ST-1085b1e95571/bin/Code/SystemResources/AppDependencies/AppDependencies.rules_xcodeproj.build_settings-0.params --- ---)
# Configuration: ba4f66d6c1caab0757ed204ea2949fcf8a4e0a53735846a4b89f2b6948d9fb93
# Execution platform: @local_config_platform//:host
ERROR: Internal precondition failure:
tools/generators/lib/PBXProj/src/TargetSwiftDebugSettings.swift:34: "/private/var/tmp/_bazel_<user>/907fcb5025b8b52c1255ae7b70e7bf3a/rules_xcodeproj.noindex/build_output_base/execroot/_main/bazel-out/ios-arm64-min14.0-applebin_ios-ios_arm64-dbg-ST-1085b1e95571/bin/Code/SystemResources/AppDependencies/AppDependencies_swift.rules_xcodeproj.debug_settings": Missing clang args count
Please file a bug report at https://github.com/MobileNativeFoundation/rules_xcodeproj/issues/new?template=bug.md
ERROR: Code/SystemResources/AppDependencies/BUILD.bazel:12:15: Generating bazel-out/ios-sim_arm64-min14.0-applebin_ios-ios_sim_arm64-dbg-ST-7229f8b34da9/bin/Code/SystemResources/AppDependencies/AppDependencies.rules_xcodeproj.build_settings failed: (Exit 1): universal_target_build_settings failed: error executing command (from target //Code/SystemResources/AppDependencies:AppDependencies) 
  (cd /private/var/tmp/_bazel_<user>/907fcb5025b8b52c1255ae7b70e7bf3a/rules_xcodeproj.noindex/build_output_base/execroot/_main && \
  exec env - \
  bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-477482371507/bin/external/rules_xcodeproj~1.15.0/tools/generators/target_build_settings/universal_target_build_settings 1 bazel-out/ios-sim_arm64-min14.0-applebin_ios-ios_sim_arm64-dbg-ST-7229f8b34da9/bin/Code/SystemResources/AppDependencies/AppDependencies.rules_xcodeproj.build_settings bazel-out/ios-sim_arm64-min14.0-applebin_ios-ios_sim_arm64-dbg-ST-7229f8b34da9/bin/Code/SystemResources/AppDependencies/AppDependencies.rules_xcodeproj.debug_settings 0 1 bazel-out/ios-sim_arm64-min14.0-applebin_ios-ios_sim_arm64-dbg-ST-7229f8b34da9/bin/Code/SystemResources/AppDependencies/AppDependencies_swift.rules_xcodeproj.debug_settings '' 0 0 '' '' 0 '' '' '' 0 '' '' bazel-out/darwin_arm64-opt-exec-2B5CBBC6-ST-477482371507/bin/external/rules_swift~1.13.0/tools/worker/worker swiftc @bazel-out/ios-sim_arm64-min14.0-applebin_ios-ios_sim_arm64-dbg-ST-7229f8b34da9/bin/Code/SystemResources/AppDependencies/AppDependencies.rules_xcodeproj.build_settings-0.params --- ---)
# Configuration: 79e7d91f01934ef122458860281ec7fd9d20f8f620a5175739a049a2c36d03cb
# Execution platform: @local_config_platform//:host
ERROR: Internal precondition failure:
tools/generators/lib/PBXProj/src/TargetSwiftDebugSettings.swift:34: "/private/var/tmp/_bazel_<user>/907fcb5025b8b52c1255ae7b70e7bf3a/rules_xcodeproj.noindex/build_output_base/execroot/_main/bazel-out/ios-sim_arm64-min14.0-applebin_ios-ios_sim_arm64-dbg-ST-7229f8b34da9/bin/Code/SystemResources/AppDependencies/AppDependencies_swift.rules_xcodeproj.debug_settings": Missing clang args count
Please file a bug report at https://github.com/MobileNativeFoundation/rules_xcodeproj/issues/new?template=bug.md
INFO: Elapsed time: 38.273s, Critical Path: 0.15s
INFO: 121 processes: 47 disk cache hit, 73 internal, 1 local.
FAILED: Build did NOT complete successfully
ERROR: Build failed. Not running target
Reproduction steps

From what what was reported to me:

  • Switch from Xcode 15.1 to Xcode 15.0.1 different commits after having generated with 15.1
Expected behavior

The project generates correctly

rules_xcodeproj version

1.15.0

Xcode version

15.1 -> 15.0.1

Bazel version

6.4.0

rules_apple version

3.1.1

rules_swift version

1.13.0

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at tools/generators/lib/PBXProj/src/TargetSwiftDebugSettings.swift:34 and inspect the generated .rules_xcodeproj.debug_settings input from universal_target_build_settings. Reproduce the failure by switching from Xcode 15.1 to 15.0.1 with rules_xcodeproj 1.15.0, Bazel 6.4.0, rules_apple 3.1.1, and rules_swift 1.13.0. Done means project generation succeeds without the missing clang args count error.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.