Vladimir Sitnikov created CALCITE-7947:
------------------------------------------
Summary: Remove the build workaround that rewrites the @Target of
JSpecify's @NullMarked
Key: CALCITE-7947
URL: https://issues.apache.org/jira/browse/CALCITE-7947
Project: Calcite
Issue Type: Task
Components: build
Reporter: Vladimir Sitnikov
CALCITE-7736 adds an artifact transform, {{JSpecifyJava8Transform}} in
{{build.gradle.kts}}, that rewrites
{{org/jspecify/annotations/NullMarked.class}} in the jspecify jar on every
resolvable configuration: the {{MODULE}} constant in its {{@Target}} becomes
{{METHOD}}.
Calcite compiles with {{--release 8}} and {{-Werror}}. Java 8 has no
{{ElementType.MODULE}}, so without the rewrite every compilation that reads
{{@NullMarked}} warns "unknown enum constant ElementType.MODULE", and
{{-Werror}} turns the warning into a failure. JSpecify documents the warning
and has no fix for it:
https://github.com/jspecify/jspecify/wiki/version-compatibility
The rewrite affects only Calcite's own build. The published artifacts depend on
the unmodified {{org.jspecify:jspecify}}.
The transform can go when either of these happens:
# JSpecify publishes a {{@NullMarked}} without the {{MODULE}} target
([jspecify/jspecify#795|https://github.com/jspecify/jspecify/issues/795]), and
Calcite moves to it.
# Calcite stops compiling with {{--release 8}}.
Then remove {{JSpecifyJava8Transform}} and the {{jspecifyJava8Compatible}}
attribute, and the build still passes with {{-Werror}}.
Ruben suggested this ticket in the review of CALCITE-7736, so the workaround is
not forgotten:
https://github.com/apache/calcite/pull/5213#discussion_r4260158030
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)