Skip to content

v0.14.0 - breaking u-root build system changes

Latest
Compare
Choose a tag to compare
@hugelgupf hugelgupf released this 27 Feb 18:11
· 59 commits to main since this release

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 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 when go build and go 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 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 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.

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

  • cmds/core/df: remove redurant else by @binjip978 in #2933
  • Add a playbook entry showing how to set verbose init by @rminnich in #2934
  • pkg/dt: fix revive superfluous-else linter by @binjip978 in #2936
  • Breaking change: u-root works exactly when go build or go list also work. by @hugelgupf in #2923

Full Changelog: v0.13.1...v0.14.0