-
-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
system_binary
default fingerprinting behaviour (run without args) fails for many programs and is hard to debug
#19013
Comments
This is me too with |
Actually I can't get this to work..
|
I second this. I was trying to use system_binary(
name="drawio",
binary_name="drawio",
fingerprint_args=["--version"],
) which leads to the __run.sh #!/usr/bin/env bash
# This command line should execute the same process as pants did internally.
cd /tmp/pants-sandbox-lpxUQZ
env -i /opt/drawio/drawio --version When executed manually in the sandbox, it reveals the problem
Drawio relies on the DISPLAY variable which is lost after executing with |
Describe the bug
system_binary
is nifty in 2.16, and it supports running the underlying program to 'fingerprint' it. For the simple case of no explicitfingerprint_...
args, this translates to running it without any args, e.g.system_binary(name="git", binary_name="git")
will rungit
.This sort of invocation returns non-zero (fails) for many programs, like
git
,npm
, evensed
on some systems. The pants output doesn't make it at all obvious what the problem is.Reproducer:
Lightly edited output of
bash ./script.sh
This is confusing for users as the output explicitly says "could not find a binary", despite them several of them clearly existing. In addition, the docs are somewhat ambiguous, potentially suggesting fingerprinting may only happen if
fingerprint
is specified:Some (not mutually exclusive) options for improving this:
git
" or somethingfingerprint...
configfingerprint_args=[]
, the user has to write thatThe backend in question is still experimental.
Pants version
2.16.0rc2
OS
macOS
Additional info
Encountered in practice in https://pantsbuild.slack.com/archives/C046T6T9U/p1684197510244099 (
git
) and 329da41 (sed
)The text was updated successfully, but these errors were encountered: