Skip to content

dev: fix variables incorrectly passed to 'go build' #4369

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

Conversation

ashmckenzie
Copy link

This PR aims to solve #4368 by ensuring the APP_VERSION and CGO_ENABLED variables are correctly set prior to being used by go build:

Before (from d751398)

$ docker build --quiet -f build/Dockerfile --build-arg VERSION=9.9.9 --build-arg SHORT_COMMIT=abc123 --build-arg DATE=now . -t test/golang-ci-lint && docker run --rm -ti test/golang-ci-lint golangci-lint version
sha256:6749ff93236299ceac1d04987f3384415fa7f081cfc9ea8695412a2a86f30690
golangci-lint has version  built with go1.22.0 from abc123 on now

After (from ashmckenzie/fix-missing-version-in-docker-build)

$ docker build --quiet -f build/Dockerfile --build-arg VERSION=9.9.9 --build-arg SHORT_COMMIT=abc123 --build-arg DATE=now . -t test/golang-ci-lint && docker run --rm -ti test/golang-ci-lint golangci-lint version
sha256:2f2607b9836e56d75b7aca69363aa5329619bcaf8a46d2448957d450645550ce
golangci-lint has version 9.9.9 built with go1.22.0 from abc123 on now

Closes: #4368

Copy link

boring-cyborg bot commented Feb 9, 2024

Hey, thank you for opening your first Pull Request !

@CLAassistant
Copy link

CLAassistant commented Feb 9, 2024

CLA assistant check
All committers have signed the CLA.

@ashmckenzie ashmckenzie force-pushed the ashmckenzie/fix-missing-version-in-docker-build branch from fca0783 to 78c3e04 Compare February 9, 2024 02:18
@ldez ldez self-requested a review February 9, 2024 02:20
@ldez ldez added bug Something isn't working docker PR that update Docker code labels Feb 9, 2024
@ldez
Copy link
Member

ldez commented Feb 9, 2024

Hello @ashmckenzie, thank you for the issue and the PR ❤️

I think we will solve this problem by stopping the old approach with a "manual" build, and just integrating the build of the images inside the goreleaser process.
See #4370.

@ashmckenzie
Copy link
Author

Hi @ldez, thanks for the quick response!

#4370 looks like a more scalable approach for the future which is great but the diff is quite large in comparison to the two line fix here 🙂

Would you consider merging this PR as a bugfix and #4370 as a feature improvement ?

@ldez
Copy link
Member

ldez commented Feb 9, 2024

There is a large diff but it's really easy to review and test it.

I don't close your PR for now, I will see with the other maintainers if they have the time to review my PR.

In all cases, your PR or my PR will be a part of the next bug-fix release.

@ldez ldez changed the title Fix variables incorrectly passed to 'go build' dev fix variables incorrectly passed to 'go build' Feb 9, 2024
@ldez ldez changed the title dev fix variables incorrectly passed to 'go build' dev: fix variables incorrectly passed to 'go build' Feb 9, 2024
@ldez ldez closed this in #4370 Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docker PR that update Docker code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version missing from golangci-lint in Docker image since v1.56.0
5 participants