Skip to content

add option to specify go -compiler, e.g. tinygo see u-root/gobusybox#121#34

Open
archie2x wants to merge 1 commit intou-root:mainfrom
archie2x:tinygo
Open

add option to specify go -compiler, e.g. tinygo see u-root/gobusybox#121#34
archie2x wants to merge 1 commit intou-root:mainfrom
archie2x:tinygo

Conversation

@archie2x
Copy link
Copy Markdown

@archie2x archie2x commented Aug 6, 2024

Propogates -compiler option from u-root/gobusybox#121 to mkuimage

Copy link
Copy Markdown
Member

@orangecms orangecms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me; objections from anyone more experienced with Go, @rminnich maybe?

@orangecms
Copy link
Copy Markdown
Member

oops, requires DCO (i.e. git commit -s --amend --noedit) @archie2x ; sorry for this taking so long, hope you can quickly fix this up, otherwise I will add my signoff

@orangecms
Copy link
Copy Markdown
Member

orangecms commented Apr 13, 2026

Huh, apparently something broke within golang:

# github.com/u-root/mkuimage/uimage/mkuimage
Error: uimage/mkuimage/cmd.go:134:22: env.Compiler.VersionOutput undefined (type string has no field or method VersionOutput)
Error: uimage/mkuimage/cmd.go:135:40: env.Compiler.VersionOutput undefined (type string has no field or method VersionOutput)
Error: uimage/mkuimage/uflags.go:85:12: undefined: golang.WithCompiler

I assume that is an internal, unstable API? 😬

Edit:
see https://github.com/u-root/gobusybox/commits/main/src/pkg/golang/compiler.go
we will need to bump gobusybox for this, right?

@archie2x
Copy link
Copy Markdown
Author

I can take a look after I get a cup of coffee today...

orangecms added a commit to platform-system-interface/mkuimage that referenced this pull request Apr 13, 2026
The move of gobusybox to Go 1.25 would force mkuimage to use it, too.
This upgrade enables the open PR for adding the `-compiler` option:
u-root#34

Signed-off-by: Daniel Maslowski <info@orangecms.org>
orangecms added a commit to platform-system-interface/mkuimage that referenced this pull request Apr 13, 2026
The move of gobusybox to Go 1.25 forces mkuimage to use it, too.
This upgrade enables the open PR for adding the `-compiler` option:
u-root#34

Signed-off-by: Daniel Maslowski <info@orangecms.org>
orangecms added a commit to platform-system-interface/mkuimage that referenced this pull request Apr 13, 2026
The move of gobusybox to Go 1.25 forces mkuimage to use it, too.
This upgrade enables the open PR for adding the `-compiler` option:
u-root#34

Signed-off-by: Daniel Maslowski <info@orangecms.org>
orangecms added a commit to platform-system-interface/mkuimage that referenced this pull request Apr 13, 2026
The move of gobusybox to Go 1.25 forces mkuimage to use it, too.
This upgrade enables the open PR for adding the `-compiler` option:
u-root#34

To get to 1.25, this also does:

* cross-compile.sh: drop windows/arm
  This has been removed upstream, being broken since Go 1.18.
  golang/go#71671
* CI: bump to Go 1.25 and 1.26 actions for lint workflow
* migrate golangci config
  This is the result of running `golangci-lint migrate` using v2.11.4.
  <https://golangci-lint.run/docs/product/migration-guide/>
  Note: exclusions have been reworked, and the migration dropped them.
  <golangci/golangci-lint#5298>

Signed-off-by: Daniel Maslowski <info@orangecms.org>
@orangecms
Copy link
Copy Markdown
Member

I can take a look after I get a cup of coffee today...

I took care of the version bumps, tried your change locally, and it works! :)

orangecms added a commit that referenced this pull request Apr 13, 2026
The move of gobusybox to Go 1.25 forces mkuimage to use it, too.
This upgrade enables the open PR for adding the `-compiler` option:
#34

To get to 1.25, this also does:

* cross-compile.sh: drop windows/arm
  This has been removed upstream, being broken since Go 1.18.
  golang/go#71671
* CI: bump to Go 1.25 and 1.26 actions for lint workflow
* migrate golangci config
  This is the result of running `golangci-lint migrate` using v2.11.4.
  <https://golangci-lint.run/docs/product/migration-guide/>
  Note: exclusions have been reworked, and the migration dropped them.
  <golangci/golangci-lint#5298>

Signed-off-by: Daniel Maslowski <info@orangecms.org>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.44%. Comparing base (72394cd) to head (f74c7bc).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
+ Coverage   75.34%   75.44%   +0.09%     
==========================================
  Files          24       24              
  Lines        1521     1527       +6     
==========================================
+ Hits         1146     1152       +6     
  Misses        279      279              
  Partials       96       96              
Flag Coverage Δ
ubuntu-latest-unit 75.44% <100.00%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@orangecms
Copy link
Copy Markdown
Member

just one trivial lint error:

  Error: uimage/mkuimage/uflags.go:65:23: unnecessary conversion (unconvert)
  	f.StringVar((*string)(&c.Compiler), "compiler", "", "override go compiler to use (e.g. \"/path/to/tinygo\")")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants