Skip to content

Commit 10f03ac

Browse files
huonwWorkerPants
authored andcommitted
Silence warnings from Pex by default, for now (#20590)
This is a short-term workaround for #20577 and #20586, where Pants' internal/default use of Pex triggers user-visible warnings, and those warnings are now visible due to #20480... so, instead of showing them by default, let's hide them for now. Users with desire for insight into the warnings can still enable this. Doing this means we're not having to rush in fixes for the root causes of these warnings for 2.20.0 stable release, and thus reduce feature-creep/risk. We can/should reenable warnings by default in a future release. Per @cburroughs's idea in #20586 (comment), this explicitly switches it on for the Pants repo itself, so we're eating our own dogfood and catching real and/or spurious errors earlier.
1 parent d3b04f9 commit 10f03ac

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

pants.toml

+2
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ fmt = false
134134

135135
[pex]
136136
venv_use_symlinks = true
137+
# This is off by default, but we want to dogfood it before switching on for everyone.
138+
emit_warnings = true
137139

138140
[python]
139141
# N.B.: When upgrading to a new Python version, you must update the Pants

src/python/pants/backend/python/util_rules/pex_cli_test.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ def test_custom_ca_certs(tmp_path: Path, rule_runner: RuleRunner) -> None:
3434
Process,
3535
[PexCliProcess(subcommand=(), extra_args=("some", "--args"), description="")],
3636
)
37-
assert proc.argv[6:8] == ("--cert", "certsfile")
37+
38+
cert_index = proc.argv.index("--cert")
39+
assert proc.argv[cert_index + 1] == "certsfile"
40+
3841
files = rule_runner.request(DigestContents, [proc.input_digest])
3942
chrooted_certs_file = [f for f in files if f.path == "certsfile"]
4043
assert len(chrooted_certs_file) == 1

src/python/pants/backend/python/util_rules/pex_environment.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,15 @@ def iter_path_entries():
8282
advanced=True,
8383
)
8484
emit_warnings = BoolOption(
85-
default=True,
85+
default=False,
8686
help=softwrap(
8787
"""
8888
If warnings from Pex should be logged by Pants to the console.
89+
90+
Note: Pants uses Pex internally in some ways that trigger some warnings at the moment,
91+
so enabling this may result in warnings not related to your code. See
92+
<https://github.com/pantsbuild/pants/issues/20577> and
93+
<https://github.com/pantsbuild/pants/issues/20586>.
8994
"""
9095
),
9196
)

0 commit comments

Comments
 (0)