Skip to content

feat(ampup): add ampsql to downloadable binaries#11

Open
LNSD wants to merge 1 commit into
mainfrom
lnsd/add-ampsql-binary
Open

feat(ampup): add ampsql to downloadable binaries#11
LNSD wants to merge 1 commit into
mainfrom
lnsd/add-ampsql-binary

Conversation

@LNSD

@LNSD LNSD commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Distribute ampsql alongside ampd, and make both ampctl and ampsql optional so installs and builds succeed against releases or source trees that omit them.

  • Download and install ampsql-{platform}-{arch} from releases; ampd stays required while ampctl/ampsql skip gracefully on AssetNotFound
  • Symlink ampctl/ampsql only when present and clear stale symlinks on version switch in VersionManager::activate
  • Build ampd as required and ampctl/ampsql best-effort via separate cargo build invocations in build_and_install
  • Add ampsql to config path helpers, mock test fixtures, and update feature/pattern docs

@LNSD LNSD self-assigned this Jun 19, 2026
Treat ampd as the only required binary while installing ampctl and ampsql on a best-effort basis, so releases or source trees that omit them no longer fail the whole install.

- Add `ampsql` to download, build-from-source, activation, and uninstall flows alongside `version_ampsql_path`/`active_ampsql_path` config helpers
- Fetch release metadata once via `fetch_release_assets` and resolve each asset in-memory with `ReleaseAssets::resolve`, pairing tasks to assets without zipping parallel collections
- Filter unavailable optional artifacts in `DownloadManager` with a warning; only `ampd` is required
- Build `ampd`, `ampctl`, and `ampsql` separately so a missing optional crate is skipped rather than aborting the build
- Symlink `ampctl`/`ampsql` only when their binaries exist and update docs and mock fixtures

Signed-off-by: Lorenzo Delgado <lorenzo@edgeandnode.com>
@LNSD LNSD force-pushed the lnsd/add-ampsql-binary branch from cd126bc to 733fbcb Compare June 19, 2026 11:05
@LNSD LNSD requested a review from mitchhs12 June 19, 2026 11:06
@LNSD LNSD marked this pull request as ready for review June 19, 2026 11:06

@mitchhs12 mitchhs12 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved but now that ampctl and ampsql are optional, there is a stale optional binary activation bug where rebuilding the same --name/version can leave behind stale binaries.

Comment thread ampup/src/builder.rs

// Create version directory
let version_dir = config.versions_dir.join(version_label);
fs::create_dir_all(&version_dir).context("Failed to create version directory")?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since ampctl/ampsql only print a warning now (they're no longer required), this can leave stale optional binaries behind when rebuilding the same --name/version.

We reuse the final versions/<label> directory here, and because the skip paths below don’t remove any existing ampctl or ampsql, if a previous build produced one of those binaries but the next build skips it, activate() will symlink the stale file by mistake.

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