-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
plumb through Pex's --check zipapp validation #20481
Conversation
Pex exposes the `--check` flag to "check" if the resulting zipapp can be opened by CPython. Plumb that through so that Pants stops making PEXs that won't work at runtime. NOTE: The default of `error` differs from Pex. I'm struggling to think of a case where one would want a zipapp CPython can't open and Pants has a history of swalling warnings from Pex (`warn` is Pex's default). ref pantsbuild#19957
alias = "check" | ||
valid_choices = ("none", "warn", "error") | ||
expected_type = str | ||
default = "error" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be good to keep this at warn
, to avoid breaking existing users who have a build that works for them when they upgrade pants (e.g. maybe they manipulate the resulting zipapp as a zip file directly somehow... potentially better served with a different layout, but we shouldn't be encouraging that with a hard-error). It'd definitely be fine to switch the default with some sort of deprecation cycle.
default = "error" | |
default = "warn" |
Of course, pants swallowing warnings from PEX isn't so good, but I see you have #20480 to help. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the judgement call going either way. Is there an example for what the deprecation system looks like for changing a default? I saw lots of examples for removing fields/flags, but not changing a default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think of a specific example exactly like this, but there's occasionally options in pants.toml
to control global default behaviour, e.g. https://www.pantsbuild.org/2.13/reference/global-options#use_deprecated_directory_cli_args_semantics, so I could imagine putting an option in the [pex]
subsystem or similar.
(Unresolving just to continue this conversation.)
Thanks! (BTW, I took the liberty of removing the paragraph about the |
Pex exposes the
--check
flag to "check" if the resulting zipapp can be opened by CPython. Plumb that through so that Pants stops making PEXs that won't work at runtime.NOTE: The default of
error
differs from Pex. I'm struggling to think of a case where one would want a zipapp CPython can't open and Pants has a history of swalling warnings from Pex (warn
is Pex's default).ref #19957