Fix missing version number while building step-ca from source archive#2513
Merged
hslatman merged 1 commit intosmallstep:masterfrom Jan 6, 2026
Merged
Fix missing version number while building step-ca from source archive#2513hslatman merged 1 commit intosmallstep:masterfrom
hslatman merged 1 commit intosmallstep:masterfrom
Conversation
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 #2013
There was a problem hiding this comment.
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
casestatement - 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 approved these changes Jan 6, 2026
Member
| Thank you, @originaltrini0 😄 |
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.
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
shshell to bash/dash/etc.Because of this, the output of
.version.shis 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!