Skip to content
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

findpkg: support for globs, GBB_PATH, UROOT_SOURCE #79

Merged
merged 18 commits into from
Dec 29, 2022

Conversation

hugelgupf
Copy link
Member

@hugelgupf hugelgupf commented Dec 28, 2022

ok github.com/u-root/gobusybox/src/pkg/bb/findpkg 33.126s coverage: 97.3% of statements

@hugelgupf hugelgupf force-pushed the glob-support branch 3 times, most recently from 327fc92 to d80e6d6 Compare December 28, 2022 00:33
Signed-off-by: Chris Koch <chrisko@google.com>
@hugelgupf hugelgupf force-pushed the glob-support branch 7 times, most recently from dee318b to b067ba9 Compare December 28, 2022 03:45
@hugelgupf hugelgupf marked this pull request as ready for review December 28, 2022 03:55
@hugelgupf hugelgupf force-pushed the glob-support branch 8 times, most recently from 032faa5 to 47882f6 Compare December 28, 2022 21:37
@hugelgupf hugelgupf changed the title findpkg: support for globs findpkg: support for globs, GBB_PATH, UROOT_SOURCE Dec 28, 2022
Raises gobusybox's requirements to Go 1.15 due to some package query
logic using packages.Load (sometimes, underlying semantics of
packages.Load change from Go version to Go version).

Considerable effort was taken here to reduce the amount of time it takes
to query and glob a larger amount of packages. A lot of code deals
with batching packages.Load calls where possible in order to reduce time
taken.

Signed-off-by: Chris Koch <chrisko@google.com>
GBB_PATH allows providing directories in which to look for Go commands.

For example, GBB_PATH=$HOME/u-root and pattern=[cmds/core/init,
cmds/core/ip] will look for Go commands in $HOME/u-root/cmds/core/init
and $HOME/u-root/cmds/core/ip.

Multiple GBB_PATHs can be given; they must be colon-separated.

UROOT_SOURCE is supported to provide backwards-compatibility with the
u-root command line tool which supported the concept. It's similar to
GBB_PATH, but special to github.com/u-root/u-root.

Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
@hugelgupf hugelgupf force-pushed the glob-support branch 2 times, most recently from d3d2c62 to fd65dc9 Compare December 29, 2022 01:19
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>
not parsed.

Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
The arguments to packages.Config, the specific stuff being gathered,
is the exact set of dependencies necessary for busybox. If we wanted to
expose a generic API for gathering []*packages.Package, we'd have to
allow users to pass their own Config. Let's not go that far.

Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Signed-off-by: Chris Koch <chrisko@google.com>
Test case can only be run with GO111MODULE=on for NewPackage, unless we
add golang.org/x/sys/unix to GOPATH in the test environment.

Signed-off-by: Chris Koch <chrisko@google.com>
@hugelgupf hugelgupf force-pushed the glob-support branch 2 times, most recently from 2a6722c to 1b593a8 Compare December 29, 2022 01:57
Depends on u-root commands as well as u-root module, both of which
require Go 1.16

Signed-off-by: Chris Koch <chrisko@google.com>
@hugelgupf hugelgupf force-pushed the glob-support branch 3 times, most recently from fbe5580 to 8870f8c Compare December 29, 2022 06:29
[skip ci]

Signed-off-by: Chris Koch <chrisko@google.com>
[skip ci]

Signed-off-by: Chris Koch <chrisko@google.com>
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.

1 participant