I want to pass a folder as a dependency for a py_test in Bazel. This contains file names with the special character '=', such as 'equal=.txt'. I receive a terminal print that the file could not be found by 'zipper.exe'. Here is a minimal example.
BUID file:
py_test(
name = "bazel_char_test",
srcs = ["bazel_char_test.py"],
data = ["equal.txt"]+["equal = .txt"],
)
Error message:
ERROR: C:/path/BUILD:31:8: Building Python zip: //project_path:bazel_char_test failed: (Exit -1): zipper.exe failed: error executing PythonZipper command (from target //project_path:bazel_char_test) external\bazel_tools\tools\zip\zipper\zipper.exe cC bazel-out/x64_windows-fastbuild/bin/project_path/bazel_char_test.zip ... (remaining 1 argument skipped) File .txt=project_path/equal = .txt does not seem to exist.Target //project_path:bazel_char_test failed to build
I checked it and the file exists. If I change the char from '=' to '+', the file can be found and the test starts.
So the failure happens while executing the 'zipper.exe / PythonZipper command'. Assuming I equate the filename with the targetname and packagename, this should fit regarding to the BAZEL documentation, it should handle a file name with an equal sign. "Target names must be composed entirely of characters drawn from the set a–z, A–Z, 0–9, and the punctuation symbols !%-@^_"#$&'()-+,;<=>?[]{|}~/..*". It seems as if the very existence of the = sign leads to an Error. Whether it has spaces in front of or after it doesn't seem to matter.
Does anyone knows what happens here/ what I am doing wrong? I am using Bazel 7.5.0. Of course a workaround could be to change the filenames (An equal sign as the filename is not the best choice in my opinion), but would be glad if they can stay the same.
The problem is likely not the =
but the spaces around it. There's an [old long-running Bazel bug report about this issue](https://github.com/bazelbuild/bazel/issues/374).