Skip to content

ci(release): publish the blockstor CLI binaries for linux, darwin and windows - #319

Merged
Andrei Kvapil (kvaps) merged 3 commits into
mainfrom
ci/release-cli-binaries
Nov 24, 2026
Merged

Andrei Kvapil (kvaps) merged 3 commits into
mainfrom
ci/release-cli-binaries

Conversation

@kvaps

Copy link
Copy Markdown
Member

Right now the only way to get the CLI is go install, which needs a Go toolchain and gives you nothing to verify the binary against.

Every release now gets prebuilt blockstor-<os>-<arch> binaries for linux, darwin and windows on amd64 and arm64, plus SHA256SUMS. The CLI is pure Go with CGO off, so one runner builds all six. The tag is stamped in, so blockstor controller version shows the release. A workflow_dispatch run on a branch is still a dry run: binaries stay a workflow artifact and nothing is uploaded, same as for the images.

The windows targets did not compile, because the device node helper in pkg/drbd uses syscall.Mknod and syscall.Stat_t. These calls are moved to a non-Windows file, and on Windows a stub returns an error. DRBD device nodes only exist on a Linux satellite anyway. Nothing changes on Linux.

Testing

Dry run of the release workflow on this branch passed: all six binaries built and uploaded as an artifact, image jobs green. Locally: built for all six targets, go vet with GOOS=windows, pkg/drbd tests pass.

The only documented way to get the operator CLI is go install, which
needs a Go toolchain on the operator's machine and gives no checksums
to verify against. Attach prebuilt binaries to each release instead.

The CLI is pure Go with CGO off, so one ubuntu runner cross-compiles
all six targets; no native runners are needed. The tag is stamped into
the binary so `controller version` reports the release it came from.
On a dry run the binaries stay a workflow artifact and nothing is
uploaded to a release, matching how the image jobs behave.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
The release now cross-compiles the blockstor CLI for Windows, and the
CLI links pkg/drbd, whose device-node helper calls syscall.Mknod and
reads syscall.Stat_t. Neither exists on Windows, so the windows
targets failed to compile. The two calls move to a non-Windows file;
the Windows build gets a stub that reports the operation as
unsupported, since DRBD device nodes only ever exist on a Linux
satellite.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2343d2c2-cbaa-4da9-bd4a-9f6b5b64822b
Commits

Reviewing files that changed from the base of the PR and between bd9d4df and e46246e.

Files selected for processing: 5

  • .github/workflows/release.yml
  • pkg/drbd/devnode.go
  • pkg/drbd/devnode_test.go
  • pkg/drbd/devnode_unix.go
  • pkg/drbd/devnode_windows.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

The release job looks right to me: pinned SHAs, contents: read on the build job, and nothing uploads on a dry run. The Lint job is red because of the new devnode_unix.go, see the two inline comments. Unit tests fail on the same two tests as main, which #318 fixes.

Comment thread pkg/drbd/devnode_unix.go Outdated
const sIFBLK = syscall.S_IFBLK

func mknod(path string, mode uint32, dev uint64) error {
return syscall.Mknod(path, mode, int(dev)) //nolint:gosec // dev encodes major=147 + minor<=65535; int conversion never truncates

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.

Lint fails here with wrapcheck: the syscall.Mknod error is returned unwrapped. return errors.WithStack(syscall.Mknod(path, mode, int(dev))) from cockroachdb/errors fixes it and still returns nil on success.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in e46246e: the syscall.Mknod error now goes through errors.WithStack, so wrapcheck is happy and success still returns nil.

Comment thread pkg/drbd/devnode_unix.go Outdated
return 0, false
}

return uint64(stat.Rdev), true //nolint:gosec,unconvert // Rdev type varies by OS and arch

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.

nolintlint says gosec is unused in this directive, so Lint fails. //nolint:unconvert // Rdev type varies by OS and arch is enough.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same commit, e46246e: the directive is now //nolint:unconvert // Rdev type varies by OS and arch. The release cross-builds of ./cmd/blockstor for linux, darwin and windows still compile.

Lint failed on the Unix device-node helper: wrapcheck wants the
syscall error wrapped like every other external error in the package,
and nolintlint reports the gosec exemption on the Rdev conversion as
unused on Linux, where only unconvert fires.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>

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.

LGTM. Both lint points are fixed: errors.WithStack around syscall.Mknod still returns nil on success, and the directive is down to unconvert. Lint, unit and integration are green on this head now that the main breakage is fixed.

@kvaps
Andrei Kvapil (kvaps) merged commit 22835b2 into main Nov 24, 2026
16 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.

2 participants