Upgrade to Gradle 9.3.1 with JDK 21 build requirement#365
Open
Upgrade to Gradle 9.3.1 with JDK 21 build requirement#365
Conversation
CI Test ResultsRun: #22042302200 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 40 | Passed: 40 | Failed: 0 Updated: 2026-02-15 20:25:04 UTC |
Scan-Build Report
Bug Summary
Reports
|
||||||||||||||||||||||||||||||||||||
90d13d7 to
0970a33
Compare
400823d to
a33b077
Compare
ddprof-test/src/test/java/com/datadoghq/profiler/test/ProfilerTestRunner.java
Fixed
Show fixed
Hide fixed
- Gradle 8.12 → 9.3.1, Spotless 7.0.2, JMH 0.7.3 - CI and Docker builds now use JDK 21 (Gradle 9 requires JDK 17+) - Fix Kotlin 2 API changes (capitalize, createTempFile, exec) - Fix Spotless 7.x API changes (editorConfigOverride, leadingTabsToSpaces) - Two-JDK pattern: build JDK 21, test JDK configurable 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Set explicit executable for runUnwindingValidator and unwindingReport tasks to avoid Gradle 9 javaLauncher toolchain probing failures. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Gradle 9 detects that compileJava9Java uses mainSourceSet.output which includes copyExternalLibs destination. Add explicit dependency. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix PATH env variable escaping in Dockerfile heredocs - Add coreutils to Alpine base image for chmod 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add 'assembled' publication with all build artifacts - Include POM metadata (license, SCM, developers) - Configure signing with in-memory PGP keys - Add publication assertions for CI requirements 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add javaLauncher workaround for Test tasks (musl compatibility) - Fix configurations to be resolvable-only (Gradle 9 requirement) - Upgrade plugins: ben-manes.versions 0.51.0, download 5.6.0 - Use lazy configuration for Javadoc tasks - Fix eager task resolution in publishing assertions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Use lazy task resolution for javadocJar (map instead of get) - Use task matching for assembleReleaseJar (registered in afterEvaluate) - Extract javaLauncher workaround to documented helper methods 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace Test/JavaExec tasks with Exec tasks to bypass Gradle's toolchain system. Adds JUnit Platform Console Launcher dependency. - Same task names on all platforms (testdebug, testrelease) - JAVA_TEST_HOME support everywhere for multi-JDK testing - No platform-specific code paths - Verified working in musl containers Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Preserve build-script args in doFirst blocks (LIFO order) - Fix test filter to only use --select-method for '#' separator - Update javadoc to reference Exec tasks instead of Test/JavaExec - Simplify build.gradle.kts to use doFirst (plugin preserves args) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Move test properties into plugin (avoid doFirst ordering issues) - Fix test filter: use --select-class instead of --scan-classpath when filtering - Simplify build.gradle.kts (plugin now handles all properties) - Tests now execute successfully with -Ptests filter Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Two critical fixes for Exec-based test tasks: 1. Defer executable resolution to execution time - Move testJavaExecutable() call from configuration to doFirst - CI sets JAVA_TEST_HOME at runtime, not visible at config time - Fixes JDK version mismatch (tests ran with build JDK not test JDK) 2. Explicitly pass through CI environment variables - Exec tasks don't inherit environment like Test tasks - Add LIBC, KEEP_JFRS, TEST_COMMIT, TEST_CONFIGURATION, SANITIZER - Fixes assumption failures in MuslDetectionTest and others Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Uses Test tasks on glibc/macOS, Test-with-Exec-delegation on musl. Provides unified --tests flag interface on all platforms. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add dependency on :ddprof-test-native:linkLib for Test tasks. Previously only Exec tasks had this dependency, causing RemoteSymbolicationTest to fail with NoClassDefFoundError when RemoteSymHelper's static initializer couldn't load libddproftest.so. The fix changes from type-based matching (Exec only) to name-based matching (all tasks starting with "test"), ensuring both Test and Exec tasks wait for the native library to be built. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove the dual Test+Exec task approach for musl in favor of direct
Exec task creation. The Test task wrapper was causing Gradle internal
errors ("NoSuchMethodError: getMainType") during configuration.
Changes:
- Create Exec tasks directly for musl (no Test task wrapper)
- Read test filters from -Ptests project property instead of --tests flag
- Remove testdebugExec hidden task, use testdebug directly
Known Issue:
- musl + Liberica JDK 11 still fails with NoSuchMethodError when
running JUnit Console Launcher. This appears to be a pre-existing
issue with that specific JDK build. JDK 21 on musl works fine.
Tested:
- ✅ JDK 11 glibc: 144 tests run (Test task)
- ✅ JDK 21 musl: Tests run (Exec task)
- ❌ JDK 11 musl: NoSuchMethodError (JDK build issue)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements platform-conditional test execution to support both glibc/macOS and musl environments with a unified -Ptests interface. Changes: - Add ProfilerTestRunner with JUnit Platform Launcher API - Create Test tasks on glibc/macOS, Exec tasks on musl - Fix JDK 11 + musl by removing LD_LIBRARY_PATH (prevents cross-JDK library loading) - Support both . and # method separators with proper heuristic - Update all docs to use -Ptests syntax consistently - Add warning when --tests flag used on Test tasks - Switch from junit-platform-console to junit-platform-launcher - Add build-logic to Dependabot monitoring - Improve error handling in javadocJar task Verified on musl + JDK 11, musl + JDK 21, and macOS. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
bdd6c46 to
e553f15
Compare
Restore original camelCase naming convention for test tasks to maintain compatibility with existing workflows. Gradle task resolution is case-insensitive, so both `./gradlew testDebug` and `./gradlew testdebug` work, but camelCase is the standard Gradle convention. Changes: - ProfilerTestPlugin.kt: Capitalize first letter of config name when creating tasks (testDebug, testRelease, testAsan, testTsan) - run-docker-tests.sh: Restore CONFIG_CAPITALIZED logic - Update all documentation to use camelCase task names Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Clean up excessive debug logging that outputs on every task configuration. The info about executable and classpath size was not particularly actionable and added noise to build output. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Address code quality review comment: the 'args' parameter in runTests()
was never used. All configuration is read from system properties via
System.getProperty("test.filter"), making the parameter unnecessary.
Changes:
- Remove String[] args parameter from runTests() method
- Update call site in main() to invoke runTests() without arguments
- Apply Spotless formatting to ddprof-lib/build.gradle.kts
Resolves GitHub Code Quality bot review comment on PR #365.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Apply the same LD_LIBRARY_PATH removal fix to runUnwindingValidator
and unwindingReport tasks that was previously applied to test tasks.
Without this fix, JDK 11 + musl systems fail with cross-JDK library
conflicts when LD_LIBRARY_PATH causes the launcher to load the wrong
libjli.so library. Removing LD_LIBRARY_PATH allows RPATH to work
correctly and load the correct library from $ORIGIN/../lib/jli.
Tasks fixed:
- runUnwindingValidator{Config} (Exec tasks)
- unwindingReport{Config} (Exec tasks)
Resolves unwinding report failures on musl CI builds.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f20e56c to
1a45019
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?:
Upgrades the build system from Gradle 8.12 to Gradle 9.3.1 and updates the build JDK requirement from JDK 11 to JDK 21. Also adds Dependabot configuration for automated dependency updates.
Key changes:
capitalize,createTempFile,exec)editorConfigOverride,leadingTabsToSpaces)JAVA_TEST_HOMEis read correctly-Ptestsproperty instead of--testsflag (Exec tasks don't support--tests)Motivation:
Gradle 9 brings performance improvements, better dependency management, and is required for long-term support. JDK 21 is the current LTS and provides the best tooling support while still allowing
--release 8targeting.Additional Notes:
--release 8; suppressed with-Xlint:-optionsHow to test the change?:
For Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance.Unsure? Have a question? Request a review!
🤖 Generated with Claude Code