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

fix: stop emitting bus events on go mod events #2673

Merged
merged 1 commit into from Feb 28, 2024

Conversation

willmurphyscode
Copy link
Contributor

@willmurphyscode willmurphyscode commented Feb 27, 2024

Previously, the TUI would hang when scanning directories with lots of go packages, possibly because this path was spamming the TUI with too many events. Since checking on a particular go module is fast, don't show TUI events for each one.

Fixes #2653 .

Manual Testing

echo 'golang:
   # search for go package licences in the GOPATH of the system running Syft, note that this is outside the
   # container filesystem and potentially outside the root of a local directory scan
   # SYFT_GOLANG_SEARCH_LOCAL_MOD_CACHE_LICENSES env var
   search-local-mod-cache-licenses: true

   # specify an explicit go mod cache directory, if unset this defaults to $GOPATH/pkg/mod or $HOME/go/pkg/mod
   # SYFT_GOLANG_LOCAL_MOD_CACHE_DIR env var
   local-mod-cache-dir: ""

   # search for go package licences by retrieving the package from a network proxy
   # SYFT_GOLANG_SEARCH_REMOTE_LICENSES env var
   search-remote-licenses: true

   # remote proxy to use when retrieving go packages from the network,
   # if unset this defaults to $GOPROXY followed by https://proxy.golang.org
   # SYFT_GOLANG_PROXY env var
   proxy: ""

   # specifies packages which should not be fetched by proxy
   # if unset this defaults to $GONOPROXY
   # SYFT_GOLANG_NOPROXY env var
   no-proxy: ""' > .syft.yaml
go build -o /tmp/nsyft cmd/syft/main.go
/tmp/nsyft ~/work/clio # just a directory with a lot of go dependencies

On main, this hangs, but on the current branch, it does not. Happy to add additional testing but not sure how to repro the hang in CI.

Previously, the TUI would hang when scanning directories with lots of go
packages, possibly because this path was spamming the partybus with too
many events. Since checking on a particular go module is fast, don't
show TUI events for each one.

Signed-off-by: Will Murphy <will.murphy@anchore.com>
@willmurphyscode willmurphyscode merged commit 63171b5 into main Feb 28, 2024
11 checks passed
@willmurphyscode willmurphyscode deleted the fix/fewer-go-mod-bus-events branch February 28, 2024 19:14
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.

Syft TUI can hang when using license fetching from go modules
2 participants