Skip to content

Commit 4a434e4

Browse files
stefanbotezStefan Botez
and
Stefan Botez
authored
Update glibc to 2.17, remove dependency on EOL CentOS 6, include RIC pr target in GitHub action (aws#193)
Co-authored-by: Stefan Botez <[email protected]>
1 parent d616725 commit 4a434e4

File tree

6 files changed

+41
-27
lines changed

6 files changed

+41
-27
lines changed

.github/workflows/maven-build-all.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ jobs:
3131
run: mvn -B package --file aws-lambda-java-events-sdk-transformer/pom.xml
3232
- name: Build log4j2 with Maven
3333
run: mvn -B package --file aws-lambda-java-log4j2/pom.xml
34-
- name: Build serialization with Maven
35-
run: mvn -B package --file aws-lambda-java-serialization/pom.xml
36-
- name: Build runtime-interface-client with Maven
37-
run: mvn -B package --file aws-lambda-java-runtime-interface-client/pom.xml
34+
35+
# Test Runtime Interface Client
36+
- name: Run 'pr' target
37+
working-directory: ./aws-lambda-java-runtime-interface-client
38+
run: make pr

aws-lambda-java-runtime-interface-client/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Choose a preferred base image. The Runtime Interface Client is tested on Amazon
1515

1616
* built for x86_64
1717
* contains Java >= 8
18-
* contains glibc >= 2.12 or musl
18+
* contains glibc >= 2.17 or musl
1919

2020
### Example
2121

aws-lambda-java-runtime-interface-client/src/main/jni/Dockerfile.glibc

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# we use centos 6 to build against glibc 2.12
2-
FROM centos:6
1+
# we use centos 7 to build against glibc 2.17
2+
FROM centos:7
33

44
# aws-lambda-cpp requires cmake3, it's available in EPEL
55
RUN yum install -y epel-release
66
RUN yum install -y \
77
cmake3 \
8+
make \
89
gcc \
910
gcc-c++ \
1011
glibc-devel \

aws-lambda-java-runtime-interface-client/src/test/java/com/amazonaws/services/lambda/runtime/api/client/CustomerClassLoaderTest.java

+31-18
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,37 @@ private List<String> strip(String base, URL[] urls) {
9595
@Test
9696
@DisabledOnOs(MAC) // test fails on systems with case-insensitive volumes
9797
public void customerClassLoaderFunction() throws IOException {
98-
Path rootDir = fakeFileSystem(EXAMPLE_FUNCTION);
99-
100-
URLClassLoader customerClassLoader = new CustomerClassLoader(
101-
rootDir.resolve("user/path").toString(),
102-
rootDir.resolve("opt/java").toString(),
103-
ClassLoader.getSystemClassLoader());
104-
105-
List<String> res = strip("file:" + rootDir.toString(), customerClassLoader.getURLs());
106-
107-
Assertions.assertEquals(Arrays.asList(
108-
"/user/path/",
109-
"/user/path/lib/4.jar",
110-
"/user/path/lib/A.jar",
111-
"/user/path/lib/a.jar",
112-
"/user/path/lib/b.jar",
113-
"/user/path/lib/z.jar",
114-
"/user/path/lib/λ.jar"),
115-
res);
98+
try {
99+
Path rootDir = fakeFileSystem(EXAMPLE_FUNCTION);
100+
101+
URLClassLoader customerClassLoader = new CustomerClassLoader(
102+
rootDir.resolve("user/path").toString(),
103+
rootDir.resolve("opt/java").toString(),
104+
ClassLoader.getSystemClassLoader());
105+
106+
List<String> res = strip("file:" + rootDir.toString(), customerClassLoader.getURLs());
107+
108+
Assertions.assertEquals(Arrays.asList(
109+
"/user/path/",
110+
"/user/path/lib/4.jar",
111+
"/user/path/lib/A.jar",
112+
"/user/path/lib/a.jar",
113+
"/user/path/lib/b.jar",
114+
"/user/path/lib/z.jar",
115+
"/user/path/lib/λ.jar"),
116+
res);
117+
} catch(Throwable t) {
118+
// this system property is the name of the charset used when encoding/decoding file paths
119+
// exception is expected if it is not set to a UTF variant or not set at all
120+
String systemEncoding = System.getProperty("sun.jnu.encoding");
121+
122+
if (systemEncoding != null && !systemEncoding.toLowerCase().contains("utf")){
123+
Assertions.assertTrue(t.getMessage().contains("Malformed input or input contains unmappable characters"));
124+
}
125+
else {
126+
throw t;
127+
}
128+
}
116129
}
117130

118131
@Test

aws-lambda-java-runtime-interface-client/test/integration/codebuild-local/codebuild_build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ then
9595
exit 1
9696
fi
9797

98-
docker_command="docker run -it "
98+
docker_command="docker run "
9999
if isOSWindows
100100
then
101101
docker_command+="-v //var/run/docker.sock:/var/run/docker.sock -e "

aws-lambda-java-runtime-interface-client/test/integration/codebuild/buildspec.os.centos.yml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ batch:
1515
env:
1616
variables:
1717
DISTRO_VERSION:
18-
- "6"
1918
- "7"
2019
- "8"
2120
RUNTIME_VERSION:

0 commit comments

Comments
 (0)