MobileNativeFoundation / MobileNativeFoundation/rules_xcodeproj

Bug: CLI API for indexbuild doesn't pick up flags

Open
#3,087 0 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

When using CLI API to build with indexbuild config, the flags for indexbuild defined in .bazelrc with build:rules_xcodeproj_indexbuild are not applied as expected.

Reproduction steps
  1. Apply the following diff
diff --git a/examples/integration/.bazelrc b/examples/integration/.bazelrc
index 45aa71ea..29a8135b 100644
--- a/examples/integration/.bazelrc
+++ b/examples/integration/.bazelrc
@@ -11,6 +11,7 @@ build:rules_xcodeproj --@rules_xcodeproj//xcodeproj:extra_indexbuild_flags='--no
 build:rules_xcodeproj --@rules_xcodeproj//xcodeproj:extra_swiftuipreviews_flags='--noverbose_failures'
 
 build:rules_xcodeproj_integration --define=foo=bar
+build:rules_xcodeproj_indexbuild --define=foo=foo
 
 # Required for sharing cache between Intel and Apple silicon
 build:rules_xcodeproj --@build_bazel_rules_swift//swift:universal_tools
  1. cd examples/integration; bazelisk run //:xcodeproj-incremental-bazel-sim_arm64
  2. bazelisk run //:xcodeproj-incremental-bazel-sim_arm64 -- --config=indexbuild --generator_output_groups=all_targets "build --announce_rc"
  3. Inspect the log
Expected behavior

--define=foo=foo is in the log and applied to build

Actual behavior
INFO: Found applicable config definition build:rules_xcodeproj_integration in file /Users/ycho/Dev/rules_xcodeproj/examples/integration/.bazelrc: --define=foo=bar

rules_xcodeproj version

44b6f046d95b84933c1149fbf7f9d81fd4e32020

Xcode version

15.0

Bazel version

7.1.1

rules_apple version

No response

rules_swift version

No response

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 by reproducing the two bazelisk commands from examples/integration and inspect the related entries in examples/integration/.bazelrc, especially the build:rules_xcodeproj_integration and build:rules_xcodeproj_indexbuild configs. Trace how the CLI API selects the indexbuild configuration; done means the indexbuild --define=foo=foo flag appears in the log and is applied to the build.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, cli
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.