incalculable-manchester-87310
09/22/2022, 2:18 AMconfig/config.go:26:2: module lookup disabled by GOPROXY=off
cmd/stentor/stentor.go:33:2: <http://github.com/davecgh/go-spew@v1.1.1|github.com/davecgh/go-spew@v1.1.1>: module lookup disabled by GOPROXY=off
cmd/stentor/stentor.go:34:2: <http://github.com/davecgh/go-spew@v1.1.1|github.com/davecgh/go-spew@v1.1.1>: module lookup disabled by GOPROXY=off
cmd/stentor/stentor.go:35:2: <http://github.com/davecgh/go-spew@v1.1.1|github.com/davecgh/go-spew@v1.1.1>: module lookup disabled by GOPROXY=off
However, if I run go vet ./...
in the sandbox, it fails with a clearer error:
cmd/stentor/stentor.go:33:2: no required module provides package <http://github.com/wfscheper/stentor/internal/templates;|github.com/wfscheper/stentor/internal/templates;> to add it:
go get <http://github.com/wfscheper/stentor/internal/templates|github.com/wfscheper/stentor/internal/templates>
cmd/stentor/stentor.go:34:2: no required module provides package <http://github.com/wfscheper/stentor/newsfile;|github.com/wfscheper/stentor/newsfile;> to add it:
go get <http://github.com/wfscheper/stentor/newsfile|github.com/wfscheper/stentor/newsfile>
cmd/stentor/stentor.go:35:2: no required module provides package <http://github.com/wfscheper/stentor/release;|github.com/wfscheper/stentor/release;> to add it:
go get <http://github.com/wfscheper/stentor/release|github.com/wfscheper/stentor/release>
Pants is aware of these dependencies:
./pants dependencies cmd/stentor/stentor.go
22:19:24.75 [INFO] Initialization options changed: reinitializing scheduler...
22:19:25.18 [INFO] Scheduler initialized.
//:root#<http://github.com/stretchr/testify/assert|github.com/stretchr/testify/assert>
//:root#<http://github.com/stretchr/testify/require|github.com/stretchr/testify/require>
... # Trimmed out testdata files
config:config
fragment:fragment
internal/templates:templates
internal/test:test
newsfile:newsfile
release:release
bitter-ability-32190
09/22/2022, 9:20 AMwitty-crayon-22786
09/22/2022, 4:45 PMwitty-crayon-22786
09/22/2022, 4:46 PMfast-nail-55400
09/22/2022, 5:24 PMincalculable-manchester-87310
09/23/2022, 12:07 AMfast-nail-55400
09/23/2022, 12:13 AMincalculable-manchester-87310
09/23/2022, 12:39 AMgit clone <https://github.com/wfscheper/stentor.git> --branch pants-integration
cd stentor
./pants lint --only=golangci-lint ::
incalculable-manchester-87310
09/23/2022, 12:40 AMfast-nail-55400
09/23/2022, 2:33 AMfast-nail-55400
09/23/2022, 2:33 AMTransitiveTargetsRequest
to obtain them.fast-nail-55400
09/23/2022, 2:35 AMfast-nail-55400
09/23/2022, 2:37 AMGoImportPathMappingRequest
to obtain a mapping from every import path in a module to the address of the target for each package. Then you can hydrate sources for first-party packages and use ThirdPartyPkgAnalysisRequest
to obtain a Digest
with the third-party module sources (which will be available on the same GOPATH used within the sandbox).fast-nail-55400
09/23/2022, 2:38 AMMergeDigests
to merge all the relevant digests together and use that as the input root.fast-nail-55400
09/23/2022, 2:40 AMGoImportPathMappingRequest
is only available on main
and the latest 2.14 RC release.incalculable-manchester-87310
09/23/2022, 2:49 AMincalculable-manchester-87310
09/24/2022, 1:11 AMfast-nail-55400
09/24/2022, 5:23 AMI'm assuming PATH is too restricted to find the necessary compiler?)given the way I wrote the initial cgo support, it uses
--golang-cgo-tool-search-paths
to search for C compiler. That defaults to <PATH>
though so it should be using the PATH.fast-nail-55400
09/24/2022, 5:23 AMfast-nail-55400
09/24/2022, 5:24 AMGoBuildContext
type, so I haven't been able to make progress on it.fast-nail-55400
09/24/2022, 5:47 AMincalculable-manchester-87310
09/25/2022, 1:21 AMgo env CGO_ENABLED
returns 1.
If I don't set CGO_ENABLED=0 in the wrapper script, then I get some variation on:
19:25:45.27 [ERROR] Completed: Lint with golangci-lint - golangci-lint failed (exit code 3).
level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildir: failed to load package cgo: could not load export data: no export data for \"runtime/cgo\""
level=error msg="Running error: 1 error occurred:\n\t* can't run linter goanalysis_metalinter: buildir: failed to load package cgo: could not load export data: no export data for \"runtime/cgo\"\n\n"
I read through some other linters and I think I resolved the duplicate sandbox problem. I have opened a PR (https://github.com/pantsbuild/pants/pull/16994). Is it better to continue this conversation in the PR comments or on Slack? In addition to the existing CGO questions, I also have some UX questions about how pants should run golangci-lint by default.fast-nail-55400
09/25/2022, 1:34 AMincalculable-manchester-87310
09/25/2022, 2:57 AMgo env
to the wrapper script before explicitly disabling CGO, I see CGO_ENABLED=1.fast-nail-55400
09/25/2022, 3:21 AMgo
invocations that actually need itfast-nail-55400
09/25/2022, 3:21 AMgo tool compile
, it isn't set at all since not neededfast-nail-55400
09/25/2022, 3:21 AMfast-nail-55400
09/25/2022, 3:22 AMGolangSubsystem.cgo_enabled
option