Gergely Fábián

Results 122 comments of Gergely Fábián

I experienced some issues when trying to apply the latest version of rules_lint, and also it seems it's ~3 times slower on our monorepo than running rules_scala's scalafmt (with parallelized...

Seems this exception is starting with JDK 18 (before it was only a warning): https://bz.apache.org/bugzilla/show_bug.cgi?id=65381

Trying to localize this, it seems to occur when trying to compile any Scala code (tried `scala_macro_library`).

Reproduction: https://github.com/gergelyfabian/bazel-scala-example/tree/java_21 ``` bazel build //... ``` The following changes are necessary in .bazelrc, to ensure this is reproducible: ``` build --java_language_version=21 build --java_runtime_version=21 build --tool_java_language_version=21 build --tool_java_runtime_version=21 ```

Even when running on Java 17, when first using rules_scala (and it gets built), there is a warning: ``` INFO: From Building external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/worker/libworker.jar (1 source file) [for tool]: external/io_bazel_rules_scala/src/java/io/bazel/rulesscala/worker/Worker.java:48: warning:...

The workaround from #1425 works. just need to add `-Djava.security.manager=allow` to the scala_toolchain: ``` scala_toolchain( name = "my_toolchain_impl", # ... scalac_jvm_flags = [ "-Djava.security.manager=allow", ], # ... ) ```

The workaround fixes `bazel build //...` in my example project, but `bazel coverage //...` still fails with the same error: ``` at java.base/java.lang.System.setSecurityManager(System.java:429) at io.bazel.rulesscala.worker.Worker.persistentWorkerMain(Worker.java:47) at io.bazel.rulesscala.worker.Worker.workerMain(Worker.java:39) at io.bazel.rulesscala.coverage.instrumenter.JacocoInstrumenter.main(JacocoInstrumenter.java:27) ```

If scalafmt is enabled, it will also fail: ``` Exception in thread "main" java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release at java.base/java.lang.System.setSecurityManager(System.java:429) at...

Note: JDK 21 does not work with Scala 2.12.17, after upgrading to Scala 2.12.18 it works (with the above limitations): https://github.com/scala/scala/releases/tag/v2.12.18