Skip to content

8352506: Simplify make/test/JtregNativeHotspot.gmk #24130

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

Closed

Conversation

magicus
Copy link
Member

@magicus magicus commented Mar 20, 2025

The file to setup special arguments to native JTReg Hotspot tests is needlessly complicated. With some generalisation, we can make it much simpler.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8352506: Simplify make/test/JtregNativeHotspot.gmk (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24130/head:pull/24130
$ git checkout pull/24130

Update a local copy of the PR:
$ git checkout pull/24130
$ git pull https://git.openjdk.org/jdk.git pull/24130/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 24130

View PR using the GUI difftool:
$ git pr show -t 24130

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24130.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 20, 2025

👋 Welcome back ihse! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Mar 20, 2025

@magicus This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8352506: Simplify make/test/JtregNativeHotspot.gmk

Reviewed-by: erikj

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 5 new commits pushed to the master branch:

  • 2bc4f64: 8335708: C2: Compile::verify_graph_edges must start at root and safepoints, just like CCP traversal
  • 9a17a6f: 8350749: Upgrade JLine to 3.29.0
  • 91836e1: 8352276: Skip jtreg tests using native executable with libjvm.so/libjli.so dependencies on static JDK
  • 2560a63: 8352131: [REDO] C2: Print compilation bailouts with PrintCompilation compile command
  • 73177d9: 8347734: Turning off PerfData logging doesn't work

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk
Copy link

openjdk bot commented Mar 20, 2025

@magicus The following label will be automatically applied to this pull request:

  • build

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@magicus magicus force-pushed the simplify-hotspot-jtreg-native branch from f6a6c25 to e860144 Compare March 20, 2025 13:00
@magicus magicus marked this pull request as ready for review March 20, 2025 15:20
@magicus
Copy link
Member Author

magicus commented Mar 20, 2025

This has passed hotspot testing for tier1-3 in the Oracle CI system.

@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 20, 2025
@mlbridge
Copy link

mlbridge bot commented Mar 20, 2025

Webrevs

Copy link
Member

@erikj79 erikj79 left a comment

Choose a reason for hiding this comment

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

I think this is ok, but I would like someone with familiarity with these tests to comment on if adding all include dirs to all tests is a good idea.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Mar 20, 2025
Comment on lines +108 to +121
-I$(NSK_SHARE_DIR)/aod \
-I$(NSK_SHARE_DIR)/gc/lock/jni \
-I$(NSK_SHARE_DIR)/gc/lock/jniref \
-I$(NSK_SHARE_DIR)/jdi \
-I$(NSK_SHARE_DIR)/jni \
-I$(NSK_SHARE_DIR)/jvmti \
-I$(NSK_SHARE_DIR)/jvmti/agent_common \
-I$(NSK_SHARE_DIR)/jvmti/aod \
-I$(NSK_SHARE_DIR)/locks \
-I$(NSK_SHARE_DIR)/native \
-I$(TOPDIR)/test/lib/jdk/test/lib/jvmti \
-I$(VM_TESTBASE_DIR)/nsk/stress/jni \
-I$(VM_TESTBASE_DIR)/vm/mlvm/share \
-I$(VM_TESTBASE_DIR)/vm/share \
Copy link
Member

Choose a reason for hiding this comment

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

Including these directories for every native test seems a little risky. Are we sure there are no header files with the same name? Can we not still add these only if the test needs them e.g. if it has vmTestBase in its name for the nsk tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know if it is "risky". Compare this with how all hotspot files are compiled, with all these include directories:

build/macosx-aarch64/hotspot/variant-server/gensrc
build/macosx-aarch64/hotspot/variant-server/gensrc/adfiles
build/macosx-aarch64/support/modules_include/java.base
build/macosx-aarch64/support/modules_include/java.base/darwin
open/src/hotspot/cpu/aarch64
open/src/hotspot/os_cpu/bsd_aarch64
open/src/hotspot/os/bsd
open/src/hotspot/os/posix
open/src/hotspot/os/posix/include
open/src/hotspot/share
open/src/hotspot/share/include
open/src/java.base/share/native/include
open/src/java.base/share/native/libjimage
open/src/java.base/unix/native/include

Are we sure that there are no header files of the same name here? We can check, and there are none. Can we be sure that no one will add a conflicting header? Well, yes, since then the product would not compile as expected.

Going back to the test files. This is the complete list of all header files present in these directories:

test/hotspot/jtreg/vmTestbase/nsk/share/aod/aod.hpp
test/hotspot/jtreg/vmTestbase/nsk/share/jni/ExceptionCheckingJniEnv.hpp
test/hotspot/jtreg/vmTestbase/nsk/share/jni/jni_tools.hpp
test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/agent_common/agent_common.hpp
test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/aod/jvmti_aod.hpp
test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/Injector.hpp
test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/jvmti_FollowRefObjects.hpp
test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/jvmti_tools.hpp
test/hotspot/jtreg/vmTestbase/nsk/share/jvmti/JVMTITools.hpp
test/hotspot/jtreg/vmTestbase/nsk/share/native/native_thread.hpp
test/hotspot/jtreg/vmTestbase/nsk/share/native/nsk_list.hpp
test/hotspot/jtreg/vmTestbase/nsk/share/native/nsk_mutex.hpp
test/hotspot/jtreg/vmTestbase/nsk/share/native/nsk_tools.hpp
test/hotspot/jtreg/vmTestbase/nsk/stress/jni/jnihelper.hpp
test/hotspot/jtreg/vmTestbase/vm/mlvm/share/mlvmJvmtiUtils.hpp
test/lib/jdk/test/lib/jvmti/jvmti_common.hpp
test/lib/jdk/test/lib/jvmti/jvmti_thread.hpp

As you can see, there are no conflicts.

Most of the names are very specific and include some part of their specific "package" in the name. It seems highly unlikely to me that someone would add another header file with the same name as any of these.

And, also, if someone were to do that after this PR, the tests would fail to compile as expected, so it can't really happen by mistake.

(I do note the weird fact that there is both a jvmti_tools.hpp and a JVMTITools.hpp in test/hotspot/jtreg/vmTestbase/nsk/share/jvmti. Seems confused to me.)

Copy link
Member

Choose a reason for hiding this comment

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

Okay, lets give it a try.

@magicus
Copy link
Member Author

magicus commented Mar 21, 2025

/integrate

@openjdk
Copy link

openjdk bot commented Mar 21, 2025

Going to push as commit 07667ca.
Since your change was applied there have been 10 commits pushed to the master branch:

  • b545b9e: 8352584: [Backout] G1: Pinned regions with pinned objects only reachable by native code crash VM
  • 1c0fa0a: 8352512: TestVectorZeroCount: counter not reset between iterations
  • 466f82a: 8314999: IR framework fails to detect allocation
  • 06ba6cf: 8329173: LCMS_CFLAGS from configure are lost
  • 56038fb: 8352317: Assertion failure during size estimation of BoxLockNode with -XX:+UseAPX
  • 2bc4f64: 8335708: C2: Compile::verify_graph_edges must start at root and safepoints, just like CCP traversal
  • 9a17a6f: 8350749: Upgrade JLine to 3.29.0
  • 91836e1: 8352276: Skip jtreg tests using native executable with libjvm.so/libjli.so dependencies on static JDK
  • 2560a63: 8352131: [REDO] C2: Print compilation bailouts with PrintCompilation compile command
  • 73177d9: 8347734: Turning off PerfData logging doesn't work

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Mar 21, 2025
@openjdk openjdk bot closed this Mar 21, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Mar 21, 2025
@openjdk
Copy link

openjdk bot commented Mar 21, 2025

@magicus Pushed as commit 07667ca.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@magicus magicus deleted the simplify-hotspot-jtreg-native branch March 21, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build [email protected] integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants