[code-reflection] RFR: Make jdk.compiler build depend on code model API in java.base
Paul Sandoz
psandoz at openjdk.org
Mon Apr 29 16:37:14 UTC 2024
On Mon, 29 Apr 2024 15:44:42 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
> This PR fixes a nasty build issue where the jdk.compiler copy of the code model classes were not re-generated during an incremental build after a code model API or implementation change. This resulted in weird situations where, after a breaking change and an incremental build, compiler tests would seem fine, because they would really run against the unmodified copy of the code model classes (that were not regenerated after the breaking change).
>
> The fix is to add the code model java files under `src/java.base/share/classes/java/lang/reflect/code` as dependencies of the `GENSTUBS` target for the `jdk.compiler` module.
>
> To test, I've tried to make `CoreOps::conv` to throw an exception unconditionally, then rebuild incrementally and run the compiler tests, to check that they were indeed seeing the new exception.
Thank you fixing this irritant! Could you please also update the top-level README.md section "Code shared between `java.base` and `jdk.compiler` modules", as it mentioned possible issues. Suggest the following (removing the last sentence):
### Code shared between `java.base` and `jdk.compiler` modules
A subset of code in `java.base` is copied with package renaming into
the `jdk.compiler` module. This is the set of code required to build
and serialize code models. Due to bootstrapping constraints, compiling
the compiler it cannot depend on all code in `java.base`. In the future
we may come up with a better solution. For now the build has been modified
to copy the code, which leverages the script `cr-util/copy-to-compiler.sh`.
-------------
Marked as reviewed by psandoz (Lead).
PR Review: https://git.openjdk.org/babylon/pull/65#pullrequestreview-2029009717
More information about the babylon-dev
mailing list