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

inconsistent deprecation messaging for use_deprecated_pex_binary_run_semantics #16103

Closed
tdyas opened this issue Jul 8, 2022 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@tdyas
Copy link
Contributor

tdyas commented Jul 8, 2022

With Pants v2.13.0a1, not having the use_deprecated_pex_binary_run_semantics config displays:

15:44:49.52 [WARN] DEPRECATED: the option --use-deprecated-pex-binary-run-semantics defaulting to true is scheduled to be removed in version 2.14.0.dev1.

Currently, running a `pex_binary` by default will not include the source files in the PEX, and will instead put them in a temporary sandbox.

In Pants 2.14, the default will change to instead build the PEX like you had run the `package` goal, and then execute that PEX. This is more consistent and intuitive behavior.

To fix this deprecation, explictly set `use_deprecated_pex_binary_run_semantics` in the `[GLOBAL]` section of `pants.toml`. Set it to `true` to use the "old" behavior. Set it to `false` to use the "new" behavior.

When set to `false`, you can still run the binary as before because you can now run on a `python_source` target. The simplest way to do this is to use `./pants run path/to/file.py`, which will find the owning `python_source`. Pants will run the file the same way it used to with `pex_binary` targets.

Setting the config to False then causes a different deprecation message to appear suggesting to remove the config option:

15:44:19.29 [WARN] DEPRECATED: option 'use_deprecated_pex_binary_run_semantics' in global scope is scheduled to be removed in version 2.15.0.dev0.

If `use_deprecated_pex_binary_run_semantics` is already set explicitly to `false`, simply delete the option from `pants.toml` because `false` is now the default.

If set to `true`, removing the option will cause `run` on a `pex_binary` to package and run the built PEX file. Additionally, the `pex_binary` must be referred to by its address. To keep the old `run` semantics, use `run` on the relevant `python_source` target.

The second config message should not appear until after 2.13.0 is released.

@Eric-Arellano
Copy link
Contributor

Closed by #16108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants