Skip to content

Commit

Permalink
universe: go: add a buildvcs option to go.#Build
Browse files Browse the repository at this point in the history
The idea here is to allow a user to disable the default `-buildvcs`
flag on 1.18 that requires git.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
  • Loading branch information
vdemeester committed Apr 1, 2022
1 parent a64fdee commit 5b44835
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/universe.dagger.io/go/build.cue
Expand Up @@ -21,6 +21,9 @@ import (
// Build tags to use for building
tags: *"" | string

// Enable buildvcs
buildvcs: bool | *true

// LDFLAGS to use for linking
ldflags: *"" | string

Expand All @@ -39,6 +42,9 @@ import (
build: true
"-v": true
"-tags": tags
if buildvcs == false {
"-buildvcs=false": true
}
"-ldflags": ldflags
"-o": "/output/"
}
Expand Down
1 change: 1 addition & 0 deletions pkg/universe.dagger.io/go/test/build.cue
Expand Up @@ -17,6 +17,7 @@ dagger.#Plan & {
simple: {
build: go.#Build & {
source: client.filesystem."./data/hello".read.contents
buildvcs: false
}

exec: docker.#Run & {
Expand Down

0 comments on commit 5b44835

Please sign in to comment.