fix: Omit -configuration when none is provided#460
Open
hujunfeng wants to merge 1 commit into
Open
Conversation
Build, test, and app-path tools always injected `-configuration Debug`, which overrode the scheme's Run action configuration and produced the wrong build settings (including bundle identifier) for schemes that use a non-Debug configuration. When no configuration argument or session default is set, `-configuration` is now omitted so xcodebuild honors the scheme's configuration. Configuration is optional in the shared build/test params and only passed through to xcodebuild when provided. Fixes getsentry#443 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cameroncooke
approved these changes
Jul 6, 2026
cameroncooke
left a comment
Collaborator
There was a problem hiding this comment.
@hujunfeng looks good thanks for the PR!
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Build, test, app-path, and
cleantools always injected-configuration Debuginto thexcodebuildinvocation when no configuration was supplied. This overrode the scheme's Run-action build configuration, producing the wrong build settings (including bundle identifier) for schemes that use a non-Debugconfiguration such asDebug-dev. This PR omits-configurationwhen it is not set, soxcodebuildhonors the scheme's configuration.Fixes #443
Background
xcodebuild -scheme X <action>run on its own resolves the configuration from the scheme's per-action Build Configuration (e.g. the Run action,Debugby default but customizable toDebug-dev). By always passing-configuration Debug, XcodeBuildMCP forced resolution againstDebug.xcconfiginstead of the scheme's actual configuration.Root cause was three layers:
SharedBuildParams.configurationwas a requiredstring.build-utils.ts(command.push('-configuration', params.configuration)) andapp-path-resolver.ts(... ?? 'Debug').params.configuration ?? 'Debug'before reaching those chokepoints.Solution
configurationoptional in the shared types:SharedBuildParams,SharedTestExecutorParams,TestPreflightResult(and its resolver param), plus the per-toolPrepared*Executioninterfaces.-configurationonly when a value is set.?? 'Debug'fallback from all 13 build/test/app-path/clean tools soundefinedflows through.cleanomitsconfigurationfrom its displayed artifact when unset. Build/test/app-path display paths already guard on presence, so no strayConfiguration:line orconfiguration: undefinedrenders.Behavior after this change:
configurationargument and no session default ->-configurationis omitted;xcodebuilduses the scheme's configuration.configurationargument or session default -> passed through exactly as before.-showBuildSettings(used by the app-path resolver, with no action) defaults to thebuildaction, so it resolves the same configuration as the build step. Omitting-configurationkeeps build and get-app-path consistent and also fixes the prior latent case where get-app-path forced Debug while a scheme-honoring build could produce a different configuration.Testing
npm test— all 2667 unit tests pass. Added chokepoint tests inbuild-utils.test.tsandapp-path-resolver.test.ts(assert the flag is omitted when unset and present with the right value when set); updated the no-configuration command-generation assertions across the tool tests to expect no-configuration.npm run typecheck— clean (src, tests, benchmarks).npm run lintandnpm run format:check— clean.npm run build— succeeds.Notes
-configuration Debug/Configuration: Debug, so the snapshot CI job will be red until they are regenerated withnpm run test:snapshot:update. Left for the maintainer per repo conventions on not hand-editing fixtures.CHANGELOGentry is included; left for the maintainer.get_*_app_pathnext-step params do not thread an explicitly-providedconfiguration. Not a regression (the old code forced Debug there too) and unaffected when configuration comes from a session default.🤖 Generated with Claude Code