Skip to content

fix(installer): stage the Linux install without a throwaway archive - #64

Merged
Zaldaryon merged 1 commit into
mainfrom
fix/installer-linux-staging-tmpfs
Aug 31, 2026
Merged

fix(installer): stage the Linux install without a throwaway archive#64
Zaldaryon merged 1 commit into
mainfrom
fix/installer-linux-staging-tmpfs

Conversation

@Zaldaryon

Copy link
Copy Markdown
Collaborator

Problem

Follow-up to #23. With the Git clone fix in #61 and #63 the bootstrap now runs to completion, but the install then stalls before any files reach the target directory. The reporter installs onto a separate mount (/mnt/zoomin) with /tmp on the system drive.

install-linux.sh builds the package into a mktemp -d directory by running package-linux.sh with no --format, so it defaults to targz. After package-linux.sh prints Folder ready: it always runs section 7, which builds a full ~600 MB gzip tarball in that same temp directory. install-linux.sh never uses that tarball: it copies the staged folder into place and then deletes the whole temp directory. On a small or tmpfs /tmp the unused archive step exhausts the temp space or pushes the machine into swap, and the install hangs after Folder ready: and before Installing Optimum to ....

install-windows.ps1 already avoids this: it calls package.ps1 without -Zip, and package.ps1 skips Compress-Archive unless -Zip is passed.

Change

scripts/package-linux.sh and scripts/package-linux.ps1 accept --format none (-Format none), which stops after the staged folder and skips the archive. Everything up to Folder ready: is unchanged.

scripts/install-linux.sh and scripts/install-linux-legacy.sh pass --format none. The temp tree is now removed by an EXIT trap that is installed only in the direct-execution guard at the end of the file, replacing the old rm -rf "$(dirname "$temp_source")". Installing the trap at file scope would clobber the caller's EXIT trap when the script is sourced, which scripts/tests/install-linux-prerequisites.sh does.

Tests

scripts/tests/install-linux-staging.sh checks that package-linux.sh rejects an unknown --format, that the none) arm sits before the catch-all, that cleanup_stage is a safe no-op with nothing staged and removes the tree when set, and that sourcing either installer adds no EXIT trap. Optimum.Tests runs it on Linux (LinuxInstallerStagingShellTestPasses) and asserts the script wiring (LinuxInstallerStagesWithoutABuiltThenDeletedArchive).

ci-bootstrap-scripts.yml becomes ci-scripts.yml and runs the new staging test alongside make bootstrap-git-test on changes to the bootstrap, installer, and packaging scripts.

Verification

bash scripts/tests/install-linux-staging.sh passes. dotnet test Optimum.Tests --filter InstallerReleaseCoverageTests: 26 passed. bash -n on the changed shell scripts and the PowerShell parser on package-linux.ps1 pass. shellcheck adds no new diagnostics. make check passes.

A full end to end install was not run here (no built game tree). The reporter's /mnt/zoomin filesystem is not reproducible on this host.

Addresses #23.

install-linux.sh built the package into a temp dir with package-linux.sh in
its default targz mode, copied only the staged folder into place, then deleted
the tar.gz unread. On a small or tmpfs /tmp that unused ~600 MB archive stalled
the install after the staged folder was already complete, before any files
reached the target (reported for an install onto a separate /mnt mount).

package-linux.sh and package-linux.ps1 gain --format none, which stops after
the staged folder. install-linux.sh and install-linux-legacy.sh pass it, and
the temp tree is now removed by an EXIT trap installed only for direct
execution, so sourcing the script (as the prerequisite test does) no longer
clobbers the caller's trap.

scripts/tests/install-linux-staging.sh covers the format validation, the case
ordering, and the cleanup behavior; a new Optimum.Tests fact runs it on Linux.
CI: ci-bootstrap-scripts.yml becomes ci-scripts.yml and also runs the staging
test on changes to the installer and packaging scripts.

Addresses #23
@Zaldaryon
Zaldaryon merged commit b9fc776 into main Aug 31, 2026
4 checks passed
Zaldaryon added a commit that referenced this pull request Aug 31, 2026
Cherry-picked onto the v0.3.14 tag from PR #64 (main). install-linux.sh built
the package with package-linux.sh in its default targz mode, copied only the
staged folder into place, then deleted the tar.gz unread. On a small or tmpfs
/tmp that unused archive stalled the install after the staged folder was ready
and before any files reached the target.

package-linux.sh and package-linux.ps1 gain --format none; both Linux
installers pass it, and the temp tree is removed by an EXIT trap set only for
direct execution.

Scoped to the scripts the installer runs from this tag; the CI and test files
from PR #64 are not included here.
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