Closed pfiaux closed 6 months ago
I think you might need to use sh_library
instead of filegroup
for the target :scripts
.
deps
is supposed to be used to declare executable deps, but the dep target itself must be executable. While I think it is confusing that the old version used to work for you with deps = [ ...]
, its current behavior is correct strictly speaking.
This is because data
is supposed to declare non-executable files and filegroups, while deps
declares executable files, such as libraries.
In the case of scripts, the difference is of course purely academic, since all files are interpreted. But strictly speaking, the use of data
or filegroup
for executable deps is incorrect.
replacing filegroup
to sh_library
works and no other changes needed (both use srcs
). Thanks for the help and quick reply.
I tried to run the new version (everything runs fine on 0.32.0) but all the tests are now failing with some version of
I tested 0.33.0 initially but it seems to happen in 0.32.1 already, my guess is it is related to https://github.com/filmil/bazel-bats/pull/26
Our tests are mostly structured like this:
The build file looks like:
I added an
ls $BATS_TEST_DIRNAME
to my test case before the run and noticed:.sh
files I expect are presentIf I change
deps = [ ":scripts" ],
todata = [ ":scripts" ],
the files are once more available and it passes. It's a bit surprising for a change in the patch version but maybe we were using it wrong before. Any recommendation here?deps
to bring in multiple scripts?data
rather thandeps
? (it feels wierd to bring executable scripts as data)