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

Adds CoursierWrapperProcess and JvmProcess, makes JVM executions less tenuous #14270

Merged
merged 17 commits into from
Jan 27, 2022

Conversation

chrisjrn
Copy link
Contributor

@chrisjrn chrisjrn commented Jan 26, 2022

This PR, in support of #13942 simplifies the calling sites of JVM utilities through standard process requests that invoke the respective bash wrapper scripts in a standard way, including specifying standard immutable/append-only caches and environment variables where necessary.

This will make it easier to systematically amend the execution environment for JVM progress invocations, such as adding a dependency on grep (see #13942) and should make future JVM tool additions more proactively use nailgun (nailgun support for JvmProcess is opt-out instead of opt-in).

Google Java Format, scalafmt, Junit, and Scalatest now use nailgun where they previously did not.

Closes #13871

Christopher Neugebauer added 12 commits January 24, 2022 15:29
# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
This reverts commit d752b3f.

# Conflicts:
#	src/python/pants/jvm/compile.py
#	src/python/pants/jvm/resolve/coursier_setup.py

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@chrisjrn chrisjrn requested a review from stuhood January 26, 2022 20:16
description=f"Run JUnit 5 ConsoleLauncher against {request.field_set.address}",
level=LogLevel.DEBUG,
cache_scope=cache_scope,
# TODO: Should scalatest use nailgun? It previously wasn't.
use_nailgun=False,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this correct?

Copy link
Member

Choose a reason for hiding this comment

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

Yes: #13871.

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
Copy link
Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

This is a really, really nice change. Thanks!

@@ -91,9 +91,9 @@ async def build_processors(bash: BashBinary, jdk_setup: JdkSetup) -> JavaParserC
# NB: We do not use nailgun for this process, since it is launched exactly once.
Copy link
Member

Choose a reason for hiding this comment

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

This process should set use_nailgun=False so that this comment remains true.

merged_sources_digest=merged_sources_digest,
immutable_input_digests=FrozenDict(immutable_input_digests),
jdk_invoke_args=jdk_invoke_args,
extra_immutable_input_digests=FrozenDict(extra_immutable_input_digests),
Copy link
Member

Choose a reason for hiding this comment

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

The wrapping FrozenDict here shouldn't be necessary anymore I think.

Also, I think that these need to be nailgun keys as well: they are the classpath of the tool itself.

description=f"Run Scalatest runner for {request.field_set.address}",
level=LogLevel.DEBUG,
cache_scope=cache_scope,
# TODO: Should scalatest use nailgun? It previously wasn't.
Copy link
Member

Choose a reason for hiding this comment

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

See #13871 on that topic. But for now: no.

Christopher Neugebauer added 2 commits January 26, 2022 12:42
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
Copy link
Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

Thanks!

description=f"Run JUnit 5 ConsoleLauncher against {request.field_set.address}",
level=LogLevel.DEBUG,
cache_scope=cache_scope,
# TODO: Should scalatest use nailgun? It previously wasn't.
use_nailgun=False,
Copy link
Member

Choose a reason for hiding this comment

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

Yes: #13871.

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@chrisjrn
Copy link
Contributor Author

@stuhood In which case, can you check that the changes in cda0b74 are correct?

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@chrisjrn chrisjrn merged commit 1a2fa31 into pantsbuild:main Jan 27, 2022
@chrisjrn chrisjrn deleted the chrisjrn/13942-jvm-process-refactor branch January 27, 2022 00:17
@stuhood
Copy link
Member

stuhood commented Jan 27, 2022

@stuhood In which case, can you check that the changes in cda0b74 are correct?

No, it doesn't look like it. scalatest now seems to cache test results via nailgun, such that any changes to the test are ignored. Not sure how that's possible, but that bit of this PR should be reverted until we can take a look at #13871 in isolation.

Sorry that I didn't see this sooner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use nailgun for junit and scalatest
2 participants