MobileNativeFoundation / MobileNativeFoundation/rules_xcodeproj

Unable to override flags from templated `xcodeproj.bazelrc`

Open
#3,262 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Not sure if this is intended, don't think it is because otherwise there doesn't seem to be a way to override this without modifying the template directly.

For example, if we want to set common:rules_xcodeproj --remote_download_outputs=all it doesn't seem like the way the .bazelrc files/flags are loaded allows for this to override the templated common:rules_xcodeproj --remote_download_outputs=toplevel

The issue seems to be in the way the template loads and sets the private _rules_xcodeproj_build config:

...

common:_rules_xcodeproj_build --config=rules_xcodeproj

### Project specific configs
%project_configs%
# Import `xcodeproj.bazelrc` if it exists
try-import %workspace%/xcodeproj.bazelrc

Anything set in xcodeproj.bazelrc or .bazelrc would make it into rules_xcodeproj config but not _rules_xcodeproj_build

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 in xcodeproj/internal/templates/xcodeproj.bazelrc around lines 128-139 and trace how _rules_xcodeproj_build, rules_xcodeproj, project configs, and the imported workspace xcodeproj.bazelrc are loaded. Reproduce the ordering with common:rules_xcodeproj and --remote_download_outputs settings. Done means a project-level configuration can override the templated value without editing the template.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.