question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for M1 Silicon Macs - Can't build Netty

See original GitHub issue

I know the M1 Macs are still relatively new and not all developers have them, I decided to try to build Netty for the first time ever on my M1 Mac and it failed.

Just letting you know in case no one has tried before.

I also wonder if the NATIVE-TRANSPORTS (kqueue) will also build on M1 Macs?

Expected behavior

To be able to run mvn clean package successfully

Actual behavior

Build fails with error:

[INFO] Running io.netty.handler.codec.compression.BrotliEncoderTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 s <<< FAILURE! - in io.netty.handler.codec.compression.BrotliEncoderTest
[ERROR] io.netty.handler.codec.compression.BrotliEncoderTest  Time elapsed: 0 s  <<< ERROR!
java.lang.ExceptionInInitializerError
	at io.netty.handler.codec.compression.BrotliEncoderTest.<clinit>(BrotliEncoderTest.java:35)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
	at org.junit.jupiter.api.condition.MethodBasedCondition.invokeConditionMethod(MethodBasedCondition.java:82)
	at org.junit.jupiter.api.condition.MethodBasedCondition.lambda$evaluateExecutionCondition$1(MethodBasedCondition.java:52)
	at java.base/java.util.Optional.map(Optional.java:260)
	at org.junit.jupiter.api.condition.MethodBasedCondition.evaluateExecutionCondition(MethodBasedCondition.java:52)
	at org.junit.jupiter.engine.execution.ConditionEvaluator.evaluate(ConditionEvaluator.java:64)
	at org.junit.jupiter.engine.execution.ConditionEvaluator.lambda$evaluate$0(ConditionEvaluator.java:55)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)
	at java.base/java.util.stream.Streams$ConcatSpliterator.tryAdvance(Streams.java:723)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
	at org.junit.jupiter.engine.execution.ConditionEvaluator.evaluate(ConditionEvaluator.java:57)
	at org.junit.jupiter.engine.descriptor.JupiterTestDescriptor.shouldBeSkipped(JupiterTestDescriptor.java:202)
	at org.junit.jupiter.engine.descriptor.JupiterTestDescriptor.shouldBeSkipped(JupiterTestDescriptor.java:57)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$checkWhetherSkipped$2(NodeTestTask.java:119)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.checkWhetherSkipped(NodeTestTask.java:119)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:81)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
Caused by: java.lang.UnsatisfiedLinkError: Failed to load Brotli native library
	at com.aayushatharva.brotli4j.Brotli4jLoader.ensureAvailability(Brotli4jLoader.java:78)
	at io.netty.handler.codec.compression.Brotli.ensureAvailability(Brotli.java:71)
	at io.netty.handler.codec.compression.BrotliEncoderTest.<clinit>(BrotliEncoderTest.java:33)
	... 53 more
Caused by: java.lang.UnsupportedOperationException: Unsupported OS and Architecture: Mac OS X, aarch64
	at com.aayushatharva.brotli4j.Brotli4jLoader.getPlatform(Brotli4jLoader.java:106)
	at com.aayushatharva.brotli4j.Brotli4jLoader.<clinit>(Brotli4jLoader.java:38)
	at io.netty.handler.codec.compression.Brotli.<clinit>(Brotli.java:46)
	at io.netty.handler.codec.compression.BrotliDecoderTest.<clinit>(BrotliDecoderTest.java:49)
	... 53 more

Steps to reproduce

Clone Netty repo and run mvn clean package

Minimal yet complete reproducer code (or URL to code)

Netty version

JVM version (e.g. java -version)

JDk11 and JDK17

OS version (e.g. uname -a)

21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 arm64

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
normanmaurercommented, Jan 20, 2022

@hyperxpro please do if you have time… I have some other stuff todo first.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't build to simulator on Apple … | Apple Developer Forums
It only popped up when trying to build on my new M1 MacBook Air and Xcode 12. I've tried everything that's been reported...
Read more >
Java Development on an Apple M1 (ARM64) - rieckpil
The underlying issue is a JNA (Java Native Access) dependency incompatibility with Apple's M1 chip. Testcontainers transitively depends on this ...
Read more >
Spring Boot 2.4.2 - DNS Resolution Problem at start on Apple ...
This one is working on my MacBook Pro M1 Pro <dependency> <groupId>io.netty< ...
Read more >
Native transports - Netty.docs
These JNI transports add features specific to a particular platform, ... are not supported by the official builds of the Netty native transports....
Read more >
Apple silicon support SonarQube and SonarScanner
Does SonarQube support apple silicon m1 chip? I have completed setup with docker but localhost:9000 url not working.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found