Skip to content

Failed to load stdlib module when executing cyclonedx-gomod #423

Open
@emacampolo

Description

The issue I'm facing is that I have a CI with Go 1.21 that tries to generate the bom for an application that requires Go 1.22.
The error I get is the following:

~ cyclonedx-gomod app -verbose -json=true -main ./cmd/server
12:29AM DBG loading modules moduleDir=.
12:29AM DBG executing command cmd="/usr/local/go/bin/go list -deps -json ./cmd/cli/" dir=.
12:29AM DBG executing command cmd="/usr/local/go/bin/go env -json" dir=
12:29AM DBG loading module moduleDir=/Users/ecampolo/go/pkg/mod/golang.org/[email protected]/src
12:29AM DBG executing command cmd="/usr/local/go/bin/go list -mod readonly -json -m" dir=/Users/ecampolo/go/pkg/mod/golang.org/[email protected]/src
12:29AM ERR error="failed to load modules: failed to convert packages to modules: failed to load stdlib module: failed to load stdlib module: listing module failed: command `/usr/local/go/bin/go list -mod readonly -json -m` failed: exit status 1"

While I'm not sure if it's a bug, the following behavior presents frictions with respect to the new policy in which Go 1.21+ version try to compile newer versions.

My goal is not to have to update de go version every time a release occur since now Go 1.21 and later will not try to compile code that requires a newer version of Go but instead download the corresponding toolchain.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions