Drive local builds through tuist xcodebuild - #98
Merged
Merged
Conversation
`tuist build` is deprecated in favor of the `tuist xcodebuild` wrapper, so `make build`/`make run` printed a deprecation warning on every invocation. `tuist xcodebuild` is a thin wrapper around xcodebuild and does not generate the project, so `build` and `test` now depend on `generate` — which `tuist build` used to do implicitly, and which `test` never did at all. Derived data is pinned to `.build/DerivedData` (already gitignored) so `run` can point at the built app directly instead of globbing Xcode's hashed DerivedData directory, which silently picks an arbitrary match when more than one exists. `test` moves to `tuist xcodebuild test` for the same reason, and drops the `| xcpretty` pipe: tuist already formats the output, and the pipe swallowed xcodebuild's exit code so failing tests could not fail the target. CI is untouched; it calls xcodebuild directly with signing disabled.
There was a problem hiding this comment.
The targets preserve the existing workspace, scheme, and configuration contract, while the pinned DerivedData path correctly matches the app product location. The documentation accurately records the rationale, and no correctness or regression issues are evident.
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.
Problem
tuist build Allkdic(used bymake build/make run) now prints a deprecation warning under Tuist 4.200.5 —tuist xcodebuildis the supported replacement.Fixing that surfaced two more issues:
tuist xcodebuildis a thinxcodebuildwrapper and does not generate the project first, unliketuist build.make testnever generated the project either, so it failed outright on a fresh clone.make runlocated the built app by globbing~/Library/Developer/Xcode/DerivedData/Allkdic-*/..., which silently picks an arbitrary match when more than one hashed directory exists.make testpipedxcodebuild test | xcprettywithoutset -o pipefail, so the target's exit code was xcpretty's, not xcodebuild's — a failing test suite could not failmake test.Solution
tuist build Allkdicwithtuist xcodebuild buildinbuild/run, andxcodebuild test | xcprettywithtuist xcodebuild test(Tuist already formats the output).generateas a prerequisite ofbuildandtest, restoring the implicit generate thattuist buildused to provide and adding it totestfor the first time.XCODEBUILD_FLAGSand pinDERIVED_DATAto.build/DerivedData(already gitignored), sorunreads the app from a known path instead of globbing Xcode's DerivedData.lint-cito.PHONY.tuist buildis deprecated and must not come back.CI (
ci.yml,release.yml) is untouched — it callsxcodebuilddirectly with signing disabled and doesn't go through the Makefile.Testing
make buildandmake testhit the same code-signing gate locally thattuist buildalready hit before this change (no "Mac Development" cert on this machine) — this is pre-existing behavior, not a regression. With signing disabled via a command-lineXCODEBUILD_FLAGSoverride:make buildsucceeds and the binary lands exactly at the pinnedDERIVED_DATApath.make testruns the suite green — 45 tests, 0 failures.Summary by cubic
Replaces the deprecated
tuist buildwithtuist xcodebuildfor localmake build,make run, andmake test, and makes those targets more reliable.buildandtestnow depend ongeneratebecausetuist xcodebuilddoes not generate the project first (testnever did)..build/DerivedDatasorunreads from a known path instead of globbing Xcode's hashed DerivedData, which can silently match the wrong directory.testdrops the| xcprettypipe (which swallowed xcodebuild's exit code), so a failing suite now failsmake test.lint-cito.PHONYand updates the AGENTS.md build-system table.Written for commit f2c6f56. Summary will update on new commits.