-
Notifications
You must be signed in to change notification settings - Fork 549
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
chore: use go to bootstrap downloading and running task #2959
Draft
kzantow
wants to merge
18
commits into
anchore:main
Choose a base branch
from
kzantow-anchore:feat/go-build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
42f7269
chore: use go to bootstrap downloading and running task
kzantow 0bf90a3
chore: use -C to specify alternate directory
kzantow 425f8b8
chore: add help target
kzantow a2fd127
chore: bootstrap only binny, use go-install for binny
kzantow 3670746
chore: try freebsd fix
kzantow ba93002
chore: get binny fixes for go-install
kzantow 46824c0
chore: windows
kzantow 4680090
chore: windows
kzantow 64acdd6
Merge remote-tracking branch 'upstream/main' into feat/go-build
kzantow 360f026
chore: update to latest binny changes
kzantow 6bd4b06
chore: update to latest binny changes
kzantow b266b31
chore: aliases for tools and bootstrap
kzantow 96146f4
Merge remote-tracking branch 'upstream/main' into feat/go-build
kzantow 1433a2c
chore: use go-build with RunTools
kzantow 1cd8447
chore: use binny fix-freebsd branch
kzantow 8ff9092
chore: missing target
kzantow 34acd26
Merge remote-tracking branch 'upstream/main' into feat/go-build
kzantow ae9b854
chore: bouncer binary
kzantow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,17 @@ | ||
OWNER = anchore | ||
PROJECT = syft | ||
.PHONY: * | ||
|
||
TOOL_DIR = .tool | ||
BINNY = $(TOOL_DIR)/binny | ||
TASK = $(TOOL_DIR)/task | ||
help: | ||
@go run -C buildtools . -l | ||
|
||
.DEFAULT_GOAL := make-default | ||
bootstrap: | ||
@go run -C buildtools . bootstrap | ||
|
||
## Bootstrapping targets ################################# | ||
unit: | ||
@go run -C buildtools . $@ | ||
|
||
# note: we need to assume that binny and task have not already been installed | ||
$(BINNY): | ||
@mkdir -p $(TOOL_DIR) | ||
@curl -sSfL https://raw.githubusercontent.com/$(OWNER)/binny/main/install.sh | sh -s -- -b $(TOOL_DIR) | ||
# for some reason test does not work without an explicit target - the dir? | ||
test: | ||
@go run -C buildtools . $@ | ||
|
||
# note: we need to assume that binny and task have not already been installed | ||
.PHONY: task | ||
$(TASK) task: $(BINNY) | ||
@$(BINNY) install task -q | ||
|
||
.PHONY: ci-bootstrap-go | ||
ci-bootstrap-go: | ||
go mod download | ||
|
||
# this is a bootstrapping catch-all, where if the target doesn't exist, we'll ensure the tools are installed and then try again | ||
%: | ||
make $(TASK) | ||
$(TASK) $@ | ||
|
||
## Shim targets ################################# | ||
|
||
.PHONY: make-default | ||
make-default: $(TASK) | ||
@# run the default task in the taskfile | ||
@$(TASK) | ||
|
||
# for those of us that can't seem to kick the habit of typing `make ...` lets wrap the superior `task` tool | ||
TASKS := $(shell bash -c "test -f $(TASK) && $(TASK) -l | grep '^\* ' | cut -d' ' -f2 | tr -d ':' | tr '\n' ' '" ) $(shell bash -c "test -f $(TASK) && $(TASK) -l | grep 'aliases:' | cut -d ':' -f 3 | tr '\n' ' ' | tr -d ','") | ||
|
||
.PHONY: $(TASKS) | ||
$(TASKS): $(TASK) | ||
@$(TASK) $@ | ||
|
||
help: $(TASK) | ||
@$(TASK) -l | ||
@go run -C buildtools . $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module github.com/anchore/syft/buildtools | ||
|
||
go 1.22.0 | ||
|
||
require github.com/kzantow/go-build v0.0.0-20240621190357-037e1844f43f | ||
|
||
require ( | ||
github.com/kr/text v0.2.0 // indirect | ||
golang.org/x/mod v0.14.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= | ||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= | ||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= | ||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= | ||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= | ||
github.com/kzantow/go-build v0.0.0-20240621190357-037e1844f43f h1:BTLfdsCjHKo58S3ULdG0pn2VLHjlYrWUvzwypjwNp+g= | ||
github.com/kzantow/go-build v0.0.0-20240621190357-037e1844f43f/go.mod h1:A2nQV6Y2eb8juxo8yN+tZ+YxJ8hDtQzKSScBvJC8zXk= | ||
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= | ||
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= | ||
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= | ||
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= | ||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= | ||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= | ||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= | ||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/kzantow/go-build" | ||
) | ||
|
||
func main() { | ||
build.RunTools() | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
NOTE this does not work to go-install due to a step during the release which exports data from the Google license classifier: https://github.com/wagoodman/go-bouncer/blob/a28bee0a43c0c55883c7fee39c691a52d10ad0f0/Makefile#L66