Skip to content

Broken version and --version with v1.32.0 #1468

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

Closed
3 tasks done
ybiquitous opened this issue Oct 26, 2020 · 10 comments · Fixed by #1471
Closed
3 tasks done

Broken version and --version with v1.32.0 #1468

ybiquitous opened this issue Oct 26, 2020 · 10 comments · Fixed by #1471
Assignees
Labels
area: docker bug Something isn't working

Comments

@ybiquitous
Copy link

Thank you for creating the issue!

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Please include the following information:

Version of golangci-lint

v1.32.0

Config file

None.

Go environment

None. (Docker)

Verbose output of running

v1.31.0:

$ docker run --rm golangci/golangci-lint:v1.31.0 golangci-lint version
golangci-lint has version 1.31.0 built from 3d6d0e7 on 2020-09-07T15:14:41Z

$ docker run --rm golangci/golangci-lint:v1.31.0 golangci-lint --version
golangci-lint has version 1.31.0 built from 3d6d0e7 on 2020-09-07T15:14:41Z

v1.32.0:

$ docker run --rm golangci/golangci-lint:v1.32.0 golangci-lint version
golangci-lint has version master built from ? on

$ docker run --rm golangci/golangci-lint:v1.32.0 golangci-lint --version
Error: unknown flag: --version
Usage:
  golangci-lint [flags]
  golangci-lint [command]

Available Commands:
  cache       Cache control and information
  completion  Output completion script
  config      Config
  help        Help
  linters     List current linters configuration
  run         Run this tool in cloud on every github pull request in https://golangci.com for free (public repos)
  version     Version

Flags:
      --color string              Use color when printing; can be 'always', 'auto', or 'never' (default "auto")
  -j, --concurrency int           Concurrency (default NumCPU) (default 8)
      --cpu-profile-path string   Path to CPU profile output file
  -h, --help                      help for golangci-lint
      --mem-profile-path string   Path to memory profile output file
      --trace-path string         Path to trace output file
  -v, --verbose                   verbose output

Use "golangci-lint [command] --help" for more information about a command.

failed executing command with error unknown flag: --version

I noticed that golangci-lint version and golangci-lint --version are broken with v1.32.0:

  • version outputs invalid text: golangci-lint has version master built from ? on
  • --version is handled as an unknown flag: Error: unknown flag: --version
@ybiquitous ybiquitous added the bug Something isn't working label Oct 26, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented Oct 26, 2020

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@sayboras
Copy link
Member

@ybiquitous thanks for reporting this one, seems like something is broken due to recent refactor docker build for multi-arch support. Do you plan to work on this?

I can take a look sometimes in weekend only.

@sayboras sayboras added help wanted Issue that needs help from a contributor area: docker labels Oct 26, 2020
@ybiquitous
Copy link
Author

@sayboras Sorry, I'm not familiar with the Go language... 🙇

@sayboras
Copy link
Member

Sorry, I'm not familiar with the Go language...

no worry, and thanks again for reporting this :)

@sayboras sayboras self-assigned this Oct 26, 2020
@nvuillam
Copy link

Same error here from golangci/golangci-lint:latest docker image ^^
golangci-lint has version master built from ? on

sayboras added a commit to sayboras/golangci-lint that referenced this issue Oct 26, 2020
As part of golangci#1383, multi-arch docker build was supported. However,
ldflags for version details was missing.

This commit is to add -ldflags
as part of Docker build.

Fixes golangci#1468

Signed-off-by: Tam Mach <[email protected]>
sayboras added a commit to sayboras/golangci-lint that referenced this issue Oct 26, 2020
As part of golangci#1383, multi-arch docker build was supported. However,
ldflags for version details was missing.

This commit is to add -ldflags
as part of Docker build.

Fixes golangci#1468

Signed-off-by: Tam Mach <[email protected]>
sayboras added a commit to sayboras/golangci-lint that referenced this issue Oct 26, 2020
As part of golangci#1383, multi-arch docker build was supported. However,
ldflags for version details was missing.

This commit is to add -ldflags
as part of Docker build.

Fixes golangci#1468

Signed-off-by: Tam Mach <[email protected]>
sayboras added a commit to sayboras/golangci-lint that referenced this issue Oct 26, 2020
As part of golangci#1383, multi-arch docker build was supported. However,
ldflags for version details was missing.

This commit is to add -ldflags
as part of Docker build.

Fixes golangci#1468

Signed-off-by: Tam Mach <[email protected]>
sayboras added a commit to sayboras/golangci-lint that referenced this issue Oct 26, 2020
As part of golangci#1383, multi-arch docker build was supported. However,
ldflags for version details was missing.

This commit is to add -ldflags as part of Docker build.

Fixes golangci#1468

Signed-off-by: Tam Mach <[email protected]>
@sayboras
Copy link
Member

@nvuillam thanks, latest tag is pointing to v1.32.0, hence it will face the same issue.

I got sometime today, so just send the fix. It's pending for review, and might take sometimes.

sayboras added a commit that referenced this issue Oct 27, 2020
* build(docker): Fix version details in docker image

As part of #1383, multi-arch docker build was supported. However,
ldflags for version details was missing.

This commit is to add -ldflags as part of Docker build. I take this chance
to refactor github action as well.

Fixes #1468

Signed-off-by: Tam Mach <[email protected]>
@ybiquitous
Copy link
Author

Thank you so much for the quick fix! 😊

@sayboras
Copy link
Member

Version 1.32.1 was released just now, I have performed quick check, seems fixed now

$ docker run --rm golangci/golangci-lint:v1.32.1 golangci-lint --version
golangci-lint has version v1.32.1 built from dc2d6b51 on 2020-10-31T00:47:14Z

$ uname -a
Linux ubuntu20 5.4.0-52-generic #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
ubuntu@ubuntu ~> docker run --rm golangci/golangci-lint:v1.32.1 golangci-lint --version
golangci-lint has version v1.32.1 built from dc2d6b51 on 2020-10-31T00:47:14Z
ubuntu@ubuntu ~> uname -a
Linux ubuntu 5.4.0-1022-raspi #25-Ubuntu SMP PREEMPT Thu Oct 15 13:31:49 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

@nvuillam
Copy link

It works for me too, thanks :)

@ybiquitous
Copy link
Author

It works for me. Thank you so much! 😊

@ldez ldez removed the help wanted Issue that needs help from a contributor label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docker bug Something isn't working
Projects
None yet
4 participants