Skip to content

Comments

Add CLI tool for downloading CockroachDB binaries with cross-platform support#184

Merged
rail merged 2 commits intomasterfrom
rail/pr-rkxpnupmzmzs
Jul 1, 2025
Merged

Add CLI tool for downloading CockroachDB binaries with cross-platform support#184
rail merged 2 commits intomasterfrom
rail/pr-rkxpnupmzmzs

Conversation

@rail
Copy link
Member

@rail rail commented Jun 23, 2025

  • Create cmd/download-crdb-binaries CLI tool with flags:

    • -platform (linux, darwin, windows) - defaults to runtime.GOOS
    • -arch (amd64, arm64) - defaults to runtime.GOARCH
    • -version (specific version or 'unstable') - defaults to 'unstable'
    • -output (custom directory) - defaults to temp directory
  • Extend testserver package with platform-specific functions:

  • Fix unstable binary filename generation:

    • Changed from 'cockroach-' to descriptive 'cockroach-latest'
  • Add macOS ARM64 unsigned binary support:

    • Correct naming pattern: 'darwin-arm64.unsigned' for unstable builds
    • Enables downloading bleeding-edge builds on Apple Silicon
  • Maintain backward compatibility:

    • Original functions delegate to new platform-specific versions
    • Existing test server functionality unchanged
  • Remove unsupported musl detection.

The CLI tool now supports downloading any CockroachDB version for any supported platform/architecture combination, with 'unstable' as the sensible default for getting the latest bleeding-edge builds.

… support

- Create cmd/download-crdb-binaries CLI tool with flags:
  * -platform (linux, darwin, windows) - defaults to runtime.GOOS
  * -arch (amd64, arm64) - defaults to runtime.GOARCH  
  * -version (specific version or 'unstable') - defaults to 'unstable'
  * -output (custom directory) - defaults to temp directory

- Extend testserver package with platform-specific functions:
- Fix unstable binary filename generation:
  * Changed from 'cockroach-' to descriptive 'cockroach-latest'

- Add macOS ARM64 unsigned binary support:
  * Correct naming pattern: 'darwin-arm64.unsigned' for unstable builds
  * Enables downloading bleeding-edge builds on Apple Silicon

- Maintain backward compatibility:
  * Original functions delegate to new platform-specific versions
  * Existing test server functionality unchanged

- Remove unsupported musl detection.

The CLI tool now supports downloading any CockroachDB version for any
supported platform/architecture combination, with 'unstable' as the
sensible default for getting the latest bleeding-edge builds.
@rail rail self-assigned this Jun 23, 2025
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rail rail requested a review from rafiss June 23, 2025 17:38
// this local binary.
// To download a specific cockroach version, specify desiredVersion. Otherwise,
// the latest stable or non-stable version will be chosen.
// To download the latest STABLE version of CRDB, set `nonStable` to false.

Choose a reason for hiding this comment

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

Nit: having the variable be nonStable instead of stable is a bit unintuitive. I think the fact that you need to add this clarification to the function comment here is evidence for this -- you need to be very careful to explain what the parameter does, when if it were just stable bool, then it would be obvious.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just cargo-culted the variable name. Let me file a ticked to rename it.

Copy link
Member Author

Choose a reason for hiding this comment

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

@rail rail merged commit 78c05df into master Jul 1, 2025
3 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.

3 participants