bazel-deps
bazel-deps copied to clipboard
coursier_test on master failed with error: FileNotFoundException: [...]/.structure.lock (Operation not permitted)
Hi Oscar,
I checked out master and ran bazel test //... immediately. The test for coursier_test failed. Here's what test.log says:
Executing tests from //test/scala/com/github/johnynek/bazel_deps:coursier_test
-----------------------------------------------------------------------------
[36mDiscovery starting.[0m
[36mDiscovery completed in 87 milliseconds. [0m
[36mRun starting. Expected test count is: 7 [0m
[32mCoursierTest: [0m
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[31m- test bouncycastle example *** FAILED *** (846 milliseconds) [0m
[31m java.io.FileNotFoundException: /Users/haikalpribadi/Library/Caches/Coursier/v1/.structure.lock (Operation not permitted) [0m
[31m at java.io.FileOutputStream.open0(Native Method) [0m
[31m at java.io.FileOutputStream.open(FileOutputStream.java:270) [0m
[31m at java.io.FileOutputStream.<init>(FileOutputStream.java:213) [0m
[31m at java.io.FileOutputStream.<init>(FileOutputStream.java:162) [0m
[31m at coursier.CachePath.withStructureLock(CachePath.java:112) [0m
[31m at coursier.Cache$.coursier$Cache$$withStructureLock(Cache.scala:74) [0m
[31m at coursier.Cache$.coursier$Cache$$withLockOr(Cache.scala:88) [0m
[31m at coursier.Cache$$anonfun$remote$1$1.apply(Cache.scala:662) [0m
[31m at coursier.Cache$$anonfun$remote$1$1.apply(Cache.scala:544) [0m
[31m at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24) [0m
[31m at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24) [0m
[31m at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [0m
[31m at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [0m
[31m at java.lang.Thread.run(Thread.java:748) [0m
...
Any idea on what could be the cause?
ps: I didn't know you could do //.... What does the label mean and where is it documented?
The exception seems to indicate it cannot make a file I guess Coursier uses for caching.
I don’t know why the tests pass for me, I assume they do and they do in CI.
We should not be using some random directory automatically, we should find why Coursier is using that directory I guess by reading the Coursier docs or source.
// means the root of the project in bazel and ... means all targets. So //... means all targets in the whole project.
You can use ... with other paths too, e.g. bazel build foo/... this is a relative path to foo and all targets under foo.
@haikalpribadi: https://docs.bazel.build/versions/master/command-line-reference.html#target-pattern-syntax
You're right, it's coursier, rather than slf4j. Should have read the logs better. I've updated the issue title now.
Seems like there are 2 related issues out there: https://github.com/lihaoyi/Ammonite/issues/798 and https://github.com/coursier/coursier/issues/673
I've checked that there were no read/write permission issues. Both issues above seem to show that it's related to the OS filesystem, though. Does this ring any bell for you?
And thanks for the //... explanation too, @johnynek and @promiseofcake. So much to learn on Bazel!
Maybe sandboxfs blocking access to $HOME/.cousier? These lines seem to disable it in CI https://github.com/johnynek/bazel-deps/blob/823d48443d546033882e8150fa6be2c10061febc/.bazelrc.travis#L13-L18
I was getting the same error (on osx). I copied/pasted .bazelrc.travis -> .bazelrc and the error disappeared. Bazel 0.17.2 installed with brew.
https://blog.bazel.build/2017/08/25/introducing-sandboxfs.html says disabled by default. Maybe that's changed since.
I'm seeing this as well when using a genrule that runs a code generator that uses scalafmt-dynamic to format sources after generation.
I assume the sandboxing is making the tests fail since they may use some undeclared files. I'm not sure how that relates to a genrule in your repo though.
closed by #320