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

Support runtime JDK config #1387

Merged
merged 1 commit into from
Nov 4, 2020
Merged

Support runtime JDK config #1387

merged 1 commit into from
Nov 4, 2020

Conversation

Duhemm
Copy link
Collaborator

@Duhemm Duhemm commented Oct 22, 2020

Previously, Bloop would support only a single JDK configuration per
project, which would apply to both compile-time and runtime. However,
some tools (e.g. Pants) support defining a different JDK configuration
for compile-time and runtime.

To be able to export faithfully builds from these tools, Bloop needs to
support this kind of configuration as well. This commit adds a new
field, runtimeConfig, to JVM projects' platform configuration, which
has the same schema as the existing config.

The config is used to configure the compile-time configuration,
whereas runtimeConfig is used for runtime. When runtimeConfig
doesn't exist, Bloop falls back to config.

@Duhemm Duhemm added task / compile task / run task / test configuration format Assigned to any ticket or pull request that will change the configuration file format. labels Oct 22, 2020
@Duhemm Duhemm requested review from olafurpg and jvican October 22, 2020 12:35
Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

Only minor code style comments. Otherwise looks great! Thank you for implementing this new feature 😄

"""/a/A.scala
|object A {
| def main(args: Array[String]): Unit = {
| assert("goodbye" == sys.props("test"))
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be tricky to implement, but how hard would it be to assert that the runtime property is not available at compile-time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It would be difficult to test, because we fork compilation only for Java, and under certain conditions only (ie. the Java home is different from the current Java). I guess we'd need a Java annotation processor that would check for the property?

Previously, Bloop would support only a single JDK configuration per
project, which would apply to both compile-time and runtime. However,
some tools (e.g. Pants) support defining a different JDK configuration
for compile-time and runtime.

To be able to export faithfully builds from these tools, Bloop needs to
support this kind of configuration as well. This commit adds a new
field, `runtimeConfig`, to JVM projects' `platform` configuration, which
has the same schema as the existing `config`.

The `config` is used to configure the compile-time configuration,
whereas `runtimeConfig` is used for runtime. When `runtimeConfig`
doesn't exist, Bloop falls back to `config`.
@Duhemm Duhemm requested review from tgodzik and olafurpg November 4, 2020 16:43
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration format Assigned to any ticket or pull request that will change the configuration file format. task / compile task / run task / test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants