-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a regression that breaks scalapb when jvm_flags are set on the to…
…olchain (#806) * Fix a regression that breaks scalapb when jvm_flags are set on the toolchain * Move passing manual tests to new directory
- Loading branch information
1 parent
ff41ec6
commit 96176ae
Showing
10 changed files
with
145 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This directory contains tests that require extra setup such as extra bazel flags. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
load("//scala:scala_toolchain.bzl", "scala_toolchain") | ||
load("//scala:scala.bzl", "scala_test") | ||
|
||
scala_toolchain( | ||
name = "failing_toolchain_impl", | ||
# This will fail because 1M isn't enough | ||
scala_test_jvm_flags = ["-Xmx1M"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
toolchain( | ||
name = "failing_scala_toolchain", | ||
toolchain = "failing_toolchain_impl", | ||
toolchain_type = "@io_bazel_rules_scala//scala:toolchain_type", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
scala_toolchain( | ||
name = "passing_toolchain_impl", | ||
# This will pass because 1G is enough | ||
scala_test_jvm_flags = ["-Xmx1G"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
toolchain( | ||
name = "passing_scala_toolchain", | ||
toolchain = "passing_toolchain_impl", | ||
toolchain_type = "@io_bazel_rules_scala//scala:toolchain_type", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
scala_test( | ||
name = "empty_test", | ||
srcs = ["EmptyTest.scala"], | ||
) | ||
|
||
scala_test( | ||
name = "empty_overriding_test", | ||
srcs = ["EmptyTest.scala"], | ||
# This overrides the option passed in on the toolchain, and should BUILD, even if | ||
# the `failing_scala_toolchain` is used. | ||
jvm_flags = ["-Xmx1G"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package test_expect_failure.scala_test_jvm_flags | ||
|
||
import org.scalatest.FunSuite | ||
|
||
class EmptyTest extends FunSuite { | ||
test("empty test") { | ||
assert(true) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
load("//scala:scala_toolchain.bzl", "scala_toolchain") | ||
load("//scala:scala.bzl", "scala_library") | ||
load( | ||
"//scala_proto:scala_proto.bzl", | ||
"scalapb_proto_library", | ||
) | ||
|
||
scala_toolchain( | ||
name = "failing_toolchain_impl", | ||
# This will fail because 1M isn't enough | ||
scalac_jvm_flags = ["-Xmx1M"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
toolchain( | ||
name = "failing_scala_toolchain", | ||
toolchain = "failing_toolchain_impl", | ||
toolchain_type = "@io_bazel_rules_scala//scala:toolchain_type", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
scala_toolchain( | ||
name = "passing_toolchain_impl", | ||
# This will pass because 1G is enough | ||
scalac_jvm_flags = ["-Xmx1G"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
toolchain( | ||
name = "passing_scala_toolchain", | ||
toolchain = "passing_toolchain_impl", | ||
toolchain_type = "@io_bazel_rules_scala//scala:toolchain_type", | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
scala_library( | ||
name = "empty_build", | ||
srcs = ["Empty.scala"], | ||
) | ||
|
||
scala_library( | ||
name = "empty_overriding_build", | ||
srcs = ["Empty.scala"], | ||
# This overrides the option passed in on the toolchain, and should BUILD, even if | ||
# the `failing_scala_toolchain` is used. | ||
scalac_jvm_flags = ["-Xmx1G"], | ||
) | ||
|
||
proto_library( | ||
name = "test", | ||
srcs = ["test.proto"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
# This is a regression test for a bug that broke compiling scalapb targets when | ||
# `scalac_jvm_flags` was set on the toolchain. | ||
scalapb_proto_library( | ||
name = "proto", | ||
visibility = ["//visibility:public"], | ||
deps = [":test"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package test_expect_failure.scalac_jvm_opts | ||
|
||
class Empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
syntax = "proto2"; | ||
|
||
option java_package = "test.proto"; | ||
|
||
message TestResponse1 { | ||
optional uint32 c = 1; | ||
optional bool d = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters