Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
roblatour opened this issue Sep 26, 2024 · 5 comments
Open

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

roblatour opened this issue Sep 26, 2024 · 5 comments
Assignees
Labels
bug needs triage Waiting for discussion / prioritization by team

Comments

@roblatour
Copy link

Steps to Reproduce

Following the instructions to install and build STEP-CA here:
https://smallstep.com/blog/build-a-tiny-ca-with-raspberry-pi-yubikey/

The build works, but as it starts the first line that is displayed in the terminal is
./.version.sh: 4: Bad substitution ' out of the ' make build GOFLAGS=""
following this the build runs to completion.

But after that the command:
step-ca -version
responds with:

Smallstep CA/ (linux/arm64)
Release Date: 2024-09-25 15:29 UTC

i.e. the version number is not displayed out of the step-ca -version command

Your Environment

  • OS - Raspberry OS
  • step-ca Version - 0.27.4

Expected Behavior

the version number should be displayed

Actual Behavior

the version number is not displayed

Additional Context

build was from:
https://github.com/smallstep/certificates/releases/download/v0.27.4/step-ca_0.27.4.tar.gz

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@roblatour roblatour added bug needs triage Waiting for discussion / prioritization by team labels Sep 26, 2024
@hslatman
Copy link
Member

hslatman commented Sep 27, 2024

It looks like it works on macOS:

$ ./bin/step-ca --version
Smallstep CA/0.27.4 (darwin/arm64)
Release Date: 2024-09-27 22:20 UTC

$ sh --version
GNU bash, version ....

Maybe the script should have #!/usr/bin/env bash instead.

Looking through the Makefile and the additional scripts and resources I think we should simplify the process, but that's a different thing 😅

@roblatour
Copy link
Author

roblatour commented Sep 27, 2024

oddly the instructions at https://smallstep.com/blog/build-a-tiny-ca-with-raspberry-pi-yubikey/

say to use:
step-ca version

you used:
step-ca --version

and I used:
step-ca -version

and the help ( step-ca help )
says to use:
step-ca -v
or
step-ca --version

but even if I try all of these I don't get a version number:

image

@hslatman
Copy link
Member

hslatman commented Sep 28, 2024

@roblatour I ran step-ca --version after make build GOFLAGS="". It's the build target that ultimately sets the version in the binary, based on information from git, or the .VERSION file (useful when building from a source tarball). Apparently on RPi that step fails with the error, and I think that may be because the .version.sh script has sh, which could be behaving differently from macOS.

So, try setting #!/usr/bin/env bash at the start of .version.sh (replacing sh in that line with bash), run make build GOFLAGS="" again, and then step-ca --version. If that works on RPi, we maybe can update it.

step-ca version, step-ca -version and step-ca --version will behave the same, so that's not the issue.

@roblatour
Copy link
Author

roblatour commented Sep 28, 2024

yes, that fixed it. Well done.

image

image

@hslatman
Copy link
Member

Noting here: changing it (back) to bash might break the process for other environments: #1115.

@hslatman hslatman self-assigned this Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

No branches or pull requests

2 participants