Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions uimage/mkuimage/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ func CreateUimage(l *llog.Logger, base []uimage.Modifier, tf *TemplateFlags, f *
l.Infof("Could not get environment's Go version, using runtime's version: %v", err)
v = runtime.Version()
}
if len(env.Compiler.VersionOutput) != 0 {
l.Infof("Compiler: %v", env.Compiler.VersionOutput)
}
if !isRecommendedVersion(v) {
l.Warnf(`You are not using one of the recommended Go versions (have = %s, recommended = %v).
Some packages may not compile.
Expand Down
13 changes: 10 additions & 3 deletions uimage/mkuimage/uflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
Mod golang.ModBehavior
BuildTags []string
BuildOpts *golang.BuildOpts
Compiler string
}

// RegisterFlags registers flags related to Go commands being built.
Expand All @@ -61,6 +62,8 @@
// Register an alias for -go-build-tags for backwards compatibility.
f.Var((*uflag.Strings)(&c.BuildTags), "tags", "Go build tags -- repeat the flag for multiple values")
f.Var((*uflag.Strings)(&c.BuildTags), "go-build-tags", "Go build tags -- repeat the flag for multiple values")
f.StringVar((*string)(&c.Compiler), "compiler", "", "override go compiler to use (e.g. \"/path/to/tinygo\")")

Check failure on line 65 in uimage/mkuimage/uflags.go

View workflow job for this annotation

GitHub Actions / lint

unnecessary conversion (unconvert)

}

// Modifiers turns the flag values into uimage modifiers.
Expand All @@ -77,9 +80,13 @@
switch c.Builder {
case "bb", "gbb":
return []uimage.Modifier{
uimage.WithEnv(golang.WithBuildTag(c.BuildTags...), func(e *golang.Environ) {
e.Mod = c.Mod
}),
uimage.WithEnv(
golang.WithBuildTag(c.BuildTags...),
golang.WithCompiler(c.Compiler),
func(e *golang.Environ) {
e.Mod = c.Mod
},
),
uimage.WithBusyboxCommands(packages...),
uimage.WithShellBang(c.ShellBang),
uimage.WithBusyboxBuildOpts(c.BuildOpts),
Expand Down
Loading