Download Latest Version v0.14.0 - breaking u-root build system changes source code.zip (56.8 MB)
Email in envelope

Get an email when there's a new version of u-root

Home / v0.14.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2024-02-27 3.6 kB
v0.14.0 - breaking u-root build system changes source code.tar.gz 2024-02-27 54.6 MB
v0.14.0 - breaking u-root build system changes source code.zip 2024-02-27 56.8 MB
Totals: 3 Items   111.4 MB 2

[!IMPORTANT] TL;DR: When Go modules are enabled, you won't be able to run u-root from any arbitrary directory after this release. u-root must be run somewhere with a Go module or Go workspace. (With GO111MODULE=off the behavior should be as it always has been.)

u-root will now work exactly when go build works as well.

Use Go workspaces to compile commands from multiple modules together locally. A tool called goanywhere can create a workspace on the fly. Check out the README for more.

Go workspaces are not as suitable to be committed to a git repository. The recommended method for source-control-committed multi-module commands is described by the mkuimage README.

This change pulls in https://github.com/u-root/gobusybox/pull/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 when go build and go list also work. https://github.com/u-root/gobusybox/pull/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 standard Go methods, as described in the 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 like goanywhere ./u-root/cmds/core/{init,gosh} ./cpu/cmds/cpud -- u-root [other u-root args]. This approaches the easy usability of u-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 where gbb builds worked. Both are now always supported in the exact same circumstances.

This change also pulls in https://github.com/u-root/mkuimage/pull/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.

[!NOTE]

If you have any issues, please file an issue and use the last release before this change, which is v0.13.1.

What's Changed

Full Changelog: https://github.com/u-root/u-root/compare/v0.13.1...v0.14.0

Source: README.md, updated 2024-02-27