Skip to content
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

Set a friendlier PANTS_BIN_NAME #111

Closed
jsirois opened this issue Feb 8, 2023 · 1 comment · Fixed by #112
Closed

Set a friendlier PANTS_BIN_NAME #111

jsirois opened this issue Feb 8, 2023 · 1 comment · Fixed by #112
Assignees
Labels
enhancement New feature or request feature request Denotes a request for a new scie-pants feature.

Comments

@jsirois
Copy link
Contributor

jsirois commented Feb 8, 2023

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 pantsbuild/pants#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.

@jsirois jsirois added enhancement New feature or request feature request Denotes a request for a new scie-pants feature. labels Feb 8, 2023
@jsirois jsirois self-assigned this Feb 8, 2023
@jsirois jsirois added the in progress Denotes an assigned issue is being actively worked on. label Feb 8, 2023
jsirois added a commit to jsirois/scie-pants that referenced this issue Feb 8, 2023
Previously scie-pants over-rode Pants help defaulting to `./pants`
in help text by passing `--pants-bin-name` as the absolute path of
scie-pants. Now scie-pants passes the exact argv0 string it was
invoked with and it does so using the `PANTS_BIN_NAME` env var instead
of `--pants-bin-name` to support users over-riding this.

Closes pantsbuild#111
@jsirois
Copy link
Contributor Author

jsirois commented Feb 8, 2023

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.

jsirois added a commit that referenced this issue Feb 8, 2023
Previously scie-pants over-rode Pants help defaulting to `./pants`
in help text by passing `--pants-bin-name` as the absolute path of
scie-pants. Now scie-pants passes the exact argv0 string it was
invoked with and it does so using the `PANTS_BIN_NAME` env var instead
of `--pants-bin-name` to support users over-riding this.

Closes #111
@jsirois jsirois removed the in progress Denotes an assigned issue is being actively worked on. label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request Denotes a request for a new scie-pants feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant