yonaskolb / yonaskolb/XcodeGen

Custom configuration names rejected in settings.configs and scheme definitions

Open
#1,621 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
8.8k
Forks
908
Avg merge
17d 14h
Merged PRs (30d)
2

Description

When a project defines custom build configuration names (anything other than Debug or Release), XcodeGen rejects those names in two places:

  1. settings.configs keys in target definitions
  2. run.config, test.config, archive.config, profile.config values in scheme definitions

The validator appears to check against a hardcoded list of known configuration names rather than against the configurations actually defined in the project spec.

Reproduction

name: TestApp

configurations:
  Debug: debug
  Enterprise: release
  AppStore: release

targets:
  TestApp:
    type: application
    platform: iOS
    settings:
      configs:
        Enterprise:           # ← rejected: "invalid build configuration 'Enterprise'"
          SWIFT_VERSION: "5.0"

schemes:
  Enterprise:
    archive:
      config: Enterprise      # ← rejected: "Scheme has invalid build configuration 'Enterprise'"

Running xcodegen generate on this spec produces:

Spec validations errors:
  - Build setting has invalid build configuration "Enterprise"
  - Scheme "Enterprise" has invalid build configuration "Enterprise"

Expected Behaviour

Enterprise and AppStore are defined in the configurations: section of the spec. The validator should accept any configuration name declared there, not just Debug and Release.

Actual Behaviour

Any configuration name other than Debug or Release is rejected in settings.configs and scheme config fields, even when explicitly defined in the project spec.

Workaround

For build settings, there is a partial workaround using conditional key syntax in settings.base:

settings:
  base:
    "SWIFT_VERSION[config=Enterprise]": "5.0"

There is no equivalent workaround for scheme definitions. Schemes that reference custom configuration names cannot be expressed in project.yml at all, requiring scheme files to be managed outside the spec.

Versions Affected

Confirmed present in: 2.15.0, 2.20.0, 2.25.0, 2.30.0, 2.35.0, 2.38.0, 2.40.0, 2.42.0, 2.43.0, 2.45.4

This appears to have been present since at least v2.15.0 and has never been reported.

Impact

Projects that follow the common iOS pattern of having more than two build configurations (e.g. Debug, Enterprise, AppStore, DeveloperID) cannot define schemes in project.yml. This makes full XcodeGen adoption impractical for these projects without workarounds.

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

Run the supplied YAML reproduction with xcodegen generate, then trace validation for settings.configs and the scheme run.config, test.config, archive.config, and profile.config fields. Done means names declared under configurations: are accepted in both locations, including Enterprise and AppStore, while undeclared names remain rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.