Skip to content

Conversation

@originaltrini0
Copy link
Contributor

The .version.sh file fails at line 4 with the following error:
./.version.sh: 4: Bad substitution ' out of the ' make build GOFLAGS=""

The above error results in 'step-ca --version' not including the version number after the build:
Smallstep CA/ (linux/arm64)
Release Date: 2026-01-02 16:32 UTC

Modern *nix-like operating systems symlink the sh shell to bash/dash/etc.
Because of this, the output of .version.sh is not consistent across different operating systems.
The goal of this change is to make the code POSIX-neutral so that it executes correctly in bash/dash/sh shells.
Tested on Ubuntu 24.04 (amd64), Debian 13 (arm64), and MacOS 15.7.1 (arm).

Fixes #2013

Name of feature:

N/A

Pain or issue this feature alleviates:

This should significantly reduce comments about a missing version number from the output of step-ca --version.
It also removes the error/warning (./.version.sh: 4: Bad substitution ' out of the ' make build GOFLAGS="") while building from source.

Why is this important to the project (if not answered above):

Is there documentation on how to use this feature? If so, where?

In what environments or workflows is this feature supported?

Please let me know what to put here.

In what environments or workflows is this feature explicitly NOT supported (if any)?

Supporting links/other PRs/issues:

Issue #2013

💔Thank you!

The .version.sh file fails at line 4 with the following error:
./.version.sh: 4: Bad substitution ' out of the ' make build GOFLAGS=""

The above error results in 'step-ca --version' not including the version number after the build:
Smallstep CA/ (linux/arm64)
Release Date: 2026-01-02 16:32 UTC

Modern *nix-like operating systems symlink the sh shell to bash/dash/sh.
Because of this, the output of .version.sh is not consistent across different operating systems.
The goal of this change is to make the code POSIX-neutral so that it executes correctly in bash/dash/sh shells.
Tested on Ubuntu 24.04 (amd64), Debian 13 (arm64), and MacOS 15.7.1 (arm).

Fixes smallstep#2013
@github-actions github-actions bot added the needs triage Waiting for discussion / prioritization by team label Jan 6, 2026
@hslatman hslatman requested a review from Copilot January 6, 2026 20:51
@hslatman hslatman self-assigned this Jan 6, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a POSIX shell compatibility issue in the .version.sh script that was causing build failures and missing version numbers in step-ca --version output. The script was using bash-specific syntax ([[ ]] and substring expansion) which fails when sh is symlinked to dash or other non-bash shells.

  • Replaces bash-specific conditional and substring syntax with POSIX-compliant case statement
  • Ensures consistent behavior across different shell implementations (bash/dash/sh)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hslatman hslatman added this to the v0.29.1 milestone Jan 6, 2026
@hslatman hslatman changed the title Fix missing version number while building step-ca Fix missing version number while building step-ca from source archive Jan 6, 2026
@hslatman hslatman merged commit eb10da1 into smallstep:master Jan 6, 2026
15 checks passed
@hslatman
Copy link
Member

hslatman commented Jan 6, 2026

Thank you, @originaltrini0 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs triage Waiting for discussion / prioritization by team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: step-ca --version does not return version

2 participants