Skip to content

Verify and safely activate Pop toolchain bundles - #2

Merged
GalactHD merged 2 commits into
masterfrom
verify-toolchain-installation
Jul 16, 2026
Merged

GalactHD merged 2 commits into
masterfrom
verify-toolchain-installation

Conversation

@serene1491

Copy link
Copy Markdown
Contributor

Summary

Harden popup toolchain installation so a release is verified before it can become active.

The installer now selects exact target assets, requires matching SHA-256 metadata, validates the checksum filename and digest, rejects unsafe or incomplete ZIP archives, and activates complete toolchains transactionally. The setup path also respects a custom POPUP_HOME, and Linux target detection uses uname -m rather than the non-portable uname -i result.

Security and architecture

  • Require pop-<target>.zip and its exact .sha256 asset.
  • Validate SHA-256 before extracting any archive entry.
  • Reject absolute paths, parent traversal, backslashes, and duplicate ZIP entries.
  • Require bin/pop, lib/libpop_standard.a, and lib/libpop_runtime_native.a.
  • Roll back partial installations and preserve the previously active toolchain on failure.
  • Apply executable permissions only to the Pop binary; libraries remain read-only data.
  • Generate shims against the configured installation root instead of hardcoding $HOME/.popup.

Verification

  • crystal tool format --check src spec
  • crystal run src/popup.cr --no-codegen
  • crystal spec (17 examples, 0 failures)
  • bin/ameba (13 files, 0 failures)
  • shards build popup
  • Installed a locally built Pop toolchain bundle through the production installer path
  • Verified the installed CLI in all five supported tool languages
  • Ran installed pop check and pop run smoke tests

Review notes

The checksum is obtained from the same GitHub release as the archive. This protects against corruption and asset substitution but is not a signed-release or independent trust-root design; release signing remains a separate architectural decision.

Require exact release assets and matching SHA-256 metadata before\nextraction. Reject unsafe or incomplete archives, install\ntransactionally, preserve custom POPUP_HOME shims, and use uname -m\nfor portable Linux architecture detection.
Require the target-specific language server in every verified bundle and expose it through a popup-managed shim. This keeps editor tooling on the selected compiler release instead of relying on a source checkout or PATH accident.
@GalactHD
GalactHD merged commit 73b4fe5 into master Jul 16, 2026
1 check passed
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.

2 participants