rapid-bird-79300
05/19/2022, 5:58 PM~
?
Seeing this error on some go builds:
exit status 128:\n\terror: could not expand include path '~/.gitcinclude'\n\tfatal: bad config line 44 in file /usr/local/git/etc/gitconfig
semi related to this thread: https://pantsbuild.slack.com/archives/C046T6T9U/p1652934048576209~
by default.
One obvious fix is to replace it with $HOME
but we want to know if there's a cleaner solution than that.fast-nail-55400
05/19/2022, 6:37 PMgit
? or some other tool?rapid-bird-79300
05/19/2022, 6:38 PMfast-nail-55400
05/19/2022, 6:42 PM--golang-subprocess-env-vars
./pants help-advanced golang
rapid-bird-79300
05/19/2022, 6:43 PM~
but doesn't seem to have an affect. The following still seems to fail:
[subprocess-environment]
env_vars = [
"HOME",
"~",
]
fast-nail-55400
05/19/2022, 6:44 PM--subprocess-environment-env-vars
may not be used for Go-related subprocesses spawned by Pants because --golang-subprocess-env-vars
exists.rapid-bird-79300
05/19/2022, 6:45 PM[golang]
expected_version = "1.18"
subprocess_env_vars = [
"~"
]
fast-nail-55400
05/19/2022, 6:46 PM"HOME"
— that list is a list of environment variable namesKEY=VALUE
syntax)git
sees the ~
it will consult HOME
in the environment since Pants will have actually passed it through to the execution sandboxrapid-bird-79300
05/19/2022, 6:51 PMnjgrisafi@Nicks-MacBook-Pro ~/workspace/flex-benefits-platform (fix-release)$ pants run cmd/company_management/:
11:49:30.88 [INFO] Initializing scheduler...
11:49:31.14 [INFO] Scheduler initialized.
11:49:35.86 [ERROR] 1 Exception encountered:
ProcessExecutionFailure: Process 'Download Go module <http://github.com/PRIVATE|github.com/PRIVATE>.' failed with exit code 1.
stdout:
{
"Path": "<http://github.com/PRIVATE/|github.com/PRIVATE/>",
"Version": "v0.0.0-20220518171805-7655ed2d8579",
"Error": "<http://github.com/PRIVATE|github.com/PRIVATE>: git init --bare in /private/var/folders/4y/6r9f4kwj4f9ff6_gzwv3m9br0000gn/T/process-executionx98Dcm/gopath/pkg/mod/cache/vcs/65b7ef3e751f19c66ee80f973172312ed077987c23f151da0cdd7c440085038c: exec: \"git\": executable file not found in $PATH"
}
stderr:
Use `--no-process-cleanup` to preserve process chroots for inspection.
fast-nail-55400
05/19/2022, 6:52 PMgit
is available to go
via the PATH
given to the execution sandbox (via --golang-subprocess-env-vars
)rapid-bird-79300
05/19/2022, 6:52 PMfast-nail-55400
05/19/2022, 6:53 PMgo
would need to be able to find git
but Pants is complicating everything because of how the execution sandbox does not have most environment variables set.)rapid-bird-79300
05/19/2022, 6:53 PMfast-nail-55400
05/19/2022, 6:55 PMrapid-bird-79300
05/19/2022, 6:56 PMfast-nail-55400
05/19/2022, 6:56 PMrapid-bird-79300
05/19/2022, 6:56 PMPATH
in subprocess_env_vars
it works not but want to know if it's advised or notfast-nail-55400
05/19/2022, 6:57 PM--subprocess-environment-env-vars
is that it affects all subprocesses spawned by Pants. but putting PATH in the Go-specific --golang-subprocess-env-vars
is fine since it only affects Go-related subprocesses and is actually needed by them.rapid-bird-79300
05/19/2022, 7:06 PM(open : no such file or directory)
so it somehow messes up the go build processLOCAL_BIN
(which is /usr/local/bin
) but still seeing the git command error abovefast-nail-55400
05/19/2022, 7:20 PM-ldebug
)Process
loggedrapid-bird-79300
05/19/2022, 7:21 PM12:20:25.41 [DEBUG] spawned local process as Some(33017) for Process { argv: ["./find_binary.sh", "bash"], env: {"PATH": "/usr/bin:/bin:/usr/local/bin"}, working_directory: None, input_digests: InputDigests { complete: DirectoryDigest { digest: Digest { hash: Fingerprint<fc33a6ab65993fa57d52edbff44d8a8a89faa2ec0669950d238b481da5caf15c>, size_bytes: 91 }, tree: "Some(..)" }, nailgun: DirectoryDigest { digest: Digest { hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>, size_bytes: 0 }, tree: "Some(..)" }, input_files: DirectoryDigest { digest: Digest { hash: Fingerprint<fc33a6ab65993fa57d52edbff44d8a8a89faa2ec0669950d238b481da5caf15c>, size_bytes: 91 }, tree: "Some(..)" }, immutable_inputs: {}, use_nailgun: [] }, output_files: {}, output_directories: {}, timeout: None, execution_slot_variable: None, concurrency_available: 0, description: "Searching for `bash` on PATH=/usr/bin:/bin:/usr/local/bin", level: Debug, append_only_caches: {}, jdk_home: None, platform_constraint: None, cache_scope: PerRestartSuccessful }
12:20:25.56 [DEBUG] Completed: Searching for `bash` on PATH=/usr/bin:/bin:/usr/local/bin
12:20:25.56 [DEBUG] Completed: Scheduling: Searching for `bash` on PATH=/usr/bin:/bin:/usr/local/bin
12:20:25.56 [DEBUG] Completed: acquire_command_runner_slot
12:20:25.56 [DEBUG] Running Test binary /bin/bash. under semaphore with concurrency id: 2, and concurrency: 1
12:20:25.56 [DEBUG] Completed: setup_sandbox
huh the path looks correct?12:20:25.70 [DEBUG] Completed: Determine Go version for /usr/local/bin/go
12:20:25.70 [DEBUG] Completed: Scheduling: Determine Go version for /usr/local/bin/go
env: {"LOCAL_BIN": "/usr/local/bin/", "__PANTS_CHDIR_TO": "", "__PANTS_GO_SDK_CACHE_KEY": "1.18/darwin/amd64"}
fast-nail-55400
05/19/2022, 7:31 PMLOCAL_BIN
?"PATH=/usr/local/bin"
?rapid-bird-79300
05/19/2022, 7:32 PM/usr/local/bin
fast-nail-55400
05/19/2022, 7:32 PM[golang]
subprocess_env_vars = [
"PATH=/usr/local/bin",
"HOME",
]
rapid-bird-79300
05/19/2022, 7:34 PMexit status 128:\n\tssh -o ControlMaster=no -o BatchMode=yes: ssh: command not found\n\tfatal: Could not read from remote repository.\n\t\n\tPlease make sure you have the correct access rights\n\tand the repository exists.
.gitconfig
right?fast-nail-55400
05/19/2022, 7:37 PMHOME
set it should find the ssh config in $HOME/.ssh — are you using ssh-agent
at all?SSH_AUTH_SOCK
environment variable just like HOME
is passed through)rapid-bird-79300
05/19/2022, 7:38 PMfast-nail-55400
05/19/2022, 7:38 PM-v
to the ssh invocation (if that can be specfied in the .gitconfig
)?rapid-bird-79300
05/19/2022, 7:48 PMfast-nail-55400
05/19/2022, 7:53 PMGIT_SSH_COMMAND
can be set to override the ssh command used by gitrapid-bird-79300
05/19/2022, 7:54 PM-v
to the existing cmdexit status 128:\n\tssh -o ControlMaster=no -o BatchMode=yes -v: ssh: command not found\n\tfatal: Could not read from remote repository.\n\t\n\tPlease make sure you have the correct access rights\n\tand the repository exists."
need ldebug?fast-nail-55400
05/19/2022, 7:56 PMrapid-bird-79300
05/19/2022, 7:56 PMfast-nail-55400
05/19/2022, 7:57 PMrapid-bird-79300
05/19/2022, 8:01 PMGIT_SSH_COMMAND=/usr/bin/ssh -o ControlMaster=no -o BatchMode=yes
(prepend /usr/bin
)
and now everything works as expected!fast-nail-55400
05/19/2022, 8:01 PMPATH=/usr/bin:/usr/local/bin
work?rapid-bird-79300
05/19/2022, 8:01 PM"PATH=/usr/bin;/usr/local/bin"
results in exec: \"git\": executable file not found in $PATH
;
->` :` let me try one more time"PATH=/usr/bin:/usr/local/bin"
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
fast-nail-55400
05/19/2022, 8:08 PM-o BatchMode=yes
rapid-bird-79300
05/19/2022, 8:13 PMfast-nail-55400
05/19/2022, 8:16 PMUSER
env var through as wellrapid-bird-79300
05/19/2022, 8:22 PM[url "<ssh://git@github.com/>"]
insteadOf = <https://github.com/>
"PATH=/usr/local/bin:/usr/bin"
will pass
"PATH=/usr/bin:/usr/local/bin"
will failfast-nail-55400
05/19/2022, 8:33 PMrapid-bird-79300
05/19/2022, 8:34 PMfast-nail-55400
05/19/2022, 8:34 PMrapid-bird-79300
05/19/2022, 8:34 PMGoSdkProcess
process use the [golang]
settings?fast-nail-55400
05/19/2022, 10:24 PMGoSdkProcess
to Process
--golang-*
(i.e., GolangSubsystem
)rapid-bird-79300
05/19/2022, 10:30 PMfast-nail-55400
05/19/2022, 10:33 PMrapid-bird-79300
05/20/2022, 12:25 AM