Compare commits

...

23 Commits

Author SHA1 Message Date
Andrea Cavalli 219bbd44dc Rename package 2021-09-17 16:28:15 +02:00
Norman Maurer 05f79e9e45 [maven-release-plugin] prepare for next development iteration 2021-03-19 09:57:50 +01:00
Norman Maurer 3048744436 [maven-release-plugin] prepare release netty-build-29 2021-03-19 09:57:45 +01:00
Chris Vest 0acd55a44e
Merge pull request #11 from chrisvest/checkstyle-modules
Make checkstyle ignore module-info.java files
2021-03-18 16:55:20 +01:00
Chris Vest 51248ba58f Make checkstyle ignore module-info.java files
Checkstyle cannot yet parse these files, so we have to make it ignore them.
2021-03-18 11:47:30 +01:00
Norman Maurer b1ce81f888 [maven-release-plugin] prepare for next development iteration 2020-11-06 07:51:30 +01:00
Norman Maurer c2c0aef2b7 [maven-release-plugin] prepare release netty-build-28 2020-11-06 07:51:22 +01:00
Norman Maurer 62f3b989cb Fix location of xml files 2020-11-06 07:49:21 +01:00
Norman Maurer d470fe9b49 [maven-release-plugin] prepare for next development iteration 2020-11-05 15:59:52 +01:00
Norman Maurer d1dbd3108f [maven-release-plugin] prepare release netty-build-27 2020-11-05 15:59:44 +01:00
Norman Maurer 7e00129e61 Rename artifacts 2020-11-05 15:56:18 +01:00
Norman Maurer af09be8634
Introduce maven plugin that can check that a native lib can be used w… (#10)
Motivation:

In the past we messed up released native libs as we did compile on the wrong GLIBC version. This can lead to situations when its not possible anymore to use the native libs an a specific system. We should be able to verify that all works as expected during the build / release process.

Modifications:

- Make netty-build a multi maven module project
- Move all existing code to the common module
- Introduce glibccheck-maven-plugin that can be used to validate that a native lib will be usable with a specific GLIBC version

Result:

Provide maven plugin that can be used to verify linking of native lib to correct GLIBC version
2020-11-05 13:55:43 +01:00
dependabot[bot] ddd2826d7d
Bump junit from 4.12 to 4.13.1 (#9)
Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1.
- [Release notes](https://github.com/junit-team/junit4/releases)
- [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.12.md)
- [Commits](https://github.com/junit-team/junit4/compare/r4.12...r4.13.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-10-21 12:06:03 +02:00
Norman Maurer f1acaa1345 [maven-release-plugin] prepare for next development iteration 2020-02-03 11:29:39 +01:00
Norman Maurer 2c58bda379 [maven-release-plugin] prepare release netty-build-26 2020-02-03 11:29:33 +01:00
Norman Maurer 79b48e49ca
Update checkstyle to 8.29 (#8)
Motivation:

We need to upgrade our checkstyle version to 8.29 to fix a security vulnerability

Modifications:

Update version of checkstyle and make config compatible with latest version

Result:

Other projects can update their dependencies to use the new checkstyle version while also depending on netty-build
2020-02-03 11:28:22 +01:00
Norman Maurer 384d3e83a8 [maven-release-plugin] prepare for next development iteration 2019-03-26 09:17:42 +01:00
Norman Maurer 1d3ed0cc3e [maven-release-plugin] prepare release netty-build-25 2019-03-26 09:17:35 +01:00
Norman Maurer 5987566c1c Upgrade to com.puppycrawl.tools 8.18 as earlier versions were reported to may cause security problems. 2019-03-26 09:15:37 +01:00
Norman Maurer 5a0cedf3e4 [maven-release-plugin] prepare for next development iteration 2019-03-22 10:02:34 +01:00
Norman Maurer 612faded5f [maven-release-plugin] prepare release netty-build-24 2019-03-22 10:02:26 +01:00
Norman Maurer edb1a98ae3 Also match copyright headers in properties files 2019-03-22 10:01:13 +01:00
Norman Maurer fc0b4383e9 [maven-release-plugin] prepare for next development iteration 2019-01-24 14:56:10 +01:00
11 changed files with 439 additions and 40 deletions

37
common/pom.xml Normal file
View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2020 The Netty Project
~
~ The Netty Project licenses this file to you under the Apache License,
~ version 2.0 (the "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at:
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
~ License for the specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>netty-build</artifactId>
<groupId>io.net5</groupId>
<version>30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>netty-build-common</artifactId>
<name>Netty/Build/Common</name>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -14,13 +14,12 @@
* under the License.
*/
package io.netty.build.checkstyle;
package io.net5.build.checkstyle;
import com.puppycrawl.tools.checkstyle.api.AbstractFileSetCheck;
import com.puppycrawl.tools.checkstyle.api.FileText;
import java.io.File;
import java.util.List;
import java.util.regex.Pattern;
public class NewlineCheck extends AbstractFileSetCheck {
@ -57,8 +56,8 @@ public class NewlineCheck extends AbstractFileSetCheck {
}
@Override
protected void processFiltered(File aFile, List<String> aLines) {
String text = FileText.fromLines(aFile, aLines).getFullText().toString();
protected void processFiltered(File file, FileText fileText) {
String text = fileText.getFullText().toString();
switch (NEWLINE_TYPE) {
case LF:

View File

@ -13,7 +13,7 @@
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.netty.build.checkstyle;
package io.net5.build.checkstyle;
import com.puppycrawl.tools.checkstyle.api.AuditEvent;
import com.puppycrawl.tools.checkstyle.api.AutomaticBean;
@ -58,4 +58,9 @@ public class SuppressionFilter extends AutomaticBean implements Filter {
}
return true;
}
@Override
protected void finishLocalSetup() {
// NOOP.
}
}

View File

@ -30,7 +30,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.netty.build.junit;
package io.net5.build.junit;
import java.io.PrintWriter;
import java.io.StringWriter;

View File

@ -19,17 +19,21 @@
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<module name="SuppressionFilter">
<property name="file" value="/io/netty/suppressions.xml" />
<property name="file" value="/io/net5/suppressions.xml" />
</module>
<module name="io.netty.build.checkstyle.SuppressionFilter">
<module name="io.net5.build.checkstyle.SuppressionFilter">
<property name="pattern" value="((LocalTime|WorldClock)Protocol|LinkedTransferQueue|Version|jzlib/.*|chmv8/.*|com/sun/nio/sctp/.*)\.java" />
</module>
<!-- Ignore module-info.java because checkstyle cannot parse these yet. -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
<module name="FileTabCharacter"/>
<module name="JavadocPackage"/>
<module name="NewlineAtEndOfFile" />
<!-- Copyright headers -->
<module name="RegexpSingleline">
<property name="format" value="^(\s|\*)*Copyright\s+[0-9]+\s+The Netty Project\s*$"/>
<property name="format" value="^(\s|\*|#)*Copyright\s+[0-9]+\s+The Netty Project\s*$"/>
<property name="minimum" value="1"/>
<property name="maximum" value="1"/>
<property name="message" value="missing copyright header"/>
@ -46,7 +50,7 @@
<property name="message" value="IDE-generated comment"/>
</module>
<!-- Force UNIX line separator -->
<module name="io.netty.build.checkstyle.NewlineCheck"/>
<module name="io.net5.build.checkstyle.NewlineCheck"/>
<!-- Trailing whitespace -->
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
@ -67,10 +71,12 @@
<property name="message" value="an empty line after a short line that ends with '{'"/>
</module>
<module name="LineLength">
<property name="max" value="120"/>
<property name="fileExtensions" value="java"/>
</module>
<module name="TreeWalker">
<module name="LineLength">
<property name="max" value="120"/>
</module>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround">
<property name="tokens" value="ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, DIV, DIV_ASSIGN, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND"/>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2020 The Netty Project
~
~ The Netty Project licenses this file to you under the Apache License,
~ version 2.0 (the "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at:
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
~ License for the specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>netty-build</artifactId>
<groupId>io.net5</groupId>
<version>30-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>maven-plugin</packaging>
<artifactId>netty-build-glibccheck-maven-plugin</artifactId>
<name>Netty/Build/GlibcCheck</name>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
</dependency>
<!-- dependencies to annotations -->
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,177 @@
/*
* Copyright 2020 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.net5.build.maven;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.Locale;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Verify that a native library is usable on a specific GLIBC version.
*/
@Mojo(name= "versioncheck", defaultPhase = LifecyclePhase.VERIFY)
public final class GlibcVersionCheckMojo extends AbstractMojo {
// Pattern / regex to extract the GLIBC version dependencies.
private static final Pattern GLIBC_PATTERN = Pattern.compile(".+ GLIBC_([0-9]).([0-9]+)(.([0-9]+))? (.+)");
@Parameter( property = "versioncheck.maxGlibcVersion", required = true)
private String maxGlibcVersion;
@Parameter( property = "versioncheck.objdump")
private String objdump;
@Parameter( property = "versioncheck.nativeLib", required = true)
private File nativeLib;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (objdump == null) {
// Try to detect the objdump installation.
String osname = System.getProperty("os.name", "").toLowerCase(Locale.US)
.replaceAll("[^a-z0-9]+", "");
boolean osx = osname.startsWith("macosx") || osname.startsWith("osx");
if (osx) {
objdump = checkObjdumpExists("/usr/local/opt/binutils/bin/gobjdump", "brew install binutils");
} else {
objdump = checkObjdumpExists("/usr/bin/objdump", "apt-get|yum install binutils");
}
}
String[] versionParts = maxGlibcVersion.split("\\.");
if (versionParts.length < 1 || versionParts.length > 3) {
throw new MojoExecutionException("Unable to parse maxGlibcVersion: " + maxGlibcVersion);
}
// Parse the major, minor and bugfix versions
final int majorVersion;
final int minorVersion;
final int bugFixVersion;
try {
majorVersion = Integer.parseInt(versionParts[0]);
if (versionParts.length == 1) {
minorVersion = 0;
bugFixVersion = 0;
} else {
minorVersion = Integer.parseInt(versionParts[1]);
if (versionParts.length == 2) {
bugFixVersion = 0;
} else {
bugFixVersion = Integer.parseInt(versionParts[2]);
}
}
} catch (NumberFormatException e) {
throw new MojoExecutionException("Unable to parse maxGlibcVersion: " + maxGlibcVersion, e);
}
if ( !nativeLib.isFile() ) {
throw new MojoExecutionException(nativeLib + " is not a file");
}
InputStream in = null;
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
String cmd = objdump + " -T " + nativeLib;
Process process = Runtime.getRuntime()
.exec(cmd);
int rcode = process.waitFor();
if (rcode != 0) {
throw new MojoExecutionException(cmd + " exit with return code " + rcode);
}
in = process.getInputStream();
byte[] bytes = new byte[8192];
int i;
while ((i = in.read(bytes)) != -1) {
out.write(bytes, 0, i);
}
out.flush();
check(majorVersion, minorVersion, bugFixVersion, new String(out.toByteArray(), StandardCharsets.UTF_8));
} catch (InterruptedException e) {
throw new MojoExecutionException("Interrupted while waiting for objdump to complete", e);
} catch (IOException e) {
throw new MojoExecutionException("Unable to execute objdump", e);
} finally {
closeSilently(in);
closeSilently(out);
}
}
private static void closeSilently(Closeable closeable) {
if (closeable != null) {
try {
closeable.close();
} catch (IOException ignore) {
// ignore
}
}
}
// Package-private for easy testing
static void check(int major, int minor, int bugfix, String in) throws MojoFailureException {
StringTokenizer tokenizer = new StringTokenizer(in, "\n");
while (tokenizer.hasMoreElements()) {
String line = tokenizer.nextToken();
Matcher matcher = GLIBC_PATTERN.matcher(line);
if (matcher.matches()) {
int foundMajor = Integer.parseInt(matcher.group(1));
int foundMinor = Integer.parseInt(matcher.group(2));
int foundBugfix = matcher.group(4) == null ? 0 : Integer.parseInt(matcher.group(4));
String function = matcher.group(5).trim();
if (foundMajor > major) {
failure(major, minor, bugfix, foundMajor, foundMinor, foundBugfix, function);
} else if (foundMajor == major) {
if (foundMinor > minor) {
failure(major, minor, bugfix, foundMajor, foundMinor, foundBugfix, function);
} else if (foundMinor == minor) {
if (foundBugfix > bugfix) {
failure(major, minor, bugfix, foundMajor, foundMinor, foundBugfix, function);
}
}
}
}
}
}
private static String checkObjdumpExists(String objdump, String installInstructions) throws MojoExecutionException {
File f = new File(objdump);
if (!f.exists() || !f.canExecute()) {
throw new MojoExecutionException("Unable to execute '" + objdump + "'." +
" May need to install it via '" + installInstructions + "'.");
}
return objdump;
}
private static void failure(int major, int minor, int bugfix, int foundMajor,
int foundMinor, int foundBugfix, String function) throws MojoFailureException{
throw new MojoFailureException("Required GLIBC " +
glibcVersion(foundMajor, foundMinor, foundBugfix) + " > " +
glibcVersion(major, minor, bugfix) + ". Required by '" + function + "'.");
}
private static String glibcVersion(int major, int minor, int bugfix) {
return major + "." + minor + "." + bugfix;
}
}

View File

@ -0,0 +1,117 @@
/*
* Copyright 2020 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package io.net5.build.maven;
import org.apache.maven.plugin.MojoFailureException;
import org.junit.Test;
public class GlibcVersionCheckMojoTest {
private static final String OBJDUMP_OUTPUT = "\n" +
"/tmp/libnetty_transport_native_epoll_x86_64.so: file format elf64-x86-64\n" +
"\n" +
"DYNAMIC SYMBOL TABLE:\n" +
"0000000000003a60 l d .init\t0000000000000000 .init\n" +
"0000000000000000 w DF *UND*\t0000000000000000 GLIBC_2.9 pipe2\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 memset\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 snprintf\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 shutdown\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 close\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.3.2 epoll_create\n" +
"0000000000000000 w D *UND*\t0000000000000000 __gmon_start__\n" +
"0000000000000000 w D *UND*\t0000000000000000 _Jv_RegisterClasses\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 recvmsg\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 uname\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.5 splice\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 getpeername\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 read\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 strncmp\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 malloc\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 fopen\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 unlink\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 setsockopt\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.7 eventfd\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 fgets\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 free\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 strlen\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 listen\n" +
"0000000000000000 w DF *UND*\t0000000000000000 GLIBC_2.2.5 __cxa_finalize\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 syscall\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 pipe\n" +
"0000000000000000 w DF *UND*\t0000000000000000 GLIBC_2.9 epoll_create1\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 sendmsg\n" +
"0000000000000000 DO *UND*\t0000000000000000 GLIBC_2.2.5 in6addr_any\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 strerror\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.3.2 epoll_ctl\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 strstr\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 strcat\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 getsockopt\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 strtol\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 getsockname\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 connect\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 memcpy\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.7 eventfd_read\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 socket\n" +
"0000000000000000 D *UND*\t0000000000000000 dladdr\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 sendfile\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 __errno_location\n" +
"0000000000000000 w DF *UND*\t0000000000000000 GLIBC_2.10 accept4\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 strcpy\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.3.2 epoll_wait\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.7 eventfd_write\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 calloc\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.3.4 __xpg_strerror_r\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 writev\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 fclose\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 recvfrom\n" +
"0000000000000000 DO *UND*\t0000000000000000 GLIBC_2.2.5 stderr\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 sendto\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 bind\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 fwrite\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.8 timerfd_create\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 fprintf\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.8 timerfd_settime\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 write\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 accept\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 clock_gettime\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 fcntl\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 open\n" +
"0000000000000000 DF *UND*\t0000000000000000 GLIBC_2.2.5 strndup\n" +
"000000000020f950 g D *ABS*\t0000000000000000 Base _end\n" +
"000000000020f864 g D *ABS*\t0000000000000000 Base _edata\n" +
"0000000000006fa0 g DF .text\t0000000000000099 Base JNI_OnUnload_netty_transport_native_epoll\n" +
"0000000000007040 g DF .text\t0000000000000099 Base JNI_OnUnload\n" +
"000000000020f864 g D *ABS*\t0000000000000000 Base __bss_start\n" +
"0000000000003a60 g DF .init\t0000000000000000 Base _init\n" +
"000000000000b0c8 g DF .fini\t0000000000000000 Base _fini\n" +
"0000000000006430 g DF .text\t000000000000000a Base JNI_OnLoad\n" +
"0000000000006440 g DF .text\t000000000000000a Base JNI_OnLoad_netty_transport_native_epoll";
@Test(expected = MojoFailureException.class)
public void testMaxVersionLower() throws MojoFailureException {
GlibcVersionCheckMojo.check(2, 8, 1, OBJDUMP_OUTPUT);
}
@Test
public void testMaxVersionMatch() throws MojoFailureException {
GlibcVersionCheckMojo.check(2,10, 0, OBJDUMP_OUTPUT);
}
@Test
public void testMaxVersionHigher() throws MojoFailureException {
GlibcVersionCheckMojo.check(2,10, 1, OBJDUMP_OUTPUT);
}
}

70
pom.xml
View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2012 The Netty Project
~ Copyright 2020 The Netty Project
~
~ The Netty Project licenses this file to you under the Apache License,
~ version 2.0 (the "License"); you may not use this file except in compliance
@ -17,17 +17,22 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>9</version>
<relativePath />
</parent>
<modules>
<module>common</module>
<module>glibccheck-maven-plugin</module>
</modules>
<distributionManagement>
<repository>
<id>mchv-snapshot</id>
<name>MCHV Apache Snapshot Maven Packages Distribution</name>
<url>https://mvn.mchv.eu/repository/mchv-snapshot</url>
</repository>
</distributionManagement>
<groupId>io.netty</groupId>
<groupId>io.net5</groupId>
<artifactId>netty-build</artifactId>
<packaging>jar</packaging>
<version>23</version>
<packaging>pom</packaging>
<version>30-SNAPSHOT</version>
<name>Netty/Build</name>
@ -53,7 +58,7 @@
<url>https://github.com/netty/netty-build</url>
<connection>scm:git:git://github.com/netty/netty-build.git</connection>
<developerConnection>scm:git:ssh://git@github.com/netty/netty-build.git</developerConnection>
<tag>netty-build-23</tag>
<tag>HEAD</tag>
</scm>
<developers>
@ -67,20 +72,31 @@
</developer>
</developers>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>6.16.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.0.5</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.29</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
@ -88,8 +104,8 @@
<version>3.0</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.6</source>
<target>1.6</target>
<source>1.7</source>
<target>1.7</target>
<debug>true</debug>
<optimize>true</optimize>
<showDeprecation>true</showDeprecation>