Currently the absolute path of scie-pants is used. This is correct, but in the common case its verbose and not what the user actually typed. Worse, Pants uses this value in ways it probably should not and gets absolute paths written into files where they do not belong.
See https://github.com/pantsbuild/pants/issues/18202, but the idea is to just use the basename of scie-pants if it is on the PATH and otherwise relativize it if it is within the BUILDROOT tree finally falling back to the current absolute path in all other cases.
The above prescription was much more complex than need be. The argv0 reflects exactly what the user typed; so it's more robust, faster and of perfect fidelity.
Currently the absolute path of scie-pants is used. This is correct, but in the common case its verbose and not what the user actually typed. Worse, Pants uses this value in ways it probably should not and gets absolute paths written into files where they do not belong.
See https://github.com/pantsbuild/pants/issues/18202, but the idea is to just use the basename of scie-pants if it is on the PATH and otherwise relativize it if it is within the
BUILDROOT
tree finally falling back to the current absolute path in all other cases.