Testing out Pants 2.14 and hit a surprising change...
# development
s
Testing out Pants 2.14 and hit a surprising change of behavior. I honestly don’t know how the previous behavior worked at all, but wanted to flag it in case it’s a regression. We have a dir with:
Copy code
common.sh
test_common.sh
BUILD.pants
where
test_common.sh
invokes
common.sh
, and the
BUILD.pants
file had:
Copy code
shell_sources()

shunit2_tests(name="tests", shell="bash")
this worked fine in v2.13, but on v2.14.0rc0
test_common.sh
started failing with a “no such file or directory” error when it tried to invoke
common.sh
. adding an explicit dependency in the
BUILD.pants
made things work again
looking at it, I have no clue how it worked without the explicit dependency before 2.14.x
@hundreds-father-404 is there any chance that https://github.com/pantsbuild/pants/pull/16546 is the cause of the behavior change?
h
Oh hey sorry this didn't get a reply!
Hm, no, I'd be surprised if #16546 was relevant. That should only specify CLI args behavior Could you plese confirm that
./pants dependencies --transitive test_common.sh
changed between the Pants version? We definitely want to figure out regerssions like this
👍 1
s
before:
Copy code
$ ./pants dependencies --transitive build/pants/ci/test_common.sh
build/pants/ci/common.sh
after:
Copy code
$ ./pants dependencies --transitive build/pants/ci/test_common.sh
I am more surprised it was working in 2.13.x w/o an explicit dependency - is there shell<->shell dependency inference?
h
there is! we run Shellcheck to parse your
source
statements
the sole thing that has changed here is Pants version? Not the bash code itself?
s
Yup!
I can file an issue too now that I know it's a regression
I had no clue there was inference here 🤯
h
that would help, especially if you can please include the file content. Fine if you have to scrub stuff, only lines with
source "foo"
and
. "foo"
should be relevant
yeah, the Shell backend is prob my favorite 😎
s