bazel-contrib / bazel-contrib/rules_scala
'No such file or directory' on Windows
- Dominant language
- Starlark
- Stars
- 384
- Forks
- 292
- Avg merge
- 3d 3m
- Merged PRs (30d)
- 42
Description
`rules_scala` doesn't work properly on Windows.
This can be reproduced by building:
bazel test //test:HelloLibTest
on `rules_scala` itself (`test` folder).
After switching to a commit before: https://github.com/bazelbuild/rules_scala/pull/568/files/bd8ff42e35d8f8bb0181aea5cf0439512c6df32e
which introduced another issue (reported here: https://github.com/bazelbuild/rules_scala/issues/642), this is what I'm getting:

It tries to lookup a `JAVABIN` wrapper in `.runfiles` folder, but this one is almost empty on Windows.
(Similar thing happens for `rules_java` - this folder is also almost empty, but in case of `java` a different laucher is used for which this doesn't cause a problem:
https://github.com/bazelbuild/bazel/blob/556839466dd49958a6b058a3a4c2ad341c8d06f1/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaSemantics.java#L380)
Wrapper script is properly generated, but it resides in the same location as runfiles directory only. On unix boxes the file is present in both locations and thus it works.
Contributor guide
Research direction
Reproduce the Windows failure with `bazel test //test:HelloLibTest` in the repository’s `test` folder. Read the behavior introduced by PR #568 and compare it with the referenced `BazelJavaSemantics.java` launcher logic, focusing on the generated wrapper and `.runfiles` locations. Done means the test runs successfully on Windows without the missing `JAVABIN` error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100