-
Notifications
You must be signed in to change notification settings - Fork 61
Use xcworkspace instead of xcodeproj if path is xcworkpace #384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
We tried this based on the Bitrise support team's recommendation. While it successfully resolves packages and correctly uses the -scheme flag with the .xcworkspace, it fails when handling nested schemes. For example, our project includes schemes like Notification and App Extension, but when resolving build settings for these child schemes, it continues to use the parent app scheme's name. This results in a certificate mismatch. |
Thank you for the feedback, i will try to handle this case |
7a291bf
to
8ac649b
Compare
Add parameter to not overwrite buildsettings
Can you test again @sarthak-mishra-swiggy ? 🙏 I need your opinions about this PR, what do you think about the context and the answer ? Technically it could probably be improved, but i need to know if you agree with the original problem |
It worked! Appreciate you quickly fixing this! |
#370 It has already been reported here. So the issue is surely pretty relevant. |
Nice ! Can you share the step time ? One with the "official" step, and the other with this PR 🙏 |
Umm didn't notice a difference in the step time, are we expecting some time based gains with this PR as well? |
On our project, we are gaining 35% of build time |
@lpusok Any updates on this? Our cache is massively bloated due to this... |
Checklist
step.yml
andREADME.md
is updated with the changes (if needed)Version
Requires a PATCH version update
Context
Fix multiple workspace project handling issues where:
-project
instead of-workspace
for workspace-based projects, causing build latency due to different build cache usageWith the official step :

With our fork :

Tested with NotificationService extensions ✅
Changes
Core Architecture
-workspace
and-scheme
commands when workspace is present-project
and-workspace
commandsBuild Settings Parser
overwrite
parameter toparseBuildSettings()
andRunAndReturnSettings()
overwrite=false
in all calls to preserve first target in scheme build targets listEntitlements Handling
Code Signing Logic
--verbose
)Investigation details
Build Cache Issue
Root cause of massive build latency: When working with
.xcworkspace
files, using-project
commands instead of-workspace
commands causes Xcode to use different build caches. This results in:-project
and-workspace
builds as separate build contexts-project
Solution: Enforce
-workspace
and-scheme
commands consistently when a workspace is present.Build Settings Overwriting Issue
The main issue was in
parseBuildSettings()
where duplicate keys were being overwritten. In multi-target schemes,xcodebuild -showBuildSettings
outputs settings for all targets sequentially:The parser was keeping the last occurrence (last target in scheme build targets list), but we need the first occurrence (first target in scheme build targets list) for correct bundle ID resolution.
Current implementation: Added
overwrite
parameter and setoverwrite=false
in all calls to keep first target in scheme build targets list instead of last target, fixing the issue.Overwrite Parameter Debate
Current approach: Added
overwrite
parameter and changed behavior by settingoverwrite=false
everywhereQuestion: Should we remove this parameter and always use
overwrite=false
?Arguments for removing the parameter:
Arguments for keeping the parameter:
overwrite=true
)Need feedback on this design decision 🤔
Next Steps
go-xcode Library Update: Once we have feedback on the
overwrite
parameter strategy, I will update the upstreamgo-xcode
library with the final implementation:go-xcode
withoverwrite=false
hardcodedgo-xcode
with the flexible parameter approachThis ensures consistency between the step implementation and the underlying library.
Decisions
-project
commandsoverwrite
parameter for safety (open to removing it)Testing
✅ NotificationService extensions: Confirmed working with proper provisioning profiles
✅ Multi-target schemes: Bundle ID resolution works correctly
✅ Fallback scenarios: Secondary targets handled gracefully when scheme commands fail