Explicit need to specify -Piouring-native to compile the native bits … (#10546)

Motivation:

At the moment our CI can not build and run the native bits for the iouring transport so we should just not compile this at the moment. The java classes itself should still be compiled tho

Modifications:

Add explicit profile to compile native bits of iouring

Result:

CI passes with iouring transport
This commit is contained in:
Norman Maurer 2020-09-09 09:50:36 +02:00 committed by GitHub
parent 7a34f1e6c5
commit 5bd6611c0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 227 deletions

View File

@ -43,12 +43,6 @@
<artifactId>netty-buffer</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport-native-io_uring</artifactId>
<version>${project.version}</version>
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>netty-transport</artifactId>

View File

@ -44,76 +44,8 @@
</properties>
<profiles>
<!--
Netty must be released from RHEL 6.8 x86_64 or compatible so that:
1) we ship x86_64 version of epoll transport officially, and
2) we ensure the ABI compatibility with older GLIBC versions.
The shared library built on a distribution with newer GLIBC
will not run on older distributions.
-->
<profile>
<id>restricted-release-io_uring</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<dependencies>
<!-- Provides the 'requireFilesContent' enforcer rule. -->
<dependency>
<groupId>com.ceilfors.maven.plugin</groupId>
<artifactId>enforcer-rules</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-release-environment</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<regexMessage>
Release process must be performed on linux-x86_64.
</regexMessage>
<property>os.detected.classifier</property>
<regex>^linux-x86_64$</regex>
</requireProperty>
<requireFilesContent>
<message>
Release process must be performed on RHEL 6.8 or its derivatives.
</message>
<files>
<file>/etc/redhat-release</file>
</files>
<content>release 6.9</content>
</requireFilesContent>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>linux</id>
<activation>
<os>
<family>linux</family>
</os>
</activation>
<id>iouring-native</id>
<properties>
<skipTests>false</skipTests>
</properties>
@ -199,154 +131,6 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-unix-common</artifactId>
<version>${project.version}</version>
<classifier>${jni.classifier}</classifier>
<!--
The unix-common with classifier dependency is optional because it is not a runtime dependency, but a build time
dependency to get the static library which is built directly into the shared library generated by this project.
-->
<optional>true</optional>
</dependency>
</dependencies>
</profile>
<profile>
<id>linux-aarch64</id>
<properties>
<jni.classifier>${os.detected.name}-aarch64</jni.classifier>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<dependencies>
<!-- Provides the 'requireFilesContent' enforcer rule. -->
<dependency>
<groupId>com.ceilfors.maven.plugin</groupId>
<artifactId>enforcer-rules</artifactId>
<version>1.2.0</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-release-environment</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<regexMessage>
Cross compile and Release process must be performed on linux-x86_64.
</regexMessage>
<property>os.detected.classifier</property>
<regex>^linux-x86_64.*</regex>
</requireProperty>
<requireFilesContent>
<message>
Cross compile and Release process must be performed on RHEL 7.6 or its derivatives.
</message>
<files>
<file>/etc/redhat-release</file>
</files>
<content>release 7.6</content>
</requireFilesContent>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<!-- unpack the unix-common static library and include files -->
<execution>
<id>unpack</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>${project.groupId}</includeGroupIds>
<includeArtifactIds>netty-transport-native-unix-common</includeArtifactIds>
<classifier>${jni.classifier}</classifier>
<outputDirectory>${unix.common.lib.dir}</outputDirectory>
<includes>META-INF/native/**</includes>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.fusesource.hawtjni</groupId>
<artifactId>maven-hawtjni-plugin</artifactId>
<executions>
<execution>
<id>build-native-lib</id>
<configuration>
<name>netty_transport_native_io_uring_aarch_64</name>
<nativeSourceDirectory>${nativeSourceDirectory}</nativeSourceDirectory>
<libDirectory>${project.build.outputDirectory}</libDirectory>
<!-- We use Maven's artifact classifier instead.
This hack will make the hawtjni plugin to put the native library
under 'META-INF/native' rather than 'META-INF/native/${platform}'. -->
<platform>.</platform>
<configureArgs>
<arg>${jni.compiler.args.ldflags}</arg>
<arg>${jni.compiler.args.cflags}</arg>
<configureArg>--libdir=${project.build.directory}/native-build/target/lib</configureArg>
<configureArg>--host=aarch64-linux-gnu</configureArg>
</configureArgs>
</configuration>
<goals>
<goal>generate</goal>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<!-- Generate the JAR that contains the native library in it. -->
<execution>
<id>native-jar</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Bundle-NativeCode>META-INF/native/libnetty_transport_native_io_uring_aarch_64.so; osname=Linux; processor=aarch_64,*</Bundle-NativeCode>
<Automatic-Module-Name>${javaModuleName}</Automatic-Module-Name>
</manifestEntries>
<index>true</index>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
<classifier>${jni.classifier}</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>io.netty</groupId>

View File

@ -13,10 +13,9 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.example.uring;
package io.netty.channel.uring.example;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;

View File

@ -13,11 +13,11 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.example.uring;
import io.netty.channel.ChannelInboundHandlerAdapter;
package io.netty.channel.uring.example;
import io.netty.channel.ChannelHandler.Sharable;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
//temporary prototype example
@Sharable