https://pantsbuild.org/ logo
#development
Title
# development
c

curved-television-6568

09/23/2021, 7:00 AM
OK, here’s another issue… seems like there is no
cd
command in the CI test env? [SOLVED]
Copy code
pants.engine.process.BinaryNotFoundError: Cannot find `cd` on `['/bin', '/home/linuxbrew/.linuxbrew/bin', '/home/linuxbrew/.linuxbrew/sbin', '/home/runner/.cache/pants/pants_dev_deps/Linux.x86_64.x86_64.py37.venv/bin', '/home/runner/.config/composer/vendor/bin', '/home/runner/.dotnet/tools', '/home/runner/.local/bin', '/opt/hostedtoolcache/Java_Adopt_jdk/11.0.11-9/x64/bin', '/opt/hostedtoolcache/Python/2.7.18/x64/bin', '/opt/hostedtoolcache/Python/3.5.10/x64/bin', '/opt/hostedtoolcache/Python/3.6.15/x64/bin', '/opt/hostedtoolcache/Python/3.7.12/x64', '/opt/hostedtoolcache/Python/3.7.12/x64/bin', '/opt/hostedtoolcache/Python/3.8.11/x64/bin', '/opt/hostedtoolcache/Python/3.9.7/x64/bin', '/opt/pipx_bin', '/sbin', '/snap/bin', '/usr/bin', '/usr/games', '/usr/local/.ghcup/bin', '/usr/local/bin', '/usr/local/games', '/usr/local/sbin', '/usr/sbin', '/usr/share/rust/.cargo/bin']`. Please ensure that it is installed so that Pants can execute experimental_shell_command src:paths.
👀 1
OK, took for ever, but I managed to repro this in a ubuntu docker image..
Copy code
pants.engine.process.BinaryNotFoundError: Cannot find `cd` on `['/bin', '/root/.cache/pants/pants_dev_deps/Linux.x86_64.x86_64.py38.venv/bin', '/root/.cargo/bin', '/sbin', '/usr/bin', '/usr/local/bin', '/usr/local/sbin', '/usr/sbin']`. Please ensure that it is installed so that Pants can execute experimental_shell_command src:paths.
Ok, I see the issue… seems like the
cd
command is a builtin one, in that version of bash…
Copy code
# on my Mac
$ which cd
/usr/bin/cd

# on Ubuntu 20.04
root@7a8366367869:/src# which cd
root@7a8366367869:/src#
or something… both bash’es are 5.0.x so pretty close…
oh.. it’s my Mac that’s dumb, the
cd
is always builtin.. only there’s some weird script for it on my system..
OK, that makes the fix easy-ish. Should probably have a “whitelist” of builtins, so if listed as a tool, ignore it for purpose of discovering its path.
👍 1
Phew. It passed, and merged now 😂
❤️ 1
It would be cool with a follow up to infer dependencies to any
shell_library
required based on inspecting the
command
😉
💯 1
Hmm… there seems to have been an issue with the lint step in the actions for main, something with java…
Copy code
Exception: Failed to execute: Process {
    argv: [
        "/home/runner/.cache/coursier/jvm/adopt@1.11.0-11/bin/java",
        "-version",
    ],
h

hundreds-father-404

09/23/2021, 1:58 PM
Hm cc @fast-nail-55400, should we skip that for now to stabilize CI?
f

fast-nail-55400

09/23/2021, 1:59 PM
yes, I need to land at least https://github.com/pantsbuild/pants/pull/12992 to limit caching
and probably need to add the JDK to more of the CI jobs
h

hundreds-father-404

09/23/2021, 2:16 PM
In the meantime, could we disable the CI checks rather than fixing forward?
f

fast-nail-55400

09/23/2021, 2:18 PM
I thought you were asking for permission to disable them? And I agreed.
is there a way to have a “flag” to enable/disable all of the Java tests at once?
marking them all disabled will make enabling harder locally when trying to test
h

hundreds-father-404

09/23/2021, 2:22 PM
Oh no sorry I'm trying to get out the door for this flight, afk That only flag would be a skip_tests field, which isn't yet implemented for Junit but should be in a follow up. Otherwise, I think you'd have to comment out the targets. Or disable backend and ignore BUILD files
f

fast-nail-55400

09/23/2021, 2:22 PM
or pytest probably has a decorator
👍 1
these tests aren’t JUnit tests, they are Python integration tests invoking JDK/JVM rules
h

hundreds-father-404

09/23/2021, 2:29 PM
Oh! Pants also now has a skip_tests (skip_pytest?) field too
f

fast-nail-55400

09/23/2021, 2:37 PM
I was thinking of using
@pytest.mark.skipif("PANTS_RUN_JDK_TESTS" not in os.environ, reason="Skip JDK tests")
Then I could just run Pants with
PANTS_RUN_JDK_TESTS
to still run the tests.
👍 1