Open thirtyseven opened 3 years ago
I'm not sure what makes the most sense here without adding in a lot of complexity.
Could we create a separate subdirectory for each jar so that there won't be any conflicts?
Could we create a separate subdirectory for each jar so that there won't be any conflicts?
Not sure that would work, since the case I illustrated above only has one jar.
Issue
When jarjar_runner.sh processes a jar that contains multiple files that differ only in the case of their filename, they will be incorrectly flagged as duplicates when running on a case-insensitive filesystem like macOS's default APFS root volume.
BUILD.bazel:
Steps to reproduce:
Download test.zip (just a zip with three empty files:
test
,TEST
, andbuild-data.properties
)Possible solutions
One solution I have tested is to modify jarjar_runner.sh to extract the jars to a temporary sparse disk image created with a case-sensitive filesystem mounted to a tmp directory. However, I've found that this approach is "leaky", i.e. if you ctrl-C the bazel build before it finishes, the user will have a volume mounted that they then will have to manually unmount. I tried to solve this by adding a
trap
command to jarjar_runner.sh, however, it never seemed to get triggered, probably due to some subtlety of being called fromprocess-wrapper
.Another solution would be to replace jarjar_runner.sh with a Python script that uses the stdlib zipfile library to interact with the jar files to avoid interacting with the native FS.