Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guava build fails on master with JDK 21 #7065

Closed
1 task done
sgammon opened this issue Mar 1, 2024 · 4 comments · Fixed by #7102
Closed
1 task done

Guava build fails on master with JDK 21 #7065

sgammon opened this issue Mar 1, 2024 · 4 comments · Fixed by #7102
Assignees
Labels
P2 package=general type=defect Bug, not working as expected

Comments

@sgammon
Copy link
Contributor

sgammon commented Mar 1, 2024

Description

Using latest LTS JVM (21):

  1. git clone [email protected]:google/guava.git
  2. cd guava && mvn clean package
  3. Build fails

Example

See above

Expected Behavior

The build should not fail

Actual Behavior

[INFO] 
[INFO] --- bundle:5.1.8:bundle (default-bundle) @ guava ---
[INFO] Building bundle: /Volumes/VAULTROOM/guava/guava/target/guava-HEAD-jre-SNAPSHOT.jar
[INFO] Writing manifest: /Volumes/VAULTROOM/guava/guava/target/classes/META-INF/MANIFEST.MF
[INFO] 
[INFO] --- source:3.3.0:jar-no-fork (attach-sources) @ guava ---
[INFO] Building jar: /Volumes/VAULTROOM/guava/guava/target/guava-HEAD-jre-SNAPSHOT-sources.jar
[INFO] 
[INFO] --- javadoc:3.5.0:jar (attach-docs) @ guava ---
[INFO] No previous run data found, generating javadoc.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Guava Maven Parent HEAD-jre-SNAPSHOT:
[INFO] 
[INFO] Guava Maven Parent ................................. SUCCESS [  3.488 s]
[INFO] Guava: Google Core Libraries for Java .............. FAILURE [ 48.658 s]
[INFO] Guava BOM .......................................... SKIPPED
[INFO] Guava Testing Library .............................. SKIPPED
[INFO] Guava Unit Tests ................................... SKIPPED
[INFO] Guava GWT compatible libs .......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  53.890 s
[INFO] Finished at: 2024-03-01T13:22:02-08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.5.0:jar (attach-docs) on project guava: MavenReportException: Error while generating Javadoc: 
[ERROR] Exit code: 1
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/vm/ScopedValueContainer.java:28: error: StructureViolationException is a preview API and is disabled by default.
[ERROR] import java.util.concurrent.StructureViolationException;
[ERROR]                            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/access/JavaNioAccess.java:31: error: MemorySegment is a preview API and is disabled by default.
[ERROR] import java.lang.foreign.MemorySegment;
[ERROR]                         ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/access/JavaTemplateAccess.java:49: error: StringTemplate is a preview API and is disabled by default.
[ERROR]     StringTemplate of(List<String> fragments, List<?> values);
[ERROR]     ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/access/JavaTemplateAccess.java:75: error: StringTemplate is a preview API and is disabled by default.
[ERROR]     StringTemplate combine(StringTemplate... sts);
[ERROR]                            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/access/JavaTemplateAccess.java:75: error: StringTemplate is a preview API and is disabled by default.
[ERROR]     StringTemplate combine(StringTemplate... sts);
[ERROR]     ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/access/JavaNioAccess.java:50: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     ByteBuffer newDirectByteBuffer(long addr, int cap, Object obj, MemorySegment segment);
[ERROR]                                                                    ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/access/JavaNioAccess.java:60: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     ByteBuffer newMappedByteBuffer(UnmapperProxy unmapperProxy, long addr, int cap, Object obj, MemorySegment segment);
[ERROR]                                                                                                 ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/access/JavaNioAccess.java:66: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     ByteBuffer newHeapByteBuffer(byte[] hb, int offset, int capacity, MemorySegment segment);
[ERROR]                                                                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/access/JavaNioAccess.java:86: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     MemorySegment bufferSegment(Buffer buffer);
[ERROR]     ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/sun/nio/ch/FileChannelImpl.java:32: error: MemorySegment is a preview API and is disabled by default.
[ERROR] import java.lang.foreign.MemorySegment;
[ERROR]                         ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/sun/nio/ch/FileChannelImpl.java:33: error: Arena is a preview API and is disabled by default.
[ERROR] import java.lang.foreign.Arena;
[ERROR]                         ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/sun/nio/ch/FileChannelImpl.java:1206: error: Arena is a preview API and is disabled by default.
[ERROR]                              Arena arena)
[ERROR]                              ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/sun/nio/ch/FileChannelImpl.java:1205: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public MemorySegment map(MapMode mode, long offset, long size,
[ERROR]            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:58: error: ValueLayout is a preview API and is disabled by default.
[ERROR] import static java.lang.foreign.ValueLayout.JAVA_BYTE;
[ERROR]                                ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:70: error: MemorySegment is a preview API and is disabled by default.
[ERROR]         implements MemorySegment, SegmentAllocator, BiFunction<String, List<Number>, RuntimeException>
[ERROR]                    ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:70: error: SegmentAllocator is a preview API and is disabled by default.
[ERROR]         implements MemorySegment, SegmentAllocator, BiFunction<String, List<Number>, RuntimeException>
[ERROR]                                   ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/HeapMemorySegmentImpl.java:29: error: MemorySegment is a preview API and is disabled by default.
[ERROR] import java.lang.foreign.MemorySegment;
[ERROR]                         ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/HeapMemorySegmentImpl.java:30: error: ValueLayout is a preview API and is disabled by default.
[ERROR] import java.lang.foreign.ValueLayout;
[ERROR]                         ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/NativeMemorySegmentImpl.java:29: error: MemorySegment is a preview API and is disabled by default.
[ERROR] import java.lang.foreign.MemorySegment;
[ERROR]                         ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/misc/ScopedMemoryAccess.java:32: error: MemorySegment is a preview API and is disabled by default.
[ERROR] import java.lang.foreign.MemorySegment;
[ERROR]                         ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/MemorySessionImpl.java:29: error: MemorySegment is a preview API and is disabled by default.
[ERROR] import java.lang.foreign.MemorySegment;
[ERROR]                         ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/MemorySessionImpl.java:30: error: Arena is a preview API and is disabled by default.
[ERROR] import java.lang.foreign.Arena;
[ERROR]                         ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/MemorySessionImpl.java:31: error: MemorySegment is a preview API and is disabled by default.
[ERROR] import java.lang.foreign.MemorySegment.Scope;
[ERROR]                         ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/MemorySessionImpl.java:31: error: Scope is a preview API and is disabled by default.
[ERROR] import java.lang.foreign.MemorySegment.Scope;
[ERROR]                                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/MemorySessionImpl.java:53: error: Scope is a preview API and is disabled by default.
[ERROR]         implements Scope
[ERROR]                    ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:115: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public MemorySegment asSlice(long offset, long newSize, long byteAlignment) {
[ERROR]            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:127: error: Arena is a preview API and is disabled by default.
[ERROR]     public final MemorySegment reinterpret(long newSize, Arena arena, Consumer<MemorySegment> cleanup) {
[ERROR]                                                          ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:127: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public final MemorySegment reinterpret(long newSize, Arena arena, Consumer<MemorySegment> cleanup) {
[ERROR]                                                                                ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:127: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public final MemorySegment reinterpret(long newSize, Arena arena, Consumer<MemorySegment> cleanup) {
[ERROR]                  ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:135: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public final MemorySegment reinterpret(long newSize) {
[ERROR]                  ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:141: error: Arena is a preview API and is disabled by default.
[ERROR]     public final MemorySegment reinterpret(Arena arena, Consumer<MemorySegment> cleanup) {
[ERROR]                                            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:141: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public final MemorySegment reinterpret(Arena arena, Consumer<MemorySegment> cleanup) {
[ERROR]                                                                  ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:141: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public final MemorySegment reinterpret(Arena arena, Consumer<MemorySegment> cleanup) {
[ERROR]                  ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:147: error: Scope is a preview API and is disabled by default.
[ERROR]     public MemorySegment reinterpretInternal(Class<?> callerClass, long newSize, Scope scope, Consumer<MemorySegment> cleanup) {
[ERROR]                                                                                  ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:147: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public MemorySegment reinterpretInternal(Class<?> callerClass, long newSize, Scope scope, Consumer<MemorySegment> cleanup) {
[ERROR]                                                                                                        ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:147: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public MemorySegment reinterpretInternal(Class<?> callerClass, long newSize, Scope scope, Consumer<MemorySegment> cleanup) {
[ERROR]            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:165: error: MemoryLayout is a preview API and is disabled by default.
[ERROR]     public Spliterator<MemorySegment> spliterator(MemoryLayout elementLayout) {
[ERROR]                                                   ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:165: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public Spliterator<MemorySegment> spliterator(MemoryLayout elementLayout) {
[ERROR]                        ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:182: error: MemoryLayout is a preview API and is disabled by default.
[ERROR]     public Stream<MemorySegment> elements(MemoryLayout elementLayout) {
[ERROR]                                           ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:182: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public Stream<MemorySegment> elements(MemoryLayout elementLayout) {
[ERROR]                   ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:187: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public final MemorySegment fill(byte value){
[ERROR]                  ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:194: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public MemorySegment allocate(long byteSize, long byteAlignment) {
[ERROR]            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:258: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public final Optional<MemorySegment> asOverlappingSlice(MemorySegment other) {
[ERROR]                                                             ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:258: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public final Optional<MemorySegment> asOverlappingSlice(MemorySegment other) {
[ERROR]                           ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:276: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public final long segmentOffset(MemorySegment other) {
[ERROR]                                     ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:309: error: ValueLayout is a preview API and is disabled by default.
[ERROR]     public final byte[] toArray(ValueLayout.OfByte elementLayout) {
[ERROR]                                 ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:309: error: OfByte is a preview API and is disabled by default.
[ERROR]     public final byte[] toArray(ValueLayout.OfByte elementLayout) {
[ERROR]                                            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:314: error: ValueLayout is a preview API and is disabled by default.
[ERROR]     public final short[] toArray(ValueLayout.OfShort elementLayout) {
[ERROR]                                  ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:314: error: OfShort is a preview API and is disabled by default.
[ERROR]     public final short[] toArray(ValueLayout.OfShort elementLayout) {
[ERROR]                                             ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:319: error: ValueLayout is a preview API and is disabled by default.
[ERROR]     public final char[] toArray(ValueLayout.OfChar elementLayout) {
[ERROR]                                 ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:319: error: OfChar is a preview API and is disabled by default.
[ERROR]     public final char[] toArray(ValueLayout.OfChar elementLayout) {
[ERROR]                                            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:324: error: ValueLayout is a preview API and is disabled by default.
[ERROR]     public final int[] toArray(ValueLayout.OfInt elementLayout) {
[ERROR]                                ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:324: error: OfInt is a preview API and is disabled by default.
[ERROR]     public final int[] toArray(ValueLayout.OfInt elementLayout) {
[ERROR]                                           ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:329: error: ValueLayout is a preview API and is disabled by default.
[ERROR]     public final float[] toArray(ValueLayout.OfFloat elementLayout) {
[ERROR]                                  ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:329: error: OfFloat is a preview API and is disabled by default.
[ERROR]     public final float[] toArray(ValueLayout.OfFloat elementLayout) {
[ERROR]                                             ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:334: error: ValueLayout is a preview API and is disabled by default.
[ERROR]     public final long[] toArray(ValueLayout.OfLong elementLayout) {
[ERROR]                                 ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:334: error: OfLong is a preview API and is disabled by default.
[ERROR]     public final long[] toArray(ValueLayout.OfLong elementLayout) {
[ERROR]                                            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:339: error: ValueLayout is a preview API and is disabled by default.
[ERROR]     public final double[] toArray(ValueLayout.OfDouble elementLayout) {
[ERROR]                                   ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:339: error: OfDouble is a preview API and is disabled by default.
[ERROR]     public final double[] toArray(ValueLayout.OfDouble elementLayout) {
[ERROR]                                              ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:343: error: ValueLayout is a preview API and is disabled by default.
[ERROR]     private <Z> Z toArray(Class<Z> arrayClass, ValueLayout elemLayout, IntFunction<Z> arrayFactory, Function<Z, MemorySegment> segmentFactory) {
[ERROR]                                                ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:343: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     private <Z> Z toArray(Class<Z> arrayClass, ValueLayout elemLayout, IntFunction<Z> arrayFactory, Function<Z, MemorySegment> segmentFactory) {
[ERROR]                                                                                                                 ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:372: error: MemoryLayout is a preview API and is disabled by default.
[ERROR]     public final boolean isAlignedForElement(long offset, MemoryLayout layout) {
[ERROR]                                                           ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:411: error: Scope is a preview API and is disabled by default.
[ERROR]     public Scope scope() {
[ERROR]            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:594: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long srcOffset,
[ERROR]                             ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:594: error: ValueLayout is a preview API and is disabled by default.
[ERROR]     public static void copy(MemorySegment srcSegment, ValueLayout srcElementLayout, long srcOffset,
[ERROR]                                                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:595: error: MemorySegment is a preview API and is disabled by default.
[ERROR]                             MemorySegment dstSegment, ValueLayout dstElementLayout, long dstOffset,
[ERROR]                             ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:595: error: ValueLayout is a preview API and is disabled by default.
[ERROR]                             MemorySegment dstSegment, ValueLayout dstElementLayout, long dstOffset,
[ERROR]                                                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:626: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public static void copy(MemorySegment srcSegment, ValueLayout srcLayout, long srcOffset,
[ERROR]                             ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:626: error: ValueLayout is a preview API and is disabled by default.
[ERROR]     public static void copy(MemorySegment srcSegment, ValueLayout srcLayout, long srcOffset,
[ERROR]                                                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:656: error: MemorySegment is a preview API and is disabled by default.
[ERROR]                             MemorySegment dstSegment, ValueLayout dstLayout, long dstOffset,
[ERROR]                             ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:656: error: ValueLayout is a preview API and is disabled by default.
[ERROR]                             MemorySegment dstSegment, ValueLayout dstLayout, long dstOffset,
[ERROR]                                                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:683: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public static long mismatch(MemorySegment srcSegment, long srcFromOffset, long srcToOffset,
[ERROR]                                 ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:684: error: MemorySegment is a preview API and is disabled by default.
[ERROR]                                 MemorySegment dstSegment, long dstFromOffset, long dstToOffset) {
[ERROR]                                 ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/MemorySessionImpl.java:79: error: Arena is a preview API and is disabled by default.
[ERROR]     public Arena asArena() {
[ERROR]            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/MemorySessionImpl.java:94: error: Arena is a preview API and is disabled by default.
[ERROR]     public static final MemorySessionImpl toMemorySession(Arena arena) {
[ERROR]                                                           ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/MemorySessionImpl.java:156: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public MemorySegment allocate(long byteSize, long byteAlignment) {
[ERROR]            ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/MemorySessionImpl.java:223: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public static final void checkValidState(MemorySegment segment) {
[ERROR]                                              ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/NativeMemorySegmentImpl.java:118: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public static MemorySegment makeNativeSegment(long byteSize, long byteAlignment, MemorySessionImpl sessionImpl) {
[ERROR]                   ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/NativeMemorySegmentImpl.java:154: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public static MemorySegment makeNativeSegmentUnchecked(long min, long byteSize, MemorySessionImpl sessionImpl, Runnable action) {
[ERROR]                   ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/NativeMemorySegmentImpl.java:164: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public static MemorySegment makeNativeSegmentUnchecked(long min, long byteSize, MemorySessionImpl sessionImpl) {
[ERROR]                   ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/NativeMemorySegmentImpl.java:170: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     public static MemorySegment makeNativeSegmentUnchecked(long min, long byteSize) {
[ERROR]                   ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:430: error: MemorySegment is a preview API and is disabled by default.
[ERROR]     static class SegmentSplitter implements Spliterator<MemorySegment> {
[ERROR]                                                         ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:459: error: MemorySegment is a preview API and is disabled by default.
[ERROR]         public boolean tryAdvance(Consumer<? super MemorySegment> action) {
[ERROR]                                                    ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/AbstractMemorySegmentImpl.java:478: error: MemorySegment is a preview API and is disabled by default.
[ERROR]         public void forEachRemaining(Consumer<? super MemorySegment> action) {
[ERROR]                                                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/HeapMemorySegmentImpl.java:113: error: MemorySegment is a preview API and is disabled by default.
[ERROR]         public static MemorySegment fromArray(byte[] arr) {
[ERROR]                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/HeapMemorySegmentImpl.java:147: error: MemorySegment is a preview API and is disabled by default.
[ERROR]         public static MemorySegment fromArray(char[] arr) {
[ERROR]                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/HeapMemorySegmentImpl.java:181: error: MemorySegment is a preview API and is disabled by default.
[ERROR]         public static MemorySegment fromArray(short[] arr) {
[ERROR]                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/HeapMemorySegmentImpl.java:215: error: MemorySegment is a preview API and is disabled by default.
[ERROR]         public static MemorySegment fromArray(int[] arr) {
[ERROR]                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/HeapMemorySegmentImpl.java:249: error: MemorySegment is a preview API and is disabled by default.
[ERROR]         public static MemorySegment fromArray(long[] arr) {
[ERROR]                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/HeapMemorySegmentImpl.java:283: error: MemorySegment is a preview API and is disabled by default.
[ERROR]         public static MemorySegment fromArray(float[] arr) {
[ERROR]                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] /Volumes/VAULTROOM/guava/guava/target/jdk-sources/java.base/jdk/internal/foreign/HeapMemorySegmentImpl.java:317: error: MemorySegment is a preview API and is disabled by default.
[ERROR]         public static MemorySegment fromArray(double[] arr) {
[ERROR]                       ^
[ERROR]   (use --enable-preview to enable preview APIs)
[ERROR] 91 errors
[ERROR] Command line was: /Library/Java/JavaVirtualMachines/gvm-ce.jdk21/Contents/Home/bin/javadoc @options @argfile
[ERROR] 
[ERROR] Refer to the generated Javadoc files in '/Volumes/VAULTROOM/guava/guava/target/apidocs' dir.
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :guava

Packages

No response

Platforms

No response

Checklist

@sgammon sgammon added the type=defect Bug, not working as expected label Mar 1, 2024
@sgammon sgammon changed the title Guava build fails on master Guava build fails on master with JDK 21 Mar 1, 2024
@sgammon
Copy link
Contributor Author

sgammon commented Mar 1, 2024

It appears this happens because of the build against JDK sources, which includes preview types.

@cpovirk
Copy link
Member

cpovirk commented Mar 2, 2024

Thanks, I knew that the build was broken at one point under 21 (#6830, maybe since fixed, but we should set up CI, as the issue says) but didn't know about this specific reason. It's probably about time for me to do something about that.

The use of JDK sources hasn't been working for a while, anyway (#6790). I should probably rip that out.

@sgammon
Copy link
Contributor Author

sgammon commented Mar 2, 2024

Would you guys be open to PRs @cpovirk? I have a reasonable suite of changes locally and I could break that out into something reviewable.

@cpovirk
Copy link
Member

cpovirk commented Mar 2, 2024

For this sort of thing, probably yes, thanks.

The main thing to be aware of is the need to sign the CLA: https://github.com/google/guava/blob/master/CONTRIBUTING.md#contributor-license-agreement

If you want me to peek at anything before you go to the trouble of breaking it up, let me know.

sgammon added a commit to sgammon/guava that referenced this issue Mar 8, 2024
- fix: build against embedded jdk sources needs `--enable-preview`
  when built against jvm21

- fix: add `-Djava.security.manager=allow` to fix security manager
  tests under modern java

Fixes and closes google#7065

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/guava that referenced this issue Mar 8, 2024
- fix: build against embedded jdk sources needs `--enable-preview`
  when built against jvm21

- fix: add `-Djava.security.manager=allow` to fix security manager
  tests under modern java

Fixes and closes google#7065

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/guava that referenced this issue Mar 8, 2024
- fix: build against embedded jdk sources needs `--enable-preview`
  when built against jvm21

- fix: add `-Djava.security.manager=allow` to fix security manager
  tests under modern java

Fixes and closes google#7065

Signed-off-by: Sam Gammon <[email protected]>
This was referenced Mar 8, 2024
sgammon added a commit to sgammon/guava that referenced this issue Mar 10, 2024
- fix: build against embedded jdk sources needs `--enable-preview`
  when built against jvm21

- fix: add `-Djava.security.manager=allow` to fix security manager
  tests under modern java

Fixes and closes google#7065

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/guava that referenced this issue Mar 10, 2024
- fix: build against embedded jdk sources needs `--enable-preview`
  when built against jvm21

- fix: add `-Djava.security.manager=allow` to fix security manager
  tests under modern java

Fixes and closes google#7065

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/guava that referenced this issue Mar 11, 2024
- fix: build against embedded jdk sources needs `--enable-preview`
  when built against jvm21

- fix: add `-Djava.security.manager=allow` to fix security manager
  tests under modern java

Fixes and closes google#7065

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/guava that referenced this issue Mar 11, 2024
- fix: build against embedded jdk sources needs `--enable-preview`
  when built against jvm21

- fix: add `-Djava.security.manager=allow` to fix security manager
  tests under modern java

Fixes and closes google#7065

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/guava that referenced this issue Mar 11, 2024
- fix: build against embedded jdk sources needs `--enable-preview`
  when built against jvm21

- fix: add `-Djava.security.manager=allow` to fix security manager
  tests under modern java

Fixes and closes google#7065

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/guava that referenced this issue Mar 11, 2024
- fix: build against embedded jdk sources needs `--enable-preview`
  when built against jvm21

- fix: add `-Djava.security.manager=allow` to fix security manager
  tests under modern java

Fixes and closes google#7065

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/guava that referenced this issue Mar 11, 2024
- fix: build against embedded jdk sources needs `--enable-preview`
  when built against jvm21

- fix: add `-Djava.security.manager=allow` to fix security manager
  tests under modern java

Fixes and closes google#7065

Signed-off-by: Sam Gammon <[email protected]>
sgammon added a commit to sgammon/guava that referenced this issue Mar 12, 2024
- fix: build against embedded jdk sources needs `--enable-preview`
  when built against jvm21

- fix: add `-Djava.security.manager=allow` to fix security manager
  tests under modern java

Fixes and closes google#7065

Signed-off-by: Sam Gammon <[email protected]>
copybara-service bot pushed a commit that referenced this issue Mar 12, 2024
The main changes is that tests need `-Djava.security.manager=allow`.

Fixes and closes #7065

Helps with #6790

Fixes #6245 (at least the remaining parts that we actually care about)

Fixes #7087

Signed-off-by: Sam Gammon <[email protected]>
RELNOTES=n/a
PiperOrigin-RevId: 614671411
copybara-service bot pushed a commit that referenced this issue Mar 12, 2024
The main changes is that tests need `-Djava.security.manager=allow`.

Fixes and closes #7065

Helps with #6790

Fixes #6245 (at least the remaining parts that we actually care about)

Fixes #7087

Signed-off-by: Sam Gammon <[email protected]>
RELNOTES=n/a
PiperOrigin-RevId: 614671411
copybara-service bot pushed a commit that referenced this issue Mar 12, 2024
The main changes is that tests need `-Djava.security.manager=allow`.

Fixes and closes #7065

Helps with #6790

Fixes #6245 (at least the remaining parts that we actually care about)

Fixes #7087

Signed-off-by: Sam Gammon <[email protected]>
RELNOTES=n/a
PiperOrigin-RevId: 614671411
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 package=general type=defect Bug, not working as expected
Projects
None yet
3 participants
@sgammon @cpovirk and others