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
universe: go: add git by default in go.#Image #1971
Conversation
I'd rather follow up on docker-library/golang#415, and if you really need git, then you can: img: go.#Image & {
packages: git: {}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution, I've suggest a small improvement to avoid code duplication ;)
So In general, I would say yes. The only "trouble" with that is that |
There's other options, like setting |
There's a push in golang/go#51748 to detect this situation and deal accordingly:
So if this goes through we don't have to change anything. In the meantime we can add: flags: "-buildvcs": *false | true Note that previous docker images (1.17) didn't include the |
Also @vdemeester, if you're up for it, add a test which includes a |
@helderco I'll do this tomorrow 👼🏼 😉 |
👍 on this. I just hit the problem myself, had to do a similar workaround. Ideally the upstream go image would already include git, but if that doesn't come soon enough, we should go ahead with this |
I think we should add the polyfill without waiting for upstream. We can always remove it later if it becomes redundant. |
b0a48c1
to
5d2700d
Compare
5d2700d
to
5b44835
Compare
@@ -17,6 +17,7 @@ dagger.#Plan & { | |||
simple: { | |||
build: go.#Build & { | |||
source: client.filesystem."./data/hello".read.contents | |||
buildvcs: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably should add a 2nd test entry here (one with, one without the flag), right ?
pkg/universe.dagger.io/go/image.cue
Outdated
@@ -12,6 +12,8 @@ _#DefaultVersion: "1.18" | |||
version: *_#DefaultVersion | string | |||
|
|||
packages: [pkgName=string]: version: string | *"" | |||
// FIXME Remove once golang image include 1.18 *or* go compiler is smart with -buildvcs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the FIXME 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, keep this, but it's "...image includes git". Might as well reference the issues: Remove once golang image includes git (docker-library/golang#415) **or** go compiler is smart with -buildvcs (golang/go#51748)
.
There's two levels to this:
Originally posted by @bcmills in golang/go#51748 (comment) So I'm partial to adding a shim (i.e., follow golang's lead), which means: don't add git, and set
|
There's an argument for making dagger have the convenience of adding Pros:
Cons
|
Looking at your change I come to realize that our definition needs a better way to set flags. This can come in another PR. From my previous comment, I say keep it simple for now:
|
This comment was marked as resolved.
This comment was marked as resolved.
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
344fa70
to
2f2a4e0
Compare
Ping @shykes |
cc @aluzzardi |
This seems like a useful short-term fix. We will not be able to remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
We're good to merge @helderco |
It's blocked until @TomChv approves his requested changes. |
@TomChv's changes were addressed -- merging |
@helderco will probably be fixed in 1.18.1 or something I guess ? 🤔 |
This adds git to the default
go.#Image
image so that 1.18 "justworks".
Fixes #1965
Signed-off-by: Vincent Demeester vincent@sbr.pm