bitrise-steplib / steps-xcode-archive

Xcode Archive for iOS step
MIT License
68 stars 56 forks source link

Xcodebuild configuration flag not retained when using additional build options #314

Closed smmcdonald closed 6 months ago

smmcdonald commented 1 year ago

Troubleshooting

Useful information

Issue description

When using the 'Additional options for the xcodebuild command', the xcodebuild 'configuration' flag is not preserved in the final export. For example: let's say the Xcode project has 3 configurations; DEV, QA, and PROD. The workflow is set to archive and export the 'QA' configuration. When using additional flags with xcodebuild, such as this invocation taken from the build logs:

set -o pipefail && xcodebuild "clean" "archive" "-workspace" "/Users/[REDACTED]/git/MyProject.xcworkspace" "-scheme" "My Scheme" "-configuration" "QA" "-xcconfig" "/var/folders/xq/sfn_fz953jb36ptp2g68wc2r0000gn/T/743339323/temp.xcconfig" "-archivePath" "/var/folders/xq/sfn_fz953jb36ptp2g68wc2r0000gn/T/xcodeArchive1900358368/My_Project.xcarchive" "-destination" "generic/platform=iOS" "-resultBundlePath" "/Users/[REDACTED]/deploy/MyProject.xcresult" "OTHER_SWIFT_FLAGS=-Xfrontend -debug-time-function-bodies -Xfrontend -debug-time-expression-type-checking" "OTHER_LINKER_FLAGS=-Xlinker -print_statistics" | xcpretty

the final exported .ipa file will be using the default 'DEV' configuration. I was able to identify and work around this issue by adding a second 'Xcode Archive & Export for iOS' workflow step (after the first one with additional parameters) that is exactly the same with the exception of leaving the 'Additional options for the xcodebuild command' section empty. The build now works as expected and is using the 'QA' configuration.

Bitrise info

 set -o pipefail && xcodebuild "clean" "archive" "-workspace" "/Users/[REDACTED]/git/MyProject.xcworkspace" "-scheme" "My Project" "-configuration" "QA" "-xcconfig" "/var/folders/xq/sfn_fz953jb36ptp2g68wc2r0000gn/T/743339323/temp.xcconfig" "-archivePath" "/var/folders/xq/sfn_fz953jb36ptp2g68wc2r0000gn/T/xcodeArchive1900358368/My_Project.xcarchive" "-destination" "generic/platform=iOS" "-resultBundlePath" "/Users/[REDACTED]/deploy/MyProject.xcresult" "OTHER_SWIFT_FLAGS=-Xfrontend -debug-time-function-bodies -Xfrontend -debug-time-expression-type-checking" "OTHER_LINKER_FLAGS=-Xlinker -print_statistics" | xcpretty
  

Steps to reproduce

  1. Create an Xcode project with multiple build configurations, i.e. DEV, QA, PROD.
  2. Create and run a workflow that has additional xcodebuild_options, i.e. -resultBundlePath "/Users/[REDACTED]/deploy/MyProject.xcresult" "OTHER_SWIFT_FLAGS=-Xfrontend -debug-time-function-bodies -Xfrontend -debug-time-expression-type-checking" "OTHER_LINKER_FLAGS=-Xlinker -print_statistics"
bitrise-coresteps-bot commented 1 year ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

smmcdonald commented 1 year ago

PLEASE INVESTIGATE AS SOON AS POSSIBLE!

This is still important to us. This issue is now blocking production releases that use Firebase App Check as the token needs to be passed to the xcodebuild command as stated in the documentation:

xcodebuild test -scheme YourTestScheme -workspace YourProject.xcworkspace \ APP_CHECK_DEBUG_TOKEN=$(APP_CHECK_DEBUG_TOKEN_FROM_CI)

bitrise-coresteps-bot commented 1 year ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

smmcdonald commented 1 year ago

Bump.

bitrise-coresteps-bot commented 10 months ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

smmcdonald commented 10 months ago

still important to me

bitrise-coresteps-bot commented 7 months ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

bitrise-coresteps-bot commented 6 months ago

I'll close this issue as it doesn't seem to be relevant anymore. We believe an old issue probably has a bunch of context that's no longer relevant, therefore, if the problem still persists, please open a new issue.