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

PEX runtime warnings should have a knob to squelch #677

Closed
jsirois opened this issue Feb 25, 2019 · 3 comments
Closed

PEX runtime warnings should have a knob to squelch #677

jsirois opened this issue Feb 25, 2019 · 3 comments
Assignees

Comments

@jsirois
Copy link
Member

jsirois commented Feb 25, 2019

I'm not sure the knob should default on or off, but some from of warning control makes sense since once a pex is built, it will emit this warning on every run which does not seem useful past the first time a human acknowledges the issue - which they may not even be able to fix easily if due to 3rdparty deps.

@Eric-Arellano
Copy link
Contributor

I’d propose turning on by default, and making it very clear how to turn it off. If we default to off, I’m concerned few would discover it’s even an option.

For the 3rd party dependency issue, if we default to the messages being on then we may need a way to silence the errors other than a CLI flag to PEX, such as using an env var.

@jsirois
Copy link
Member Author

jsirois commented Feb 25, 2019

Since these are runtime warnings, we can't really use a flag unless we co-opt -W from python like we did -c, and -m, but even then that only works if the pex is run in interpreter mode since we can't otherwise steal argv. An env var seems to be all that remains then and isn't awesome from an ergonomics perspective since you have to always run the pex with the env var to get the desired effect; ie: the solution is not self-contained. Perhaps adding a build-time option and embedding the choice in PEX-INFO would be good enough:

  1. Build the pex
  2. Run it and notice warning you can't do anything about short-term
  3. Re-build the pex with --no-emit-warnings
  4. If you actually want to see warnings now you have to PEX_EMIT_WARNINGS=1 ./pex.

@Eric-Arellano
Copy link
Contributor

I agree env var is not ergonomic. We certainly wouldn’t expect someone to have to permanently source it from their .bashrc or anything, which would mean always having to remember to set it.

I like the build time option the most. I like it because it has a sensible default and will provide instructions for how to turn it off permanently for that PEX. The decision is also per-PEX, in that you might want to silence for one but keep for another, which is good to not assume the user wants something global.

jsirois added a commit to jsirois/pex that referenced this issue Mar 10, 2019
Previously warnings were emitted to stderr unconditionally, but now
both build-time and run-time controls are provided. At build-time
--no-emit-warnings can be specified and a pex will be produced that
does not emit warnings. At run-time, PEX_EMIT_WARNINGS and PEX_VERBOSE
can be used to toggle warning behavior.

Fixes pex-tool#677
jsirois added a commit to jsirois/pex that referenced this issue Mar 10, 2019
Previously warnings were emitted to stderr unconditionally, but now
both build-time and run-time controls are provided. At build-time
--no-emit-warnings can be specified and a pex will be produced that
does not emit warnings. At run-time, PEX_EMIT_WARNINGS and PEX_VERBOSE
can be used to toggle warning behavior.

Fixes pex-tool#677
jsirois added a commit that referenced this issue Mar 11, 2019
Previously warnings were emitted to stderr unconditionally, but now
both build-time and run-time controls are provided. At build-time
--no-emit-warnings can be specified and a pex will be produced that
does not emit warnings. At run-time, PEX_EMIT_WARNINGS and PEX_VERBOSE
can be used to toggle warning behavior.

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

No branches or pull requests

2 participants