Skip to content

Fix the desktop clean-machine CI: asset patterns and the retired #7547 pins - #8026

Merged
danielhanchen merged 3 commits into
mainfrom
ci/desktop-clean-machine-assets
Aug 6, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
ci/desktop-clean-machine-assets

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

The nightly has been red on main since 2026-08-05, all six legs, for two unrelated reasons. Neither is a product regression.

macOS and Windows: the download patterns went stale

Both legs died at gh release download with no assets match the file pattern. The patterns were Tauri's default bundle names, and the release pipeline moved to its own scheme at desktop-v0.1.512-beta:

leg pattern last green release (desktop-v0.1.50-beta) current (desktop-v0.1.522-beta)
macOS *aarch64.dmg Unsloth.Studio.Desktop._0.1.50-beta_aarch64.dmg Unsloth-Desktop-0_1_522_beta-MacOS.dmg
Windows *setup.exe (no Windows asset yet) Unsloth-Desktop-0_1_522_beta-Windows.exe
Linux deb *.deb ...-Linux.deb ...-Ubuntu.deb
Linux AppImage *.AppImage ...-Ubuntu.AppImage ...-Linux.AppImage

The 2026-08-04 run was the last one to resolve a release built with the old names, which is exactly why it was the last green one. The two Linux patterns already matched on extension and kept working; the deb/AppImage OS labels swapped between the schemes, which a glob does not care about.

Matching on the extension drops the coupling to a naming scheme entirely. A release ships exactly one .dmg and one .exe, and the arm64 check further down the macOS leg is what actually verifies the architecture, so the aarch64 fragment was never load-bearing.

Linux: its own tripwire fired

The deb and AppImage legs got past the download and stopped on the guard they were built with:

::error::the bundled install.sh now carries #7547; delete this pin block and
let the venv + torch assertions below run unconditionally

That is the pin doing its job. It was added when the shipped bundle predated #7547, it detects _SMART_APT_OPTIONAL (Linux) and _check_macos_deps (macOS) as the marker that the shipped install.sh caught up, and it asks to be deleted at that point. The desktop-v0.1.522-beta bundle carries the fix, so both pins are retired here.

With them gone, all three platforms now hold the installer to the same bar Windows already did: exit 0, leave a venv at ~/.unsloth/studio/unsloth_studio/bin/python, and import torch. macOS no longer accepts exit 1 plus the Xcode CLT gate line, and Linux no longer accepts exit 2 plus the exact NEED_SUDO optional set.

Validation

Validated on a staging repo rather than by merging and waiting for the next nightly: the release assets are mirrored into the staging repo so the workflow resolves and downloads them the same way, and the job is dispatched there against the current bundle.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 473196df23

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +714 to +715
# are gone. This extra assertion is still Windows-only because the app reads the
# same default root it wrote there

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Require a ready disposition on macOS and Linux

When a post-#7547 bundle installs a working Python/torch environment but the desktop preflight regresses to NotInstalled, both POSIX jobs still pass: the app remains alive waiting on the Install screen, and their log checks accept any desktop_preflight completed disposition= value. Keeping the ready assertion Windows-only is not justified by the install root—the cross-platform preflight explicitly removes UNSLOTH_STUDIO_HOME and uses the legacy root (studio/src-tauri/src/preflight/managed.rs:317-320). Now that this commit removes the early pin exits, apply the same ready-disposition criterion to macOS and Linux so these jobs cannot go green without recognizing the environment they just built.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, and the source citation is the part that settles it. Fixed in 60a7061.

I checked preflight/managed.rs rather than taking it on trust:

// Tauri uses the legacy root regardless of UNSLOTH_STUDIO_HOME / STUDIO_HOME;
// probe subprocesses must follow the same isolation as process.rs.
cmd.env_remove("UNSLOTH_STUDIO_HOME");
cmd.env_remove("STUDIO_HOME");

Unconditional, not under a cfg(windows). So all three platforms read the same root and the install-root rationale for keeping the assertion Windows-only does not hold. Worse, I restated that rationale in this PR's own comment edit while it was already wrong.

The hole you describe is the real cost: a post-#7547 bundle can install a working venv and still have preflight regress to NotInstalled, and the app then sits on the Install screen -- alive, log written, disposition recorded, nothing it just built recognised. macOS and Linux accepted exactly that, and it matters more now that the installer step no longer stops short of the launch.

Both POSIX legs now collect every recorded disposition and require one of ManagedReady / OwnedReady / AttachedReady, matching Windows.

Checked this does not turn a green leg red before pushing -- all four staging legs record ManagedReady today:

desktop-linux-appimage    disposition=ManagedReady
desktop-linux-deb         disposition=ManagedReady
desktop-macos-macos-26    disposition=ManagedReady
desktop-windows           disposition=ManagedReady

So this tightens the bar without changing any current outcome, which is the right time to tighten it.

echo "::notice::known pre-#7547 outcome: the shipped bundle's install.sh stopped on the Xcode CLT gate and exited 1. Not a regression here; the next desktop release retires this pin."
exit 0
fi
[ "$rc" -eq 0 ] || {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the dispatch default when retiring the pins

When this workflow is manually dispatched without overriding release_tag, it still selects desktop-v0.1.50-beta at line 35. The removed pin documents that this bundle predates #7547 and therefore exits 1 at the macOS CLT gate (and 2 at the Linux optional-package handshake), so this new unconditional zero-exit requirement makes all four POSIX jobs fail for the workflow's default input. Clear the default so dispatches resolve the newest release, or advance it to a post-#7547 tag when retiring these expected outcomes.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Genuine. Fixed in 60a7061.

desktop-v0.1.50-beta is precisely the bundle the retired pins were written for, so with them gone a dispatch that took the default would fail all four POSIX legs at the installer step -- on a bundle nobody meant to test, and with an error that looks like a product regression.

Cleared the default rather than advancing it to a post-#7547 tag. Any pinned tag is an immutable fixture that goes stale the moment the next release is cut, and the workflow already documents that reasoning for the schedule:

Empty unless dispatched: a pinned tag is an immutable fixture, so a nightly against it could never catch a newly published broken bundle.

That argument does not stop being true for a manual dispatch. Empty falls through to the same newest-desktop-v* resolution, and release_tag is still there for anyone who wants to aim at a specific bundle deliberately.

@danielhanchen

Copy link
Copy Markdown
Member Author

Staging results

Validated on danielhanchen/unsloth-staging-2 with the desktop-v0.1.522-beta bundle assets mirrored into a draft prerelease there, so the workflow resolves and downloads them exactly as it does in production.

leg download bundled installer launch verdict
windows pass pass pass green
macOS macos-26 pass pass pass green
linux deb pass pass fail see below
linux appimage pass pass fail see below

Both fixes do what they were meant to. The downloads succeed on macOS and Windows, which were the two legs dying at no assets match the file pattern. The bundled installer step passes on all four, which is the evidence that retiring the #7547 pins was correct: with the pins gone that step demands exit 0, a venv and a torch import, and it gets all three.

What this exposes

The Linux legs now reach the launch step for the first time, and fail there. That step was unreachable before, because the pin failed the job several steps earlier.

This is not a CI configuration problem, so I have not touched the assertion. Launch and prove it stays up is the check the whole workflow exists to make.

macOS, working, relays the backend's output and stays up for the full 90 seconds:

13:09:02 [INFO] [backend] {"event": "request_completed", "path": "/api/inference/monitor", "status_code": 200}
13:09:11 [INFO] [backend] {"event": "request_completed", "path": "/api/health", "status_code": 200}
13:09:28 [INFO] Received Unix termination signal SIGTERM (15)

Linux, both bundle formats, stops dead on the same line and the process is gone about a second later:

13:00:12 [INFO] desktop_preflight completed disposition=ManagedReady port=None in 1197ms
13:00:12 [INFO] start_managed_server command called with port 8888
13:00:12 [INFO] Starting backend: ".../unsloth_studio/bin/unsloth" studio --api-only -H 127.0.0.1 -p 8888
13:00:12 [INFO] start_managed_server spawned generation=1 in 2ms
<end of log>

Not one [backend] line on either Linux leg. Preflight reaches ManagedReady, the spawn is reported successful, and then the app exits before any backend output is relayed. Same on .deb and .AppImage, so it is not a packaging-format artifact.

Why this should still merge

Before: six legs red, all six for reasons that had nothing to do with the shipped bundle.
After: four legs green, two legs red because the shipped Linux app does not stay up.

That is the workflow doing its job. Merging it turns a nightly that reports nothing into one that reports a real defect, and the Linux failure needs fixing in the desktop app rather than here.

The last commit is part of that: the early-exit branch runs under bash -e, so wait "$APP_PID" returning non-zero aborted the step on that line and neither the ::error:: annotation nor the tail of app-stdout.log ever printed. The whole failure showed up as a bare Process completed with exit code 1, which is why the evidence above had to be pulled out of the uploaded artifact by hand.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 60a7061b1b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…pins

The nightly has been red on main since 2026-08-05, all six legs, for two
unrelated reasons.

macOS and Windows died at the download with 'no assets match the file
pattern'. The patterns were Tauri's default bundle names, '*aarch64.dmg' and
'*setup.exe'. The release pipeline moved to its own scheme at
desktop-v0.1.512-beta, so the assets are now Unsloth-Desktop-<ver>-MacOS.dmg
and Unsloth-Desktop-<ver>-Windows.exe. The last green run, on 2026-08-04,
resolved desktop-v0.1.50-beta and downloaded
Unsloth.Studio.Desktop._0.1.50-beta_aarch64.dmg, which is the last release that
carried the old names. Matching on the extension instead removes the coupling
to a naming scheme; a release ships exactly one .dmg and one .exe, and the
arm64 assertion further down is what actually checks the architecture.

Linux died on its own tripwire, which fired exactly as designed:

  the bundled install.sh now carries #7547; delete this pin block and let the
  venv + torch assertions below run unconditionally

Both outcome pins are gone. macOS no longer accepts exit 1 plus the Xcode CLT
gate line, Linux no longer accepts exit 2 plus the NEED_SUDO optional set, and
all three legs now require the installer to exit 0, leave a venv and import
torch -- the assertion Windows already made.
The launch steps run under `bash -e`, so `wait "$APP_PID"` returning non-zero
aborted the step on that line and neither the ::error:: annotation nor the
tail of app-stdout.log ever printed. The failure surfaced as a bare 'Process
completed with exit code 1' with no annotation and no app output, which is
precisely the information the branch exists to produce.

Found while validating this PR on staging: with the download and pin fixes in
place the Linux legs reach the launch step for the first time, it fails, and
the log said nothing about why.
…h default

Two things the pin retirement left behind.

The dispatch default for release_tag was desktop-v0.1.50-beta, a bundle that
predates #7547. With the outcome pins gone a manual dispatch that took the
default would fail all four POSIX legs at the installer step, on a bundle
nobody meant to test. Empty instead, which falls through to the same
newest-desktop-v* resolution the schedule already uses.

The ready-disposition assertion was Windows-only, and the reason given for
that was the install root. The source says otherwise: preflight/managed.rs
env_removes UNSLOTH_STUDIO_HOME and STUDIO_HOME unconditionally, not under a
cfg(windows), with a comment saying Tauri uses the legacy root regardless. So
all three platforms read the same root and the asymmetry was unjustified.

It also mattered more once the pins went: a post-#7547 bundle can install a
working venv and still have preflight regress to NotInstalled, and the app
then sits on the Install screen -- alive, log written, a disposition recorded,
and nothing it just built recognised. macOS and Linux accepted that. All four
staging legs record ManagedReady today, so this tightens the bar without
moving any leg from green to red.
@danielhanchen
danielhanchen force-pushed the ci/desktop-clean-machine-assets branch from 60a7061 to f2386b6 Compare August 6, 2026 14:04
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

3 similar comments
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: f2386b67c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit c32f29f into main Aug 6, 2026
10 of 12 checks passed
@danielhanchen
danielhanchen deleted the ci/desktop-clean-machine-assets branch August 6, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant