aloof-accountant-53042
06/14/2022, 1:07 AMgo build ./...
seems to work, but ./pants lint ::
does not. I’ve tried clearing out my go mod cache, but no luck. see thread for more info.aloof-accountant-53042
06/14/2022, 1:07 AMgit config --global url."https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com".insteadOf "<https://github.com>"
aloof-accountant-53042
06/14/2022, 1:07 AMexport GOPRIVATE=<http://github.com/stedi|github.com/stedi>
In order for go mod to download private repos.aloof-accountant-53042
06/14/2022, 1:09 AMgo build ./...
seems to download the modules successfully, but ./pants check ::
does not.
› ./pants lint ::
18:03:30.30 [ERROR] 1 Exception encountered:
ProcessExecutionFailure: Process 'Download Go module <http://github.com/stedi/go-lib-auth@v1.1.3|github.com/stedi/go-lib-auth@v1.1.3>.' failed with exit code 1.
stdout:
{
"Path": "<http://github.com/stedi/go-lib-auth|github.com/stedi/go-lib-auth>",
"Version": "v1.1.3",
"Error": "<http://github.com/stedi/go-lib-auth@v1.1.3|github.com/stedi/go-lib-auth@v1.1.3>: invalid version: git ls-remote -q origin in /private/var/folders/3r/76rkfbyd62xc745g5q302kmw0000gp/T/process-execution968cuF/gopath/pkg/mod/cache/vcs/9937a758f3283202f2e4e0efdaf91a97db92f7904132e022913acebe03b6494a: exit status 128:\n\tfatal: could not read Username for '<https://github.com>': terminal prompts disabled\nConfirm the import path was entered correctly.\nIf this is a private repository, see <https://golang.org/doc/faq#git_https> for additional information."
}
aloof-accountant-53042
06/14/2022, 1:09 AMfast-nail-55400
06/14/2022, 1:11 AMgo
in the same execution sandbox that it uses for every other process invocation. Environment variables won’t be passed through unless you specifically configure them using the --golang-subprocess-env-vars
option.fast-nail-55400
06/14/2022, 1:13 AMhundreds-father-404
06/14/2022, 1:13 AMaloof-accountant-53042
06/14/2022, 1:14 AMaloof-accountant-53042
06/14/2022, 1:15 AMaloof-accountant-53042
06/14/2022, 11:03 PMsubprocess_env_vars
to pants.toml, but I’m not entirely sure this is the problem, because the ~/.gitconfig doesn’t contain any environment variables. So I guess my question is, is the git config from $HOME/.gitconfig
even being used inside the pants sandbox?
Another problem I’m running into is that I’m unable to reproduce the failure on my local machine, even after scrubbing my gitconfig, and github environment variables. I’m kind of curious why I can’t get the two to behave the same in the different environments. I’ve tried running it with --no-pantsd
and --no-local-cache
, but it still succeeds locally.
Any help would be appreciated.fast-nail-55400
06/14/2022, 11:04 PMSo I guess my question is, is the git config fromProbably not since the Go backend does not copy that file into the sandbox.even being used inside the pants sandbox?$HOME/.gitconfig
aloof-accountant-53042
06/14/2022, 11:05 PMfast-nail-55400
06/14/2022, 11:08 PM-ldebug
) would provide more context so I could (hopefully) understand what is going on.aloof-accountant-53042
06/14/2022, 11:16 PMfast-nail-55400
06/14/2022, 11:21 PMfast-nail-55400
06/14/2022, 11:25 PMGOPRIVATE
in order for private repos to work.aloof-accountant-53042
06/14/2022, 11:28 PMfast-nail-55400
06/14/2022, 11:29 PMGOPRIVATE
and have git
config visible to the module downloader?fast-nail-55400
06/14/2022, 11:30 PMaloof-accountant-53042
06/14/2022, 11:30 PMaloof-accountant-53042
06/14/2022, 11:33 PMfast-nail-55400
06/14/2022, 11:33 PM.gitconfig
file into the sandbox when the backend invokes go mod download
aloof-accountant-53042
06/14/2022, 11:36 PMfast-nail-55400
06/14/2022, 11:37 PMGIT_CONFIG_GLOBAL
or other env variable defined in --golang-subprocess-env-vars
fast-nail-55400
06/14/2022, 11:37 PMmodern-london-16641
08/14/2023, 2:20 PMthankful-magician-7427
02/12/2024, 4:18 PMfast-nail-55400
03/16/2024, 7:59 PM