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

Getting package sun.misc does not exist error when building android_binary with --experimental_desugar_java8_libs option #9910

Closed
anuchandy opened this issue Oct 7, 2019 · 2 comments
Labels
team-Android Issues for Android team untriaged

Comments

@anuchandy
Copy link

anuchandy commented Oct 7, 2019

Description of the problem / feature request:

I'm building an android_binary with --experimental_desugar_java8_libs option. The library being build uses sun.misc.unsafe if it available in the platform, obviously this package not exists Android. My library has alternate path if this package does not exists. I'm using the option --noexperimental_check_desugar_deps to by pass optionally available types, but it seems this option is not working sun.misc.unsafe type.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Create a android java binary with dependency on sun.unsafe.misc and try to build it with --experimental_desugar_java8_libs

What operating system are you running Bazel on?

MacOS Mojave

What's the output of bazel info release?

0.29.1

Have you found anything relevant by searching the web?

No

@iirina iirina added team-Android Issues for Android team untriaged labels Oct 10, 2019
@ahumesky
Copy link
Contributor

Hi, desugaring sun.* classes isn't supported. Desugaring java 8 libs works with the classes located in the jar at this url in here:

bazel/WORKSPACE

Line 109 in 602bb2e

"https://mirror.bazel.build/github.com/google/desugar_jdk_libs/archive/e0b0291b2c51fbe5a7cfa14473a1ae850f94f021.zip",

namely:

java/lang/Double8.java
java/lang/Integer8.java
java/lang/Long8.java
java/lang/Math8.java
java/time/Clock.java
java/time/DateTimeException.java
java/time/DayOfWeek.java
java/time/Duration.java
java/time/Instant.java
java/time/LocalDate.java
java/time/LocalDateTime.java
java/time/LocalTime.java
java/time/Month.java
java/time/MonthDay.java
java/time/OffsetDateTime.java
java/time/OffsetTime.java
java/time/Period.java
java/time/Ser.java
java/time/Year.java
java/time/YearMonth.java
java/time/ZoneId.java
java/time/ZoneOffset.java
java/time/ZoneRegion.java
java/time/ZonedDateTime.java
java/time/chrono/AbstractChronology.java
java/time/chrono/ChronoLocalDate.java
java/time/chrono/ChronoLocalDateImpl.java
java/time/chrono/ChronoLocalDateTime.java
java/time/chrono/ChronoLocalDateTimeImpl.java
java/time/chrono/ChronoPeriod.java
java/time/chrono/ChronoPeriodImpl.java
java/time/chrono/ChronoZonedDateTime.java
java/time/chrono/ChronoZonedDateTimeImpl.java
java/time/chrono/Chronology.java
java/time/chrono/Era.java
java/time/chrono/HijrahChronology.java
java/time/chrono/HijrahDate.java
java/time/chrono/HijrahEra.java
java/time/chrono/IsoChronology.java
java/time/chrono/IsoEra.java
java/time/chrono/JapaneseChronology.java
java/time/chrono/JapaneseDate.java
java/time/chrono/JapaneseEra.java
java/time/chrono/MinguoChronology.java
java/time/chrono/MinguoDate.java
java/time/chrono/MinguoEra.java
java/time/chrono/Ser.java
java/time/chrono/ThaiBuddhistChronology.java
java/time/chrono/ThaiBuddhistDate.java
java/time/chrono/ThaiBuddhistEra.java
java/time/chrono/package-info.java
java/time/format/DateTimeFormatter.java
java/time/format/DateTimeFormatterBuilder.java
java/time/format/DateTimeParseContext.java
java/time/format/DateTimeParseException.java
java/time/format/DateTimePrintContext.java
java/time/format/DateTimeTextProvider.java
java/time/format/DecimalStyle.java
java/time/format/FormatStyle.java
java/time/format/Parsed.java
java/time/format/ResolverStyle.java
java/time/format/SignStyle.java
java/time/format/TextStyle.java
java/time/format/ZoneName.java
java/time/format/package-info.java
java/time/package-info.java
java/time/temporal/ChronoField.java
java/time/temporal/ChronoUnit.java
java/time/temporal/IsoFields.java
java/time/temporal/JulianFields.java
java/time/temporal/Temporal.java
java/time/temporal/TemporalAccessor.java
java/time/temporal/TemporalAdjuster.java
java/time/temporal/TemporalAdjusters.java
java/time/temporal/TemporalAmount.java
java/time/temporal/TemporalField.java
java/time/temporal/TemporalQueries.java
java/time/temporal/TemporalQuery.java
java/time/temporal/TemporalUnit.java
java/time/temporal/UnsupportedTemporalTypeException.java
java/time/temporal/ValueRange.java
java/time/temporal/WeekFields.java
java/time/temporal/package-info.java
java/time/zone/Ser.java
java/time/zone/TzdbZoneRulesProvider.java
java/time/zone/ZoneOffsetTransition.java
java/time/zone/ZoneOffsetTransitionRule.java
java/time/zone/ZoneRules.java
java/time/zone/ZoneRulesException.java
java/time/zone/ZoneRulesProvider.java
java/time/zone/package-info.java
java/util/Collection.java
java/util/Comparator.java
java/util/Comparators.java
java/util/Deque.java
java/util/DesugarArrays.java
java/util/DesugarCalendar.java
java/util/DesugarDate.java
java/util/DesugarGregorianCalendar.java
java/util/DesugarLinkedHashSet.java
java/util/DesugarTimeZone.java
java/util/DoubleSummaryStatistics.java
java/util/IntSummaryStatistics.java
java/util/Iterator.java
java/util/List.java
java/util/ListIterator.java
java/util/LongSummaryStatistics.java
java/util/Map.java
java/util/NavigableMap.java
java/util/NavigableSet.java
java/util/Objects.java
java/util/Optional.java
java/util/OptionalDouble.java
java/util/OptionalInt.java
java/util/OptionalLong.java
java/util/PrimitiveIterator.java
java/util/Queue.java
java/util/Set.java
java/util/SortedMap.java
java/util/SortedSet.java
java/util/Spliterator.java
java/util/Spliterators.java
java/util/StringJoiner.java
java/util/Tripwire.java
java/util/concurrent/BlockingDeque.java
java/util/concurrent/BlockingQueue.java
java/util/concurrent/ConcurrentHashMap.java
java/util/concurrent/ConcurrentMap.java
java/util/concurrent/ConcurrentNavigableMap.java
java/util/concurrent/DesugarUnsafe.java
java/util/concurrent/ThreadLocalRandom.java
java/util/concurrent/TransferQueue.java
java/util/concurrent/atomic/DesugarAtomicInteger.java
java/util/concurrent/atomic/DesugarAtomicLong.java
java/util/concurrent/atomic/DesugarAtomicReference.java
java/util/function/BiConsumer.java
java/util/function/BiFunction.java
java/util/function/BiPredicate.java
java/util/function/BinaryOperator.java
java/util/function/BooleanSupplier.java
java/util/function/Consumer.java
java/util/function/DoubleBinaryOperator.java
java/util/function/DoubleConsumer.java
java/util/function/DoubleFunction.java
java/util/function/DoublePredicate.java
java/util/function/DoubleSupplier.java
java/util/function/DoubleToIntFunction.java
java/util/function/DoubleToLongFunction.java
java/util/function/DoubleUnaryOperator.java
java/util/function/Function.java
java/util/function/IntBinaryOperator.java
java/util/function/IntConsumer.java
java/util/function/IntFunction.java
java/util/function/IntPredicate.java
java/util/function/IntSupplier.java
java/util/function/IntToDoubleFunction.java
java/util/function/IntToLongFunction.java
java/util/function/IntUnaryOperator.java
java/util/function/LongBinaryOperator.java
java/util/function/LongConsumer.java
java/util/function/LongFunction.java
java/util/function/LongPredicate.java
java/util/function/LongSupplier.java
java/util/function/LongToDoubleFunction.java
java/util/function/LongToIntFunction.java
java/util/function/LongUnaryOperator.java
java/util/function/ObjDoubleConsumer.java
java/util/function/ObjIntConsumer.java
java/util/function/ObjLongConsumer.java
java/util/function/Predicate.java
java/util/function/Supplier.java
java/util/function/ToDoubleBiFunction.java
java/util/function/ToDoubleFunction.java
java/util/function/ToIntBiFunction.java
java/util/function/ToIntFunction.java
java/util/function/ToLongBiFunction.java
java/util/function/ToLongFunction.java
java/util/function/UnaryOperator.java
java/util/function/package-info.java
java/util/stream/AbstractPipeline.java
java/util/stream/AbstractShortCircuitTask.java
java/util/stream/AbstractSpinedBuffer.java
java/util/stream/AbstractTask.java
java/util/stream/BaseStream.java
java/util/stream/Collector.java
java/util/stream/Collectors.java
java/util/stream/DistinctOps.java
java/util/stream/DoublePipeline.java
java/util/stream/DoubleStream.java
java/util/stream/FindOps.java
java/util/stream/ForEachOps.java
java/util/stream/IntPipeline.java
java/util/stream/IntStream.java
java/util/stream/LongPipeline.java
java/util/stream/LongStream.java
java/util/stream/MatchOps.java
java/util/stream/Node.java
java/util/stream/Nodes.java
java/util/stream/PipelineHelper.java
java/util/stream/ReduceOps.java
java/util/stream/ReferencePipeline.java
java/util/stream/Sink.java
java/util/stream/SliceOps.java
java/util/stream/SortedOps.java
java/util/stream/SpinedBuffer.java
java/util/stream/Stream.java
java/util/stream/StreamOpFlag.java
java/util/stream/StreamShape.java
java/util/stream/StreamSpliterators.java
java/util/stream/StreamSupport.java
java/util/stream/Streams.java
java/util/stream/TerminalOp.java
java/util/stream/TerminalSink.java
java/util/stream/Tripwire.java
java/util/stream/package-info.java

@alexjlockwood
Copy link

We are seeing some similar issues when trying to desugar the kotlin coroutines jar: #13553

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Android Issues for Android team untriaged
Projects
None yet
Development

No branches or pull requests

4 participants