bazel-contrib / bazel-contrib/rules_scala

'No such file or directory' on Windows

Open
#641 3 comments 0 reactions 0 assignees View on GitHub
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:
![scala_rules_runfiles](https://user-images.githubusercontent.com/43614029/48721186-a91b1380-ec21-11e8-978b-9238918ae85d.PNG)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.