tuist icon indicating copy to clipboard operation
tuist copied to clipboard

Inspect build improvements for CI

Open kelvinharron opened this issue 8 months ago • 1 comments

Why is this needed?

(Documenting a previous discussion on Slack)

I was attempting to record the build times of Xcode Cloud so I could understand the difference in the intel runners compared to our local Apple silicon machines. Xcode Cloud does not enable you to invoke the xcodebuild cli.

I attempted to invoke tuist inspect build through the post build script on Xcode Cloud, recognising the insights need for .xcactivitylog.

Steps to reproduce:

  • Active Xcode Cloud project.
  • Create a ci_post_xcodebuild.sh script.
  • Include the following invocation: ~/.local/bin/mise x -- tuist inspect build --path "$CI_PRIMARY_REPOSITORY_PATH"

Result:

2025-04-22T15:50:49.779385904Z	Uploading run metadata...
2025-04-22T15:50:50.047258236Z	You can view a detailed run report at: https://tuist.dev/eso/ehr/runs/1040286
2025-04-22T15:50:50.047414205Z	▌ ✖ Error 
2025-04-22T15:50:50.047618794Z	▌ No build logs for project EHR found at /Users/local/Library/Developer/Xcode/DerivedData/EHR-dqoshwaieoyrdwabjciharqwtjdh/Logs/Build. 
2025-04-22T15:50:50.047648139Z	▌
2025-04-22T15:50:50.048360692Z	▌ Sorry this didn’t work. Here’s what to try next: 
2025-04-22T15:50:50.048409572Z	▌  ▸ If the error is actionable, address it
2025-04-22T15:50:50.048610230Z	▌  ▸ If the error is not actionable, let's discuss it in the <Troubleshooting & how to: https://community.tuist.dev/c/troubleshooting-how-to/6>
2025-04-22T15:50:50.048628379Z	▌  ▸ If you are very certain it's a bug, <file an issue: https://github.com/tuist/tuist>
2025-04-22T15:50:50.048733728Z	▌  ▸ Check out the logs at /Users/local/.local/state/tuist/logs/85DEE3AA-AD34-4D6B-BF24-7754013EB88A.log

References:

Xcode Cloud Custom build scripts Xcode Cloud Environment variables reference

Steps to address the need

The suggestion from Marek was to expose some convenience of the following through Tuist so we get an improved out of the box experience for Xcode Cloud users:

Well, what's important is whether the .xcactivitylog lives in the derived data in the post build action. But in the end, that's not where you want to run it, so what might be better is if you set up a custom post scheme action with the following: TUIST_INSPECT_BUILD_WAIT="YES" tuist inspect build

kelvinharron avatar Apr 30 '25 14:04 kelvinharron

@fortmarek I'm afraid I never got around to trying this before I was off boarded on this project. Once I do get access again I will give it a go.

kelvinharron avatar Apr 30 '25 14:04 kelvinharron