-
Notifications
You must be signed in to change notification settings - Fork 395
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
Breaking change: u-root works exactly when go build or go list also work. #2923
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2923 +/- ##
=========================================
+ Coverage 0 78.30% +78.30%
=========================================
Files 0 416 +416
Lines 0 42409 +42409
=========================================
+ Hits 0 33207 +33207
- Misses 0 9202 +9202
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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
I'll set up some more tools in the other repo before I really merge this -- I'd like e.g. an easy way to test compilation of every template. |
841d7da
to
c5fa810
Compare
PTAL |
abd0b38
to
d7946a1
Compare
0074364
to
e05747f
Compare
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
e05747f
to
dfe0afc
Compare
Really nice! It's fairly large so looking over everything might take time but so far this looks very promising. The gist is to strip out the image building and rely on mkuimage and gobusybox alone, right? Seems reasonable to me. |
That is a side-effect here. The behavior changes I described in the first comment (which are pulled in through that) are important to take a look at. |
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.
this makes a lot of sense. the nature of u-root is utterly changed from 12y ago, as is the nature of Go, and this seems like a long overdue reworking of it all.
Important
TL;DR: You won't be able to run
u-root
from any arbitrary directory after this change (when usingGO111MODULE=on|auto
).u-root
must be run somewhere with a Go module or Go workspace.Go workspaces replace this use case, and there is a tool to create Go workspaces on the fly called goanywhere. Another usable method is described by the mkuimage README.
This change pulls in u-root/gobusybox#110, in which we stop supporting module builds without a go.mod. In essence, from this point forward, the
u-root
tool will support builds exactly whengo build
andgo list
also work. u-root/gobusybox#110 reduces a lot of maintenance burden, trivially starts supporting Go workspaces and Go module replace directives, and increases gobusybox code's readability.Multi-module builds can be done easily with the 2 standard Go methods, as described in the mkuimage README. Go workspaces, vendored Go workspaces, Go modules, and vendored Go modules are all supported. Completely offline builds can easily done with vendored Go modules or workspaces.
For ease of use, the goanywhere tool was created.
goanywhere
creates a temporary directory with a Go workspace of the given commands, and then execs a binary passing along the Go command paths. Use likegoanywhere ./u-root/cmds/core/{init,gosh} ./cpu/cmds/cpud -- u-root [other u-root args]
. This approaches the easy usability ofu-root
up to this point.goanywhere
does not work with templates.goanywhere
only accepts file system paths at this time.This also fixes the issue where
binary
mode builds didn't always work in the same cases wheregbb
builds worked. Both are now always supported in the exact same circumstances.This change also pulls in u-root/mkuimage#28, in which we support generic template YAML files named ".mkuimage.yaml" in the current working directory or any of its parents. Templates support the existing command expansions, but also support configs (invoked with
u-root -config=$config
) in which one can specify build configuration and mixed-builder (bb/binary) builds. They will be documented in a README at a later time.Also check out the new README.
Closes #2814
Closes #2603
Closes #2450
Closes #2200
Closes #2198
Closes #2149
Closes #1863
Closes #1851
Closes #1024
Closes #985