[jdk8u-dev] RFR: 8377344: [8u] Compilation failure on Windows for Linux-specific platform metric tests
Takuya Kiriyama
tkiriyama at openjdk.org
Fri Feb 6 07:11:32 UTC 2026
Hi All,
This fix addresses cgroup and Docker test failures in JDK 8. In JDK 11 and later, these tests use `@requires container.support`. Docker support within the JDK's internal platform metrics inherently relies on Linux. This annotation prevents test execution in unsupported environments, such as Windows, thereby mitigating compilation errors stemming from absent Linux-specific libraries. While `@requires container.support` validates the presence and operational status of a container runtime or Docker daemon, it does not address the fundamental operating system compatibility required by the JDK's internal metric-reading code. The JDK's internal platform metrics for cgroups and Docker are intrinsically linked to and dependent upon Linux-specific APIs, including native libraries and system calls. However, the container.support determination logic is not implemented in JDK 8. Since Docker support inherently requires a Linux OS, directly adding `@requires os.family == "linux"` to tests in JDK
8 achieves the desired effect of preventing these tests from running (and thus failing compilation) on Windows. This is a practical and effective workaround for JDK 8, given the absence of container.support logic. This issue directly arises from modifications introduced by JDK-8231111, a critical bug fix enabling the JVM to natively process Cgroup v2 resource control files.
Would anyone review this fix, please?
Thank you.
-------------
Commit messages:
- 8377344: [8u] Compilation failure on Windows for Linux-specific platform metric tests
Changes: https://git.openjdk.org/jdk8u-dev/pull/758/files
Webrev: https://webrevs.openjdk.org/?repo=jdk8u-dev&pr=758&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8377344
Stats: 6 lines in 3 files changed: 3 ins; 0 del; 3 mod
Patch: https://git.openjdk.org/jdk8u-dev/pull/758.diff
Fetch: git fetch https://git.openjdk.org/jdk8u-dev.git pull/758/head:pull/758
PR: https://git.openjdk.org/jdk8u-dev/pull/758
More information about the jdk8u-dev
mailing list