-
Notifications
You must be signed in to change notification settings - Fork 21
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
tinygo: -compiler command line argument (e.g. tinygo) #121
Conversation
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.
Nice work, I anticipate this will help a lot to enable u-root builds with tinygo
@archie2x if you need said changes
in u-root, do you mind opening a pr? at some point it needs to be merged anyway, right? |
I was going to to, and actually, maybe a larger patch for enabling tinygo build of all cmds in u-root but I saw you already have a PR to make init in u-root/u-root#3062 or am I misunderstanding? I think you're on a better track: putting the link fixes for tinygo in a shared package. For the sake of managing all this, I just created a patch to tinygo to help us identify versions in the sources: tinygo-org/tinygo#4389 |
@rminnich @hugelgupf what do you think of this? |
Signed-off-by: Roger Standridge <9526806+archie2x@users.noreply.github.com>
Signed-off-by: Roger Standridge <9526806+archie2x@users.noreply.github.com>
I marked it as draft because I want to work through the GOROOT. I think, unless overridden by env, it has to be the same as the tinygo 'cached-GOROOT' |
Signed-off-by: Roger Standridge <9526806+archie2x@users.noreply.github.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #121 +/- ##
==========================================
- Coverage 58.25% 57.27% -0.98%
==========================================
Files 16 17 +1
Lines 1636 1753 +117
==========================================
+ Hits 953 1004 +51
- Misses 683 749 +66
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@hugelgupf I think @archie2x addressed all the requested changes, should we get this in? |
Another thing: To enable tinygo support in u-root we had do move from go assembly to CGO. I tested this branch and realized that gobusybox does not support Cgo (also mentioned in the docs, I know). I tried to hack on this for a while but could not get it running yet.
I tracked the error down into |
Leon approved these, it never merged, but if it passes, and looks reasonable to me, I'll merge. |
help:
I haven't figured out how to propagate this to mkuimage.This allows specifying the compiler explicitly in makebb and handles peculiarities of tinygo. It works by resolving and caching the path to the go-compiler then queries tinygo for its hidden go-build-tags and propagates them to package lookup / install. This allows the pruning algorithm to correctly add / remove files when syncing dependent packages.
Usage:
Resulting busybox is significantly smaller. I compiled a slightly more complicated project than e.g. u-root/cmds/core/{true,false} to test package resolution.
Standard go:
tinygo:
Needs: