agreeable-oyster-28981
05/29/2022, 11:55 AMBinaryPathRequest
and BinaryPathTest
When testing with gcloud -v
, my binary is not found.
When removing the test
part, the binary is found with the proper path.
What are the requirements for the test
?
request = BinaryPathRequest(
binary_name="gcloud",
search_path=search_path,
test=BinaryPathTest(args=["-v"]),
)
vs:
request = BinaryPathRequest(
binary_name="gcloud",
search_path=search_path,
)
gcloud -v
Google Cloud SDK 378.0.0
bq 2.0.74
core 2022.03.18
gsutil 5.8
Updates are available for some Google Cloud CLI components. To install them,
please run:
$ gcloud components update
...
echo $?
0
I was assuming an exit code of 0 would be enough, but it doesn’t look like it is?agreeable-oyster-28981
05/29/2022, 11:58 AMagreeable-oyster-28981
05/29/2022, 12:47 PMtest=BinaryPathTest(args=["-v"]),
doesn’t seems to be working for gclodu for a reason I don’t understand 🤔bitter-ability-32190
05/29/2022, 2:51 PM--no-proccess-cleanup
and --no-pantsd
and you'll likely see Pants leaking the process where it tests the binary.
Then poke around and see whats what.
For instance, the executable flag might not have been setagreeable-oyster-28981
05/29/2022, 3:52 PMagreeable-oyster-28981
05/29/2022, 3:54 PMtest
partagreeable-oyster-28981
05/29/2022, 3:55 PMls -lta /Users/quentin/Downloads/google-cloud-sdk/bin/gcloud
-rwxrwxrwx@ 1 quentin staff 5611 Jan 1 1980 /Users/quentin/Downloads/google-cloud-sdk/bin/gcloud
I went as loose as possible regarding the flags, 777 on the binaryagreeable-oyster-28981
05/29/2022, 3:56 PM11:55:46.45 [DEBUG] spawned local process as Some(85201) for Process { argv: ["/Users/quentin/Downloads/google-cloud-sdk/bin/gcloud", "-v"], env: {}, working_directory: None, input_digests: InputDigests { complete: DirectoryDigest { digest: Digest { hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>, size_bytes: 0 }, tree: "Some(..)" }, nailgun: DirectoryDigest { digest: Digest { hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>, size_bytes: 0 }, tree: "Some(..)" }, input_files: DirectoryDigest { digest: Digest { hash: Fingerprint<e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855>, size_bytes: 0 }, tree: "Some(..)" }, immutable_inputs: {}, use_nailgun: [] }, output_files: {}, output_directories: {}, timeout: None, execution_slot_variable: None, concurrency_available: 0, description: "Test binary /Users/quentin/Downloads/google-cloud-sdk/bin/gcloud.", level: Debug, append_only_caches: {}, jdk_home: None, platform_constraint: None, cache_scope: PerRestartAlways }
agreeable-oyster-28981
05/29/2022, 3:56 PM/Users/quentin/Downloads/google-cloud-sdk/bin/gcloud -v
Google Cloud SDK 378.0.0
bq 2.0.74
core 2022.03.18
gsutil 5.8
Updates are available for some Google Cloud CLI components. To install them,
please run:
$ gcloud components update
bitter-ability-32190
05/29/2022, 3:57 PMbitter-ability-32190
05/29/2022, 3:57 PM/Users
path and not a sandbox one? Thats the only thing that sticks outagreeable-oyster-28981
05/29/2022, 3:59 PMagreeable-oyster-28981
05/29/2022, 3:59 PMagreeable-oyster-28981
05/30/2022, 12:54 PM08:54:02.38 [WARN] results (FallibleProcessResult(stdout=b'', stdout_digest=FileDigest('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 0), stderr=b'/Users/quentin/Downloads/google-cloud-sdk/bin/gcloud: line 70: readlink: No such file or directory\n/Users/quentin/Downloads/google-cloud-sdk/bin/gcloud: line 84: dirname: No such file or directory\n/Users/quentin/Downloads/google-cloud-sdk/bin/gcloud: line 70: readlink: No such file or directory\n/Users/quentin/Downloads/google-cloud-sdk/bin/gcloud: line 192: /private/var/folders/4s/cp00bpsn0v527nblqlwl1gk40000gn/T/process-executionjfspMg/python: No such file or directory\n/Users/quentin/Downloads/google-cloud-sdk/bin/gcloud: line 192: exec: /private/var/folders/4s/cp00bpsn0v527nblqlwl1gk40000gn/T/process-executionjfspMg/python: cannot execute: No such file or directory\n', stderr_digest=FileDigest('63269a99238d2bb885b5e3e5102bbb07cd617f2056da69f3b865c1012f39df92', 676), exit_code=126, output_digest=Digest('e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 0), platform=<Platform.macos_arm64: 'macos_arm64'>, metadata=ProcessResultMetadata(total_elapsed_ms=17, _source='ran_locally', source_run_id=2)),)
agreeable-oyster-28981
05/30/2022, 12:54 PMagreeable-oyster-28981
05/30/2022, 12:56 PM[docker]
default_repository = "{parent_directory}/{name}"
tools = [
"gcloud",
"docker-credential-gcloud",
"dirname",
"readlink",
"python3",
]
in order to push image to GCR