Skip to content

fix(installer): four dogfood-discovered bugs blocking curl-pipe-bash on bare Ubuntu#18

Merged
Roo4L merged 1 commit into
masterfrom
fix/installer-file-dep
May 3, 2026
Merged

fix(installer): four dogfood-discovered bugs blocking curl-pipe-bash on bare Ubuntu#18
Roo4L merged 1 commit into
masterfrom
fix/installer-file-dep

Conversation

@Roo4L
Copy link
Copy Markdown
Owner

@Roo4L Roo4L commented May 3, 2026

Summary

Second-dogfood retest of v0.3.2-rc1 against bare ubuntu:24.04 (no preinstalled deps beyond curl + ca-certificates) surfaced four bugs blocking curl ... | bash. This PR fixes them.

Bugs fixed

  1. file(1) dependency in curl-installer (packaging/curl-installer/install.sh:168)

    • file -- not present on minimal Ubuntu / Docker base images.
    • Replaced with head -c 2 + od -tx1 magic-byte read against 1f8b (RFC 1952). Pure coreutils.
  2. sudo package missing on bare Ubuntu (plugin/provisioner/20-sudoers.sh:75)

    • visudo is in the sudo package, not preinstalled on minimal images.
    • Mirrors the locale-gen auto-install pattern in 10-agent-user.sh. Auto-installs sudo if visudo missing.
  3. No VERSION sentinel in release artifacts

    • install.sh follows releases/latest/download/VERSION and parses the redirect URL to discover the latest tag.
    • Without VERSION shipped per release, any unpinned curl ... | bash dies with "could not resolve latest version" because curl -fsSIL fails on the redirect's 404 target.
    • Fix: scripts/build-release.sh writes dist/VERSION; release.yml publishes it.
  4. Operational (not in this commit): v0.3.2-rc1 was published as a full GitHub release. gh release edit v0.3.2-rc1 --prerelease already executed. Future RCs should set the pre-release flag at publish time — tracked separately.

Test rig

docker run --rm --privileged --cgroupns=host -e container=docker \
  -v /sys/fs/cgroup:/sys/fs/cgroup:rw --tmpfs /run --tmpfs /tmp ubuntu:<ver>
apt-get install -y curl ca-certificates
AGENTLINUX_VERSION=v0.3.2-rc1 \
AGENTLINUX_RELEASE_BASE=http://127.0.0.1:18080 \
  bash /tmp/install.sh
sudo -u agent -H bash -lc 'agentlinux install claude-code && claude update'

Results — all three Ubuntu versions:

Ubuntu install agentlinux install claude-code claude update EACCES count
22.04 OK 2.1.98 2.1.98 → 2.1.126 (exit 0) 0
24.04 OK 2.1.98 2.1.98 → 2.1.126 (exit 0) 0
26.04 OK 2.1.98 2.1.98 → 2.1.126 (exit 0) 0

claude binary owned by agent:agent at /home/agent/.local/bin/claude (not under /usr/local/bin — AGT-02 invariant intact).

Test plan

  • gate-1-precommit
  • gate-2-docker × {22.04, 24.04, 26.04}
  • gate-3-qemu × {22.04, 24.04}
  • After merge: tag v0.3.2-rc2, push, run a fresh dogfood against the published RC artifacts (not the local serve)

Refs: AL-18, AL-21

…on bare Ubuntu

End-to-end dogfood retest of v0.3.2-rc1 against bare ubuntu:24.04 (no
preinstalled deps beyond curl + ca-certificates) surfaced four issues
that block the documented `curl ... | bash` happy path:

1. **`file(1)` dependency in curl-installer** — packaging/curl-installer/
   install.sh:168 used `file --` to validate gzip magic before sha256.
   The `file` package is NOT preinstalled on minimal Ubuntu/Debian cloud
   images or most Docker base images. Replaced with `head -c 2 + od -tx1`
   magic-byte read against `1f8b` (RFC 1952). Pure coreutils — `head` and
   `od` are always present. Diagnostic value preserved (still distinguishes
   "wrong magic" from "wrong sha256"; on failure now reports the actual
   magic bytes observed, e.g. `(magic bytes: 3c21)` for an HTML 404 body).

2. **`sudo` package missing on bare Ubuntu** — plugin/provisioner/
   20-sudoers.sh:75 invoked `visudo -cf` which comes from the `sudo`
   package (not preinstalled on minimal images). Mirrors the existing
   pattern in 10-agent-user.sh that auto-installs `locales` if
   `locale-gen` is missing. New gate at the top of 20-sudoers.sh:
   `command -v visudo || apt-get install -y --no-install-recommends sudo`.

3. **No VERSION sentinel in release artifacts** — packaging/curl-installer/
   install.sh:111 follows `releases/latest/download/VERSION` and parses
   the redirect URL to discover the latest tag. The asset isn't read —
   only the redirect URL matters — but `curl -fsSIL` requires the redirect
   target to return 2xx, not 404. Without VERSION shipped per release,
   any unpinned `curl ... | bash` against an asset-less release dies with
   `could not resolve latest version`. Fixed by adding a one-line write to
   `dist/VERSION` (containing the tag) in scripts/build-release.sh §10b
   and adding `dist/VERSION` to the publish files glob in release.yml.

4. **(operational, not in this commit)** v0.3.2-rc1 was published as a
   full GitHub release rather than a pre-release, so `releases/latest`
   redirected to it. Fixed via `gh release edit v0.3.2-rc1 --prerelease`.
   Future RCs should be built/published with the GitHub Releases
   "pre-release" flag set; tracked separately.

Test rig: bare ubuntu:{22.04, 24.04, 26.04} Docker, curl + ca-certificates
only, AGENTLINUX_RELEASE_BASE pointed at a local serve of the patched
tarball, AGENTLINUX_VERSION=v0.3.2-rc1. All three Ubuntu versions reach a
green `claude update` (2.1.98 → 2.1.126) with zero EACCES /
permission-denied lines in the install + agent-install + claude-update
transcripts. AGT-02 release-gate behavior confirmed against the published
RC artifacts after applying these fixes locally.

Refs: AL-18 (first-dogfood follow-up), AL-21 (dogfood retest sub-task)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://Roo4L.github.io/Agent-Linux/pr-preview/pr-18/

Built to branch gh-pages at 2026-05-03 12:50 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@Roo4L Roo4L merged commit 71e04d7 into master May 3, 2026
13 checks 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.

1 participant