Builds fail due to use of preview features & removed arguments
Ty Young
youngty1997 at gmail.com
Thu Dec 19 23:58:05 UTC 2019
On 12/19/19 5:30 PM, David Holmes wrote:
> Hi Ty,
>
> On 20/12/2019 9:23 am, Ty Young wrote:
>> Hi,
>>
>>
>> As of the merging of Records into JDK proper, source code compiling
>> fails using a standard command line of:
>>
>>
>> bash configure --disable-warnings-as-errors
>
> I would have expected that to ensure the warnings were NOT treated as
> an error. Is there some build system bug here? Or is there some
> double-negative at play ??
spec.gmk has this:
# A global flag (true or false) determining if native warnings are
considered errors.
WARNINGS_AS_ERRORS := false
...implying that it only affects native warnings. The argument naming
itself doesn't really suggest that though...
>
>>
>> which fails with:
>>
>>
>> /home/ty/Downloads/jdk-master/src/java.compiler/share/classes/javax/lang/model/util/AbstractElementVisitor14.java:30:
>> warning: [preview] RecordComponentElement is an API that is part of a
>> preview feature
>> import javax.lang.model.element.RecordComponentElement;
>> ^
>> /home/ty/Downloads/jdk-master/src/java.compiler/share/classes/javax/lang/model/util/SimpleElementVisitor14.java:30:
>> warning: [preview] RecordComponentElement is an API that is part of a
>> preview feature
>> import javax.lang.model.element.RecordComponentElement;
>> ^
>> error: warnings found and -Werror specified
>
> I think this is more an issue for the language and compiler folk on
> compiler-dev. I'm not clear on all the rules around use of preview
> features but it seems to me that if we are using them internally and
> that generates warnings then we should be suppressing those warnings
> (@supressedWarning) at those call sites. Though I don't know whether
> you can suppress a warning for an import statement??
>
> David
> -----
Sending this to them.
>
>>
>> ...which was not the case in 13. I'm assuming this is happening now
>> because JDK source code actually utilizes the feature preview where
>> as with other preview features before simply existed but weren't used
>> in source.
>>
>>
>> I've been told by a JDK developer from the Project Panama mailing
>> list that it *does* compile for them, but I'm not aware of the
>> command line arguments that JDK developers use. Is this documented
>> somewhere? Should it be failing by default like this?
>>
>>
>> Additionally, the argument --with-libclang-include-aux seems to have
>> been deprecated in 14. This, as was told to me by a Panama JDK
>> developer, is needed to specify clang headers for custom source
>> builds. What is the correct way to specify those now in 14?
>>
More information about the compiler-dev
mailing list