Add CLI tool for downloading CockroachDB binaries with cross-platform support#184
Merged
Add CLI tool for downloading CockroachDB binaries with cross-platform support#184
Conversation
… 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.
Member
rickystewart
approved these changes
Jun 24, 2025
| // 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. |
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
I just cargo-culted the variable name. Let me file a ticked to rename it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create cmd/download-crdb-binaries CLI tool with flags:
Extend testserver package with platform-specific functions:
Fix unstable binary filename generation:
Add macOS ARM64 unsigned binary support:
Maintain backward compatibility:
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.