Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows support - scala_test #718

Merged
merged 11 commits into from
May 8, 2019

Conversation

majcherm-da
Copy link
Contributor

This is based on (includes it) the work done as part of: #717 (Windows support) - it fixes scala_test rule on Windows. Before this change scala_test was using a bit hacky way to pass scala test's Runner arguments by providing a bash script with arguments instead of a java executable (https://github.com/bazelbuild/rules_scala/blob/master/scala/private/rule_impls.bzl#L560). After changes done in #717 bash script is not used on Windows at all, so the workaround for passing args in an embedded bash script is not taken into account at all. With this change args are written into a file and read by the scala-test java wrapper (io.bazel.rulesscala.scala_test.Runner), which was already in place for other reasons. Java wrapper also uses the com.google.devtools.build.runfiles.Runfiles now to obtain absolute paths instead of relying on relative paths, which didn't work on Windows.

Sample test run on Windows:
rules_scala_sample_test

A distilled changed between initial windows support (#717) and this one can be viewed here: https://github.com/majcherm-da/rules_scala/pull/1/files

@johnynek
Copy link
Member

johnynek commented Apr 3, 2019

Is there any way we can get the CI to run for Windows? I’d love to merge this and not break people again.

Does Travis support windows?

@majcherm-da
Copy link
Contributor Author

@johnynek Travis has (limited) Windows support. I setup a Windows pipeline, but as language: java is not supported in Travis for Windows I switched to sh and provided jdk manually.

Test suite on Windows is pretty limited because several rules still do not work properly, but at least basic ones like, scala_binary, scala_test, scala_test_suite and few others now work properly.

@johnynek
Copy link
Member

johnynek commented Apr 5, 2019

This looks really great! Thanks for working so hard for this.

I did see this:

Exception in thread "main" java.lang.OutOfMemoryError: Metaspace

Do you think we can increase memory settings to address that?

@majcherm-da majcherm-da force-pushed the windows_scala_test branch 6 times, most recently from 3dab96b to af2c93d Compare April 8, 2019 13:45
@majcherm-da
Copy link
Contributor Author

@majcherm-da
Copy link
Contributor Author

@johnynek, @ittaiz could you have a look if there's anything else missing or it could be merged now?

@johnynek
Copy link
Member

Sorry for the latency. The reproducibility test is flakey with jmh. We haven’t run it down yet.

I’ll review tomorrow. I’d love to have windows support. Thanks for all your work on this!

@majcherm-da
Copy link
Contributor Author

@johnynek, @ittaiz Is there any chance to get this reviewed maybe this week? :)

Copy link
Member

@ittaiz ittaiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
First let me apologize for the very long delay.
My mail is a mess ever since google killed inbox and I had to move to gmail :(
Second I want to thank you for all your hard work on getting windows support in. Well done.

I wrote several comments inside but the biggest one is:
Will we have a cat-mouse game of catchup where some PRs break windows support (Because coverage is limited) and then we try to fix it? Mainly asking because the support feels a bit provisory and in a few different places.
It's much better than no support but this is something I'm left with after reviewing the PR

scala/scala.bzl Show resolved Hide resolved
src/java/io/bazel/rulesscala/scalac/ScalacProcessor.java Outdated Show resolved Hide resolved
src/java/io/bazel/rulesscala/scalac/ScalacProcessor.java Outdated Show resolved Hide resolved
src/java/io/bazel/rulesscala/scalac/ScalacProcessor.java Outdated Show resolved Hide resolved
src/java/io/bazel/rulesscala/exe/BUILD Outdated Show resolved Hide resolved
scala/private/rule_impls.bzl Show resolved Hide resolved
scala/private/rule_impls.bzl Outdated Show resolved Hide resolved
scala/private/rule_impls.bzl Show resolved Hide resolved
scala/private/rule_impls.bzl Show resolved Hide resolved
@majcherm-da majcherm-da force-pushed the windows_scala_test branch 2 times, most recently from 8db9512 to ba84fdd Compare April 30, 2019 08:37
@majcherm-da majcherm-da force-pushed the windows_scala_test branch 2 times, most recently from d8848f1 to ebd2167 Compare April 30, 2019 09:48
@majcherm-da
Copy link
Contributor Author

@ittaiz Thanks for the review! I already addressed / responded to all your comments. PTAL

@johnynek johnynek mentioned this pull request Apr 30, 2019
Copy link
Member

@johnynek johnynek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all this work! I'm happy to merge when @ittaiz is. I added some small notes. I hope we can add a link to an issue tracking the lack of ctx API for getting the OS.

scala/private/rule_impls.bzl Show resolved Hide resolved
scala/private/rule_impls.bzl Show resolved Hide resolved
@majcherm-da majcherm-da force-pushed the windows_scala_test branch from ebd2167 to beefdfc Compare May 7, 2019 09:47
@johnynek
Copy link
Member

johnynek commented May 8, 2019

I am going to merge since I think we've given @ittaiz time enough. We can follow up as needed.

Thanks for the help on this!

@johnynek johnynek merged commit 78104d8 into bazelbuild:master May 8, 2019
@johnynek johnynek mentioned this pull request Aug 19, 2019
gergelyfabian pushed a commit to gergelyfabian/rules_scala that referenced this pull request May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants