cool-easter-32542
12/19/2023, 10:23 PMpants list ::, and you don't have the declared pants_version installed yet, pants starts downloading the new version and writes the progress to stdout instead of stderr.
Pants version
2.18.1
OS
Ubuntu 22.04
Additional info
Here is a test `test_script.sh`:
#!/bin/bash
testScript() {
assertEquals "$(pants list ::)" "//:file"
}
oneTimeSetUp() {
echo '
[GLOBAL]
pants_version = "2.20.0dev1"
backend_packages = []
' >pants.toml
echo 'data' >file.txt
echo 'file(name="file", source="file.txt")' >BUILD
}
Here is `pants.toml`:
[GLOBAL]
pants_version = "2.18.1"
backend_packages = [
"pants.backend.shell",
]
Here is `BUILD`:
shunit2_tests(name="tests")
Here is what you get when you run pants --no-local-cache test test_script.sh (make sure to switch pants version to a version you don't have installed):
$ pants --no-local-cache test test_script.sh
23:06:57.25 [ERROR] Completed: Run tests with Shunit2 - //test_script.sh:tests - failed (exit code 1).
testScript
ASSERT:expected:<Found existing installation: setuptools 58.1.0
Uninstalling setuptools-58.1.0:
Successfully uninstalled setuptools-58.1.0
//:file> but was:<//:file>
Ran 1 test.
FAILED (failures=2)
Bootstrapping Pants 2.19.0rc2
Installing pantsbuild.pants==2.19.0rc2 into a virtual environment at /home/grihabor/.cache/nce/3d6643e46b53e4cc0b2a0d5c768866226ddce3de1f57f80c4a02d8d39800fa8e/bindings/venvs/2.19.0rc2
New virtual environment successfully created at /home/grihabor/.cache/nce/3d6643e46b53e4cc0b2a0d5c768866226ddce3de1f57f80c4a02d8d39800fa8e/bindings/venvs/2.19.0rc2.
23:06:56.99 [INFO] Initializing scheduler...
23:06:57.13 [INFO] Scheduler initialized.
shunit2:ERROR testScript() returned non-zero return code.
ā //test_script.sh:tests failed in 22.08s.
I've put everything in a repo to easily test https://github.com/grihabor/pants-writes-to-stdout-bug/tree/master
(make sure to switch pants version to a version you don't have installed)
pantsbuild/pants