I'm seeing something confusing with `system_binary...
# general
l
I'm seeing something confusing with
system_binary
and
fingerprint
. Here's my target:
Copy code
system_binary(
    name="julia",
    binary_name="julia",
    fingerprint=r".*1.11.*",
    fingerprint_args=["-v"],
)
Here's my binary:
Copy code
% /opt/homebrew/bin/julia -v
julia version 1.11.0
Here's what happens when I run the target:
Copy code
% pants run //build-support/pants:julia -- -v

16:31:31.34 [ERROR] 1 Exception encountered:

Engine traceback:
  in `run` goal

ValueError: Could not find a binary with name `julia` with output matching `.*1.11.*` when run with arguments `-v`. The following paths were searched: /usr/bin, /bin, /usr/local/bin, /opt/homebrew/bin.
What seems even odder to me is that if I now switch the fingerprint to be
r".*1.1*0*.*"
, now it works:
Copy code
% pants run //build-support/pants:julia -- -v
julia version 1.11.0
This is very surprising to me. It makes me think I'm misunderstanding how the fingerprint works.
f
What version of Pants?
If you try with the latest 2.24.x dev release, there is better error logging for
system_binary
Prior versions of Pants were not logging errors in running the binaries during fingerprinting and just ignore errors and pretend that the binaries do not exist. The change in 2.24.x and later adds a
log_fingerprinting_errors
field to
system_binary
which defaults to
True
and logs those errors.
I had a similar situation as your one and was also confused why my
system_binary
target could not find a fingerprinted binary.
l
Looks like I'm on 2.22.1rc1, I'll try it with 2.24.x and see what I can see!
Ok, that did help me find one issue! (A broken symlink to a binary with that name.) But I'm still seeing both false negatives and false positives. I suspect I would need to go add more logging to get to the bottom of this. Thanks for your help @fast-nail-55400.