tuist icon indicating copy to clipboard operation
tuist copied to clipboard

Extracted xcconfig files from `tuist migration settings-to-xcconfig` use invalid configuration

Open KaiOelfke opened this issue 2 years ago • 3 comments

What happened?

The extraction doesn’t work as intended for settings varied by configurations such as debug. As explained in https://pewpewthespells.com/blog/xcconfig_guide.html in section “Config” things like ONLY_ACTIVE_ARCH[config=Debug] = YES become ONLY_ACTIVE_ARCH[config=Debug][sdk=*][arch=*] = YES and this can lead to issues. E.g. according to Xcode this build setting doesn’t allow further configuration by sdk or architecture.

It should be possible to fix this by variable substitution or generating debug and release xcconfigs.

E.g. this works:

ONLY_ACTIVE_ARCH_DEBUG=YES
ONLY_ACTIVE_ARCH_RELEASE=NO
ONLY_ACTIVE_ARCH=$(ONLY_ACTIVE_ARCH_$(CONFIGURATION))

Sample project is attached.

TuistMigrationSample.zip

How do we reproduce it?

  1. Create a new standard Xcode project
  2. Make sure ONLY_ACTIVE_ARCH (Build Active Architecture Only in Xcode UI) is yes for debug and no for release
  3. Use tuist migration settings-to-xcconfig to extract xcconfig
  4. Add generated xcconfig to project
  5. See that the setting doesn't match exactly and that Xcode say it's invalid as it's further varied and not just by configuration

Error log

Bildschirmfoto 2024-03-17 um 11 13 01

macOS version

14.3.1 (23D60)

Tuist version

4.6.0

Xcode version

15.3.0

KaiOelfke avatar Mar 17 '24 03:03 KaiOelfke

Thanks a lot for reporting this one @KaiOelfke 🙏🏼

pepicrft avatar Mar 31 '24 02:03 pepicrft