bytedance / bytedance/CompoundVM

[Build] Reject unsupported hotspot target classlib values during configure

Open
#174 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
118
Forks
22
Avg merge
8d 8h
Merged PRs (30d)
4

Description

## Affected revision

`52b3ab0606d14300ba30a6a46c155c5892a06381` on `jdk17u-target8`.

## Problem

The help text for `--with-hotspot-target-classlib` says that the supported values are `8` and `17`, but `HOTSPOT_SETUP_TARGET_CLASSLIB` assigns any non-empty value directly to `HOTSPOT_TARGET_CLASSLIB` without validating it.

For example, a configuration using:

```text
--with-hotspot-target-classlib=9
```

passes this configure macro and propagates `9` into the generated build configuration. The unsupported value is rejected only later, when C++ compilation reaches:

```cpp
#error("Unsupported class library version: " HOTSPOT_TARGET_CLASSLIB)
```

in `src/hotspot/share/utilities/macros.hpp`.

A repository-wide search found no other configure-time validation of `with_hotspot_target_classlib`.

## Impact

A typo or unsupported value is reported late as a compiler/preprocessor failure instead of a clear configure error. This wastes a build cycle and makes the documented option appear to accept values that the source explicitly rejects.

## Expected behavior

Configure should reject values outside the supported set before generating the build configuration, with an error that lists the accepted values.

The allowed set may need to remain branch-specific: `jdk17u-target8` documents `8` and `17`, while the JDK 25 target branch may need a different set.

## Suggested direction

Validate the argument in `HOTSPOT_SETUP_TARGET_CLASSLIB` using the repository's normal autoconf argument-validation helpers or an explicit `AS_CASE`, and add a configure regression check for both accepted and rejected values.

## Why there is no PR with this report

A complete fix should be validated by regenerating/configuring the build and compiling at least the affected HotSpot configuration. The available Windows/WSL environment does not have the repository's declared Boot JDKs installed, and a full CompoundVM/OpenJDK validation requires multi-gigabyte build output. The exact accepted set also requires a maintainer decision across the JDK 17 and JDK 25 branches.

I searched existing issues, pull requests, branches, and relevant file history. PR #36 introduced the target-classlib macro for the JDK 25 work, but it does not report or fix configure-time validation; no equivalent open report or pending fix was found.

Contributor guide

Open the contributing guide

Research direction

Locate HOTSPOT_SETUP_TARGET_CLASSLIB and inspect the repository's existing configure argument-validation helpers, then review src/hotspot/share/utilities/macros.hpp for the supported class library values. Add configure regression coverage for accepted and rejected values, including 9; done means unsupported values fail during configure with accepted values listed, while supported branch-specific values configure successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, shell
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.