Skip to content

fix(installer): roll back incomplete activation - #15

Merged
juju-w merged 1 commit into
mainfrom
fix/source-preview-activation-rollback
Aug 18, 2026
Merged

juju-w merged 1 commit into
mainfrom
fix/source-preview-activation-rollback

Conversation

@juju-w

@juju-w juju-w commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • stage the local Runtime lock before changing the active Runtime
  • restore the previous Runtime if directory or lock activation fails
  • reject a directory at the lock path before building

Validation

  • shell syntax under sh, bash, and zsh
  • Source Preview installer contract
  • swift test --parallel (214 tests, 33 suites)

@juju-w
juju-w marked this pull request as ready for review August 18, 2026 07:36
@juju-w
juju-w merged commit 02e3ee2 into main Aug 18, 2026
1 check passed
@juju-w
juju-w deleted the fix/source-preview-activation-rollback branch August 18, 2026 07:36

@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: 3ebf556b29

ℹ️ 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".

staging_directory="${runtimes_root}/.${runtime_version}.installing.$$"
lock_path="${data_root}/runtime.local.json"
lock_staging="${data_root}/.runtime.local.json.$$"
[ ! -d "$lock_path" ] || fail "Runtime lock path is a directory"

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 Register cleanup before rejecting a directory lock

When runtime.local.json is a directory, this new check calls fail after mktemp has created build_root but before the cleanup trap is registered. Every failed retry therefore leaves a safa-runtime-build.* directory in the temporary directory. Move this validation before mktemp, or install the cleanup trap before any validation that can exit.

Useful? React with 👍 / 👎.

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