From 2903314e92674e5cf4f767a546318885f86ebee0 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 9 Aug 2024 15:56:05 -0700 Subject: [PATCH 01/37] add extract lib API --- .../java/software/amazon/awssdk/crt/CRT.java | 129 ++++++++++-------- 1 file changed, 72 insertions(+), 57 deletions(-) diff --git a/src/main/java/software/amazon/awssdk/crt/CRT.java b/src/main/java/software/amazon/awssdk/crt/CRT.java index eb28886a6..60f549e3a 100644 --- a/src/main/java/software/amazon/awssdk/crt/CRT.java +++ b/src/main/java/software/amazon/awssdk/crt/CRT.java @@ -245,64 +245,19 @@ private static List runProcess(String[] cmdArray) throws IOException { return output; } - private static void extractAndLoadLibrary(String path) { + public static void extractLibrary(File extractFile) { try { - // Check java.io.tmpdir - String tmpdirPath; - File tmpdirFile; - try { - tmpdirFile = new File(path).getAbsoluteFile(); - tmpdirPath = tmpdirFile.getAbsolutePath(); - if (tmpdirFile.exists()) { - if (!tmpdirFile.isDirectory()) { - throw new IOException("not a directory: " + tmpdirPath); - } - } else { - tmpdirFile.mkdirs(); - } - - if (!tmpdirFile.canRead() || !tmpdirFile.canWrite()) { - throw new IOException("access denied: " + tmpdirPath); - } - } catch (Exception ex) { - String msg = "Invalid directory: " + path; - throw new IOException(msg, ex); - } - - String libraryName = System.mapLibraryName(CRT_LIB_NAME); - - // Prefix the lib we'll extract to disk - String tempSharedLibPrefix = "AWSCRT_"; - - File tempSharedLib = File.createTempFile(tempSharedLibPrefix, libraryName, tmpdirFile); - if (!tempSharedLib.setExecutable(true, true)) { + if (!extractFile.setExecutable(true, true)) { throw new CrtRuntimeException("Unable to make shared library executable by owner only"); } - if (!tempSharedLib.setWritable(true, true)) { + if (!extractFile.setWritable(true, true)) { throw new CrtRuntimeException("Unable to make shared library writeable by owner only"); } - if (!tempSharedLib.setReadable(true, true)) { + if (!extractFile.setReadable(true, true)) { throw new CrtRuntimeException("Unable to make shared library readable by owner only"); } - - // The temp lib file should be deleted when we're done with it. - // Ask Java to try and delete it on exit. We call this immediately - // so that if anything goes wrong writing the file to disk, or - // loading it as a shared lib, it will still get cleaned up. - tempSharedLib.deleteOnExit(); - - // Unfortunately File.deleteOnExit() won't work on Windows, where - // files cannot be deleted while they're in use. On Windows, once - // our .dll is loaded, it can't be deleted by this process. - // - // The Windows-only solution to this problem is to scan on startup - // for old instances of the .dll and try to delete them. If another - // process is still using the .dll, the delete will fail, which is fine. + String libraryName = System.mapLibraryName(CRT_LIB_NAME); String os = getOSIdentifier(); - if (os.equals("windows")) { - tryDeleteOldLibrariesFromTempDir(tmpdirFile, tempSharedLibPrefix, libraryName); - } - // open a stream to read the shared lib contents from this JAR String libResourcePath = "/" + os + "/" + getArchIdentifier() + "/" + getCRuntime(os) + "/" + libraryName; // Check whether there is a platform specific resource path to use @@ -313,14 +268,13 @@ private static void extractAndLoadLibrary(String path) { libResourcePath = platformLibResourcePath; } } - try (InputStream in = CRT.class.getResourceAsStream(libResourcePath)) { if (in == null) { throw new IOException("Unable to open library in jar for AWS CRT: " + libResourcePath); } // Copy from jar stream to temp file - try (FileOutputStream out = new FileOutputStream(tempSharedLib)) { + try (FileOutputStream out = new FileOutputStream(extractFile)) { int read; byte [] bytes = new byte[1024]; while ((read = in.read(bytes)) != -1){ @@ -328,13 +282,9 @@ private static void extractAndLoadLibrary(String path) { } } } - - if (!tempSharedLib.setWritable(false)) { + if (!extractFile.setWritable(false)) { throw new CrtRuntimeException("Unable to make shared library read-only"); } - - // load the shared lib from the temp path - System.load(tempSharedLib.getAbsolutePath()); } catch (CrtRuntimeException crtex) { System.err.println("Unable to initialize AWS CRT: " + crtex); crtex.printStackTrace(); @@ -354,6 +304,71 @@ private static void extractAndLoadLibrary(String path) { } } + public static void extractLibrary(String path) { + String libraryName = System.mapLibraryName(CRT_LIB_NAME); + File extractFile = new File(path, libraryName); + try { + extractFile.createNewFile(); + } catch (Exception ex) { + CrtRuntimeException rex = new CrtRuntimeException("Unable to create file on path:" + extractFile.getAbsolutePath()); + rex.initCause(ex); + throw rex; + } + extractLibrary(extractFile); + } + + private static void extractAndLoadLibrary(String path) { + // Check java.io.tmpdir + String tmpdirPath; + File tmpdirFile; + try { + tmpdirFile = new File(path).getAbsoluteFile(); + tmpdirPath = tmpdirFile.getAbsolutePath(); + if (tmpdirFile.exists()) { + if (!tmpdirFile.isDirectory()) { + throw new IOException("not a directory: " + tmpdirPath); + } + } else { + tmpdirFile.mkdirs(); + } + + if (!tmpdirFile.canRead() || !tmpdirFile.canWrite()) { + throw new IOException("access denied: " + tmpdirPath); + } + } catch (Exception ex) { + CrtRuntimeException rex = new CrtRuntimeException("Invalid directory: " + path); + rex.initCause(ex); + throw rex; + } + + String libraryName = System.mapLibraryName(CRT_LIB_NAME); + + // Prefix the lib we'll extract to disk + String tempSharedLibPrefix = "AWSCRT_"; + File tempSharedLib = File.createTempFile(tempSharedLibPrefix, libraryName, tmpdirFile); + + // The temp lib file should be deleted when we're done with it. + // Ask Java to try and delete it on exit. We call this immediately + // so that if anything goes wrong writing the file to disk, or + // loading it as a shared lib, it will still get cleaned up. + tempSharedLib.deleteOnExit(); + + // Unfortunately File.deleteOnExit() won't work on Windows, where + // files cannot be deleted while they're in use. On Windows, once + // our .dll is loaded, it can't be deleted by this process. + // + // The Windows-only solution to this problem is to scan on startup + // for old instances of the .dll and try to delete them. If another + // process is still using the .dll, the delete will fail, which is fine. + String os = getOSIdentifier(); + if (os.equals("windows")) { + tryDeleteOldLibrariesFromTempDir(tmpdirFile, tempSharedLibPrefix, libraryName); + } + extractLibrary(tempSharedLib); + // load the shared lib from the temp path + System.load(tempSharedLib.getAbsolutePath()); + } + private static void loadLibraryFromJar() { // By default, just try java.io.tmpdir List pathsToTry = new LinkedList<>(); From ab8c823a6766ff3005d8e6fd719377603a74fdcb Mon Sep 17 00:00:00 2001 From: Dengke Date: Mon, 12 Aug 2024 12:00:59 -0700 Subject: [PATCH 02/37] revamp --- .../java/software/amazon/awssdk/crt/CRT.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/software/amazon/awssdk/crt/CRT.java b/src/main/java/software/amazon/awssdk/crt/CRT.java index 60f549e3a..bb7487b2a 100644 --- a/src/main/java/software/amazon/awssdk/crt/CRT.java +++ b/src/main/java/software/amazon/awssdk/crt/CRT.java @@ -335,7 +335,7 @@ private static void extractAndLoadLibrary(String path) { if (!tmpdirFile.canRead() || !tmpdirFile.canWrite()) { throw new IOException("access denied: " + tmpdirPath); } - } catch (Exception ex) { + } catch (IOException ex) { CrtRuntimeException rex = new CrtRuntimeException("Invalid directory: " + path); rex.initCause(ex); throw rex; @@ -345,8 +345,17 @@ private static void extractAndLoadLibrary(String path) { // Prefix the lib we'll extract to disk String tempSharedLibPrefix = "AWSCRT_"; - File tempSharedLib = File.createTempFile(tempSharedLibPrefix, libraryName, tmpdirFile); - + File tempSharedLib = null; + try{ + tempSharedLib = File.createTempFile(tempSharedLibPrefix, libraryName, tmpdirFile); + } + catch (IOException ex){ + System.err.println("Unable to create temp file to extract AWS CRT library" + ex); + ex.printStackTrace(); + CrtRuntimeException rex = new CrtRuntimeException("Unable to create temp file to extract AWS CRT library"); + rex.initCause(ex); + throw rex; + } // The temp lib file should be deleted when we're done with it. // Ask Java to try and delete it on exit. We call this immediately // so that if anything goes wrong writing the file to disk, or @@ -367,6 +376,7 @@ private static void extractAndLoadLibrary(String path) { extractLibrary(tempSharedLib); // load the shared lib from the temp path System.load(tempSharedLib.getAbsolutePath()); + } private static void loadLibraryFromJar() { From 5588c94b9db367329e02ba07e491912d6f8b313d Mon Sep 17 00:00:00 2001 From: Dengke Date: Mon, 12 Aug 2024 14:24:31 -0700 Subject: [PATCH 03/37] add comments --- src/main/java/software/amazon/awssdk/crt/CRT.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/software/amazon/awssdk/crt/CRT.java b/src/main/java/software/amazon/awssdk/crt/CRT.java index bb7487b2a..c15344a2e 100644 --- a/src/main/java/software/amazon/awssdk/crt/CRT.java +++ b/src/main/java/software/amazon/awssdk/crt/CRT.java @@ -245,6 +245,10 @@ private static List runProcess(String[] cmdArray) throws IOException { return output; } + + /** + * Extract the CRT JNI library on current platform to a specific FIle. + */ public static void extractLibrary(File extractFile) { try { if (!extractFile.setExecutable(true, true)) { @@ -304,6 +308,9 @@ public static void extractLibrary(File extractFile) { } } + /** + * Extract the CRT JNI library on current platform to a specific path. + */ public static void extractLibrary(String path) { String libraryName = System.mapLibraryName(CRT_LIB_NAME); File extractFile = new File(path, libraryName); From 04fef59934f86ba74f61a6edbf0f533904aed8be Mon Sep 17 00:00:00 2001 From: Dengke Date: Tue, 27 Aug 2024 11:15:57 -0700 Subject: [PATCH 04/37] use the old version of graalvm SDK to support java 8 --- pom.xml | 6 ++++++ .../amazon/awssdk/crt/NativeFeature.java | 12 ++++++++++++ .../crt/aws-crt/native-image.properties | 1 + .../crt/aws-crt/resource-config.json | 16 ---------------- 4 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 src/main/java/software/amazon/awssdk/crt/NativeFeature.java create mode 100644 src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/native-image.properties delete mode 100644 src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/resource-config.json diff --git a/pom.xml b/pom.xml index d059d4486..f1cfd57ca 100644 --- a/pom.xml +++ b/pom.xml @@ -351,6 +351,12 @@ 1.4 test + + org.graalvm.sdk + graal-sdk + 21.3.11 + compile + diff --git a/src/main/java/software/amazon/awssdk/crt/NativeFeature.java b/src/main/java/software/amazon/awssdk/crt/NativeFeature.java new file mode 100644 index 000000000..69f85b03c --- /dev/null +++ b/src/main/java/software/amazon/awssdk/crt/NativeFeature.java @@ -0,0 +1,12 @@ +package software.amazon.awssdk.crt; + +import org.graalvm.nativeimage.hosted.Feature; + +public class NativeFeature implements Feature { + + @Override + public void afterImageWrite(AfterImageWriteAccess access) { + new CRT(); + CRT.extractLibrary(access.getImagePath().getParent().toString()); + } +} diff --git a/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/native-image.properties b/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/native-image.properties new file mode 100644 index 000000000..f2e085972 --- /dev/null +++ b/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/native-image.properties @@ -0,0 +1 @@ +Args=--enable-url-protocols=jar --features=software.amazon.awssdk.crt.NativeFeature diff --git a/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/resource-config.json b/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/resource-config.json deleted file mode 100644 index 7fefd172c..000000000 --- a/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/resource-config.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "resources": { - "includes": [ - { - "pattern": ".*libaws-crt-jni.dylib" - }, - { - "pattern": ".*libaws-crt-jni.so" - }, - { - "pattern": ".*aws-crt-jni.dll" - } - ] - }, - "bundles": [] -} \ No newline at end of file From e46c23089b3e497051622b630de4f5693f1c059e Mon Sep 17 00:00:00 2001 From: Dengke Date: Tue, 27 Aug 2024 15:18:50 -0700 Subject: [PATCH 05/37] provided as scope --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f1cfd57ca..c9f3fbe39 100644 --- a/pom.xml +++ b/pom.xml @@ -355,7 +355,7 @@ org.graalvm.sdk graal-sdk 21.3.11 - compile + provided From 653a9a2020ad84d88d0f085db84954db92b69f17 Mon Sep 17 00:00:00 2001 From: Dengke Date: Tue, 27 Aug 2024 15:21:02 -0700 Subject: [PATCH 06/37] optional? --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index c9f3fbe39..8b2eb6514 100644 --- a/pom.xml +++ b/pom.xml @@ -356,6 +356,7 @@ graal-sdk 21.3.11 provided + true From 2109a3d4690221bad421b7c1fe498afc1fc93ff4 Mon Sep 17 00:00:00 2001 From: Dengke Date: Tue, 27 Aug 2024 17:07:07 -0700 Subject: [PATCH 07/37] add dependency for gradle --- src/test/android/testapp/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/android/testapp/build.gradle b/src/test/android/testapp/build.gradle index e4ffc7d25..98d5a4adc 100644 --- a/src/test/android/testapp/build.gradle +++ b/src/test/android/testapp/build.gradle @@ -79,6 +79,7 @@ dependencies { implementation 'commons-cli:commons-cli:1.5.0' // For Elasticurl CommandLine related classes implementation 'com.sun.net.httpserver:http:20070405' // For CredentialProvidersTest HttpServer implementation 'junit:junit:4.13' + implementation 'org.graalvm.sdk:graal-sdk:21.3.11' androidTestImplementation "junit:junit:4.13" androidTestImplementation "androidx.test:core:1.2.0" From 97b2d0778e13c0a29bae19e3a27dfa2f99dfa7a9 Mon Sep 17 00:00:00 2001 From: Dengke Date: Wed, 28 Aug 2024 13:56:36 -0700 Subject: [PATCH 08/37] exclude the native feature from source --- android/crt/build.gradle | 1 + crt/aws-c-s3 | 2 +- src/test/android/testapp/build.gradle | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/crt/build.gradle b/android/crt/build.gradle index 2c2f4c46c..2c9432792 100644 --- a/android/crt/build.gradle +++ b/android/crt/build.gradle @@ -76,6 +76,7 @@ android { main { java.srcDir '../../src/main/java' java.srcDir 'src/main/java' + java.exclude '../../src/main/java/software/amazon/awssdk/crt/NativeFeature.java' } androidTest { setRoot '../../src/test' diff --git a/crt/aws-c-s3 b/crt/aws-c-s3 index 0ab4d58ef..a84dcdfd5 160000 --- a/crt/aws-c-s3 +++ b/crt/aws-c-s3 @@ -1 +1 @@ -Subproject commit 0ab4d58ef0bd97970d43828cb6b57a3de5747343 +Subproject commit a84dcdfd5c09863f1cfc4864a9fe5bca4049ca7c diff --git a/src/test/android/testapp/build.gradle b/src/test/android/testapp/build.gradle index 98d5a4adc..e4ffc7d25 100644 --- a/src/test/android/testapp/build.gradle +++ b/src/test/android/testapp/build.gradle @@ -79,7 +79,6 @@ dependencies { implementation 'commons-cli:commons-cli:1.5.0' // For Elasticurl CommandLine related classes implementation 'com.sun.net.httpserver:http:20070405' // For CredentialProvidersTest HttpServer implementation 'junit:junit:4.13' - implementation 'org.graalvm.sdk:graal-sdk:21.3.11' androidTestImplementation "junit:junit:4.13" androidTestImplementation "androidx.test:core:1.2.0" From e8e436375b141a285be586c15b2d26ee3585c7ba Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 30 Aug 2024 15:54:10 -0700 Subject: [PATCH 09/37] I cannot build it locally... --- android/crt/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/crt/build.gradle b/android/crt/build.gradle index 2c9432792..87a0a55c8 100644 --- a/android/crt/build.gradle +++ b/android/crt/build.gradle @@ -74,7 +74,7 @@ android { sourceSets { main { - java.srcDir '../../src/main/java' + // java.srcDir '../../src/main/java' java.srcDir 'src/main/java' java.exclude '../../src/main/java/software/amazon/awssdk/crt/NativeFeature.java' } From bae83a815ed88e0bc23de7f277c50f60bcb44e83 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 30 Aug 2024 15:56:48 -0700 Subject: [PATCH 10/37] chatgpt --- android/crt/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/crt/build.gradle b/android/crt/build.gradle index 87a0a55c8..df2e433ab 100644 --- a/android/crt/build.gradle +++ b/android/crt/build.gradle @@ -74,9 +74,9 @@ android { sourceSets { main { - // java.srcDir '../../src/main/java' + java.srcDir '../../src/main/java' java.srcDir 'src/main/java' - java.exclude '../../src/main/java/software/amazon/awssdk/crt/NativeFeature.java' + java.exclude '**/NativeFeature.java' } androidTest { setRoot '../../src/test' From 63ff90a01481db0ea9c81e256407f1c347027466 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 30 Aug 2024 16:23:22 -0700 Subject: [PATCH 11/37] submodule --- crt/aws-c-compression | 2 +- crt/s2n | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crt/aws-c-compression b/crt/aws-c-compression index f36d01672..ea1d421a4 160000 --- a/crt/aws-c-compression +++ b/crt/aws-c-compression @@ -1 +1 @@ -Subproject commit f36d01672d61e49d96a777870d456f66fa391cd4 +Subproject commit ea1d421a421ad83a540309a94c38d50b6a5d836b diff --git a/crt/s2n b/crt/s2n index 87f4a0585..79c0f1b43 160000 --- a/crt/s2n +++ b/crt/s2n @@ -1 +1 @@ -Subproject commit 87f4a0585dc3056433f193b9305f587cff239be3 +Subproject commit 79c0f1b434742d9f1152c48d3781433649f6f8fe From cc6a94401197f746291e512c3bdcb1daef138b8b Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 30 Aug 2024 16:23:51 -0700 Subject: [PATCH 12/37] submodule --- crt/aws-c-compression | 2 +- crt/aws-c-s3 | 2 +- crt/s2n | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crt/aws-c-compression b/crt/aws-c-compression index ea1d421a4..f36d01672 160000 --- a/crt/aws-c-compression +++ b/crt/aws-c-compression @@ -1 +1 @@ -Subproject commit ea1d421a421ad83a540309a94c38d50b6a5d836b +Subproject commit f36d01672d61e49d96a777870d456f66fa391cd4 diff --git a/crt/aws-c-s3 b/crt/aws-c-s3 index a84dcdfd5..0ab4d58ef 160000 --- a/crt/aws-c-s3 +++ b/crt/aws-c-s3 @@ -1 +1 @@ -Subproject commit a84dcdfd5c09863f1cfc4864a9fe5bca4049ca7c +Subproject commit 0ab4d58ef0bd97970d43828cb6b57a3de5747343 diff --git a/crt/s2n b/crt/s2n index 79c0f1b43..87f4a0585 160000 --- a/crt/s2n +++ b/crt/s2n @@ -1 +1 @@ -Subproject commit 79c0f1b434742d9f1152c48d3781433649f6f8fe +Subproject commit 87f4a0585dc3056433f193b9305f587cff239be3 From d059836e977f559a2fa4232bea8f608613d7a8a2 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 30 Aug 2024 16:33:04 -0700 Subject: [PATCH 13/37] move it to internal --- javadoc.options | 1 + .../amazon/awssdk/crt/NativeFeature.java | 12 ---------- .../awssdk/crt/internal/NativeFeature.java | 22 +++++++++++++++++++ .../crt/aws-crt/native-image.properties | 2 +- 4 files changed, 24 insertions(+), 13 deletions(-) delete mode 100644 src/main/java/software/amazon/awssdk/crt/NativeFeature.java create mode 100644 src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java diff --git a/javadoc.options b/javadoc.options index 5c60f19ec..a91eed219 100644 --- a/javadoc.options +++ b/javadoc.options @@ -7,6 +7,7 @@ -sourcepath src/main/java -notimestamp -subpackages software.amazon.awssdk.crt +-exclude src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java -quiet -Xdoclint:all -Xwerror diff --git a/src/main/java/software/amazon/awssdk/crt/NativeFeature.java b/src/main/java/software/amazon/awssdk/crt/NativeFeature.java deleted file mode 100644 index 69f85b03c..000000000 --- a/src/main/java/software/amazon/awssdk/crt/NativeFeature.java +++ /dev/null @@ -1,12 +0,0 @@ -package software.amazon.awssdk.crt; - -import org.graalvm.nativeimage.hosted.Feature; - -public class NativeFeature implements Feature { - - @Override - public void afterImageWrite(AfterImageWriteAccess access) { - new CRT(); - CRT.extractLibrary(access.getImagePath().getParent().toString()); - } -} diff --git a/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java b/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java new file mode 100644 index 000000000..d1b7d3a28 --- /dev/null +++ b/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java @@ -0,0 +1,22 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ +package software.amazon.awssdk.crt.internal; + +import org.graalvm.nativeimage.hosted.Feature; + +import software.amazon.awssdk.crt.CRT; + +/** + * Implementation of GraalVM feature to extract the share lib to the image path. + * Internal API, not for external usage. + */ +public class NativeFeature implements Feature { + + @Override + public void afterImageWrite(AfterImageWriteAccess access) { + new CRT(); + CRT.extractLibrary(access.getImagePath().getParent().toString()); + } +} diff --git a/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/native-image.properties b/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/native-image.properties index f2e085972..6c493230b 100644 --- a/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/native-image.properties +++ b/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/native-image.properties @@ -1 +1 @@ -Args=--enable-url-protocols=jar --features=software.amazon.awssdk.crt.NativeFeature +Args=--enable-url-protocols=jar --features=software.amazon.awssdk.crt.internal.NativeFeature From 4106dfa35645281ca1cf3f987845ea9421405da1 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 30 Aug 2024 16:43:39 -0700 Subject: [PATCH 14/37] what about this? --- javadoc.options | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javadoc.options b/javadoc.options index a91eed219..5107b049b 100644 --- a/javadoc.options +++ b/javadoc.options @@ -7,7 +7,7 @@ -sourcepath src/main/java -notimestamp -subpackages software.amazon.awssdk.crt --exclude src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java +-exclude **/NativeFeature.java -quiet -Xdoclint:all -Xwerror From 4fd604f0195b8ba5b2cdaa4cd58ec684689ba0c2 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Wed, 4 Sep 2024 00:13:17 +0000 Subject: [PATCH 15/37] let it compile --- .github/workflows/ci.yml | 11 +++++++++-- .github/workflows/docs.yml | 7 ++++++- javadoc.options | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e1f26932..5ae207831 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -192,7 +192,7 @@ jobs: python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" python builder.pyz build -p ${{ env.PACKAGE_NAME }} downstream - macos: + macos: runs-on: macos-14 #latest steps: - name: Checkout Sources @@ -204,7 +204,7 @@ jobs: python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')" chmod a+x builder ./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream - python3 codebuild/macos_compatibility_check.py + python3 codebuild/macos_compatibility_check.py macos-x64: runs-on: macos-14-large #latest @@ -279,6 +279,13 @@ jobs: - uses: actions/checkout@v3 with: submodules: true + + - name: Setup GraalVM + uses: graalvm/setup-graalvm@v1 + with: + java-version: 17 + distribution: 'graalvm' + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Check docs run: | ./make-docs.sh diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 232062481..b73537c5b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,7 +17,12 @@ jobs: uses: actions/checkout@v3 with: submodules: true - + - name: Setup GraalVM + uses: graalvm/setup-graalvm@v1 + with: + java-version: 17 + distribution: 'graalvm' + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Update docs branch run: | ./make-docs.sh diff --git a/javadoc.options b/javadoc.options index 5107b049b..e2aef0c3b 100644 --- a/javadoc.options +++ b/javadoc.options @@ -7,7 +7,7 @@ -sourcepath src/main/java -notimestamp -subpackages software.amazon.awssdk.crt --exclude **/NativeFeature.java +-exclude software.amazon.awssdk.crt.internal -quiet -Xdoclint:all -Xwerror From 86303b55e5e02c63de7b9bb23e8bcc47c2f3e74f Mon Sep 17 00:00:00 2001 From: Dengke Date: Wed, 4 Sep 2024 10:09:39 -0700 Subject: [PATCH 16/37] ignore those warnings? --- javadoc.options | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javadoc.options b/javadoc.options index e2aef0c3b..b25e2c5e9 100644 --- a/javadoc.options +++ b/javadoc.options @@ -9,5 +9,5 @@ -subpackages software.amazon.awssdk.crt -exclude software.amazon.awssdk.crt.internal -quiet --Xdoclint:all +-Xdoclint:all,-missing -Xwerror From 8d85cbaf756a1fd72187ffc227f45c89ebcdc128 Mon Sep 17 00:00:00 2001 From: Dengke Date: Wed, 4 Sep 2024 10:31:39 -0700 Subject: [PATCH 17/37] Move the API to internal --- .../java/software/amazon/awssdk/crt/CRT.java | 84 +--------------- .../awssdk/crt/internal/ExtractLib.java | 95 +++++++++++++++++++ .../awssdk/crt/internal/NativeFeature.java | 2 +- 3 files changed, 98 insertions(+), 83 deletions(-) create mode 100644 src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java diff --git a/src/main/java/software/amazon/awssdk/crt/CRT.java b/src/main/java/software/amazon/awssdk/crt/CRT.java index c15344a2e..3515f2f0e 100644 --- a/src/main/java/software/amazon/awssdk/crt/CRT.java +++ b/src/main/java/software/amazon/awssdk/crt/CRT.java @@ -4,16 +4,15 @@ */ package software.amazon.awssdk.crt; +import software.amazon.awssdk.crt.internal.ExtractLib; import software.amazon.awssdk.crt.io.ClientBootstrap; import software.amazon.awssdk.crt.io.EventLoopGroup; import software.amazon.awssdk.crt.io.HostResolver; import java.io.BufferedReader; import java.io.File; -import java.io.FileOutputStream; import java.io.FilenameFilter; import java.io.IOException; -import java.io.InputStream; import java.io.InputStreamReader; import java.lang.reflect.InvocationTargetException; import java.util.*; @@ -245,85 +244,6 @@ private static List runProcess(String[] cmdArray) throws IOException { return output; } - - /** - * Extract the CRT JNI library on current platform to a specific FIle. - */ - public static void extractLibrary(File extractFile) { - try { - if (!extractFile.setExecutable(true, true)) { - throw new CrtRuntimeException("Unable to make shared library executable by owner only"); - } - if (!extractFile.setWritable(true, true)) { - throw new CrtRuntimeException("Unable to make shared library writeable by owner only"); - } - if (!extractFile.setReadable(true, true)) { - throw new CrtRuntimeException("Unable to make shared library readable by owner only"); - } - String libraryName = System.mapLibraryName(CRT_LIB_NAME); - String os = getOSIdentifier(); - // open a stream to read the shared lib contents from this JAR - String libResourcePath = "/" + os + "/" + getArchIdentifier() + "/" + getCRuntime(os) + "/" + libraryName; - // Check whether there is a platform specific resource path to use - CrtPlatform platform = getPlatformImpl(); - if (platform != null){ - String platformLibResourcePath = platform.getResourcePath(getCRuntime(os), libraryName); - if (platformLibResourcePath != null){ - libResourcePath = platformLibResourcePath; - } - } - try (InputStream in = CRT.class.getResourceAsStream(libResourcePath)) { - if (in == null) { - throw new IOException("Unable to open library in jar for AWS CRT: " + libResourcePath); - } - - // Copy from jar stream to temp file - try (FileOutputStream out = new FileOutputStream(extractFile)) { - int read; - byte [] bytes = new byte[1024]; - while ((read = in.read(bytes)) != -1){ - out.write(bytes, 0, read); - } - } - } - if (!extractFile.setWritable(false)) { - throw new CrtRuntimeException("Unable to make shared library read-only"); - } - } catch (CrtRuntimeException crtex) { - System.err.println("Unable to initialize AWS CRT: " + crtex); - crtex.printStackTrace(); - throw crtex; - } catch (UnknownPlatformException upe) { - System.err.println("Unable to determine platform for AWS CRT: " + upe); - upe.printStackTrace(); - CrtRuntimeException rex = new CrtRuntimeException("Unable to determine platform for AWS CRT"); - rex.initCause(upe); - throw rex; - } catch (Exception ex) { - System.err.println("Unable to unpack AWS CRT lib: " + ex); - ex.printStackTrace(); - CrtRuntimeException rex = new CrtRuntimeException("Unable to unpack AWS CRT library"); - rex.initCause(ex); - throw rex; - } - } - - /** - * Extract the CRT JNI library on current platform to a specific path. - */ - public static void extractLibrary(String path) { - String libraryName = System.mapLibraryName(CRT_LIB_NAME); - File extractFile = new File(path, libraryName); - try { - extractFile.createNewFile(); - } catch (Exception ex) { - CrtRuntimeException rex = new CrtRuntimeException("Unable to create file on path:" + extractFile.getAbsolutePath()); - rex.initCause(ex); - throw rex; - } - extractLibrary(extractFile); - } - private static void extractAndLoadLibrary(String path) { // Check java.io.tmpdir String tmpdirPath; @@ -380,7 +300,7 @@ private static void extractAndLoadLibrary(String path) { if (os.equals("windows")) { tryDeleteOldLibrariesFromTempDir(tmpdirFile, tempSharedLibPrefix, libraryName); } - extractLibrary(tempSharedLib); + ExtractLib.extractLibrary(tempSharedLib); // load the shared lib from the temp path System.load(tempSharedLib.getAbsolutePath()); diff --git a/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java b/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java new file mode 100644 index 000000000..dd31dafd4 --- /dev/null +++ b/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java @@ -0,0 +1,95 @@ +package software.amazon.awssdk.crt.internal; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; + +import software.amazon.awssdk.crt.CRT; +import software.amazon.awssdk.crt.CRT.UnknownPlatformException; +import software.amazon.awssdk.crt.CrtPlatform; +import software.amazon.awssdk.crt.CrtRuntimeException; + +/** + * Helper to extract JNI shared lib from Jar. + * Internal API, not for external usage. + */ +public class ExtractLib { + private static final String CRT_LIB_NAME = "aws-crt-jni"; + + public static void extractLibrary(File extractFile) { + + try { + if (!extractFile.setExecutable(true, true)) { + throw new CrtRuntimeException("Unable to make shared library executable by owner only"); + } + if (!extractFile.setWritable(true, true)) { + throw new CrtRuntimeException("Unable to make shared library writeable by owner only"); + } + if (!extractFile.setReadable(true, true)) { + throw new CrtRuntimeException("Unable to make shared library readable by owner only"); + } + String libraryName = System.mapLibraryName(CRT_LIB_NAME); + String os = CRT.getOSIdentifier(); + // open a stream to read the shared lib contents from this JAR + String libResourcePath = "/" + os + "/" + CRT.getArchIdentifier() + "/" + CRT.getCRuntime(os) + "/" + libraryName; + // Check whether there is a platform specific resource path to use + CrtPlatform platform = CRT.getPlatformImpl(); + if (platform != null){ + String platformLibResourcePath = platform.getResourcePath(CRT.getCRuntime(os), libraryName); + if (platformLibResourcePath != null){ + libResourcePath = platformLibResourcePath; + } + } + try (InputStream in = CRT.class.getResourceAsStream(libResourcePath)) { + if (in == null) { + throw new IOException("Unable to open library in jar for AWS CRT: " + libResourcePath); + } + + // Copy from jar stream to temp file + try (FileOutputStream out = new FileOutputStream(extractFile)) { + int read; + byte [] bytes = new byte[1024]; + while ((read = in.read(bytes)) != -1){ + out.write(bytes, 0, read); + } + } + } + if (!extractFile.setWritable(false)) { + throw new CrtRuntimeException("Unable to make shared library read-only"); + } + } catch (CrtRuntimeException crtex) { + System.err.println("Unable to initialize AWS CRT: " + crtex); + crtex.printStackTrace(); + throw crtex; + } catch (UnknownPlatformException upe) { + System.err.println("Unable to determine platform for AWS CRT: " + upe); + upe.printStackTrace(); + CrtRuntimeException rex = new CrtRuntimeException("Unable to determine platform for AWS CRT"); + rex.initCause(upe); + throw rex; + } catch (Exception ex) { + System.err.println("Unable to unpack AWS CRT lib: " + ex); + ex.printStackTrace(); + CrtRuntimeException rex = new CrtRuntimeException("Unable to unpack AWS CRT library"); + rex.initCause(ex); + throw rex; + } + } + + /** + * Extract the CRT JNI library on current platform to a specific path. + */ + public static void extractLibrary(String path) { + String libraryName = System.mapLibraryName(CRT_LIB_NAME); + File extractFile = new File(path, libraryName); + try { + extractFile.createNewFile(); + } catch (Exception ex) { + CrtRuntimeException rex = new CrtRuntimeException("Unable to create file on path:" + extractFile.getAbsolutePath()); + rex.initCause(ex); + throw rex; + } + extractLibrary(extractFile); + } +} diff --git a/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java b/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java index d1b7d3a28..9a968d820 100644 --- a/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java +++ b/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java @@ -17,6 +17,6 @@ public class NativeFeature implements Feature { @Override public void afterImageWrite(AfterImageWriteAccess access) { new CRT(); - CRT.extractLibrary(access.getImagePath().getParent().toString()); + ExtractLib.extractLibrary(access.getImagePath().getParent().toString()); } } From 296a6497e7b8b82e3e9614413097a9b256125492 Mon Sep 17 00:00:00 2001 From: Dengke Date: Wed, 4 Sep 2024 15:36:52 -0700 Subject: [PATCH 18/37] Use maven to build Java doc --- .github/workflows/ci.yml | 7 ------- .github/workflows/docs.yml | 6 ------ javadoc.options | 1 - make-docs.sh | 6 +++--- pom.xml | 7 ++++++- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ae207831..68fec865c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -279,13 +279,6 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - - - name: Setup GraalVM - uses: graalvm/setup-graalvm@v1 - with: - java-version: 17 - distribution: 'graalvm' - github-token: ${{ secrets.GITHUB_TOKEN }} - name: Check docs run: | ./make-docs.sh diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index b73537c5b..4c5dd6380 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,12 +17,6 @@ jobs: uses: actions/checkout@v3 with: submodules: true - - name: Setup GraalVM - uses: graalvm/setup-graalvm@v1 - with: - java-version: 17 - distribution: 'graalvm' - github-token: ${{ secrets.GITHUB_TOKEN }} - name: Update docs branch run: | ./make-docs.sh diff --git a/javadoc.options b/javadoc.options index b25e2c5e9..0b31d4871 100644 --- a/javadoc.options +++ b/javadoc.options @@ -6,7 +6,6 @@ -bottom 'Copyright © Amazon.com, Inc. or its affiliates. All Rights Reserved.' -sourcepath src/main/java -notimestamp --subpackages software.amazon.awssdk.crt -exclude software.amazon.awssdk.crt.internal -quiet -Xdoclint:all,-missing diff --git a/make-docs.sh b/make-docs.sh index 721dc12e6..58f3b3f06 100755 --- a/make-docs.sh +++ b/make-docs.sh @@ -2,12 +2,12 @@ set -e -pushd $(dirname $0) > /dev/null +pushd $(dirname $0) >/dev/null # clean rm -rf docs/ # build -javadoc @javadoc.options +mvn clean javadoc:javadoc -Prelease -popd > /dev/null +popd >/dev/null diff --git a/pom.xml b/pom.xml index 8b2eb6514..f5fd58719 100644 --- a/pom.xml +++ b/pom.xml @@ -292,7 +292,12 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9.1 + 3.4.0 + + + @${project.basedir}/javadoc.options + + attach-javadocs From 8fce325a9fdbc6bf1c18fe0b627110eec1d413cc Mon Sep 17 00:00:00 2001 From: Dengke Date: Wed, 4 Sep 2024 16:52:24 -0700 Subject: [PATCH 19/37] maven config the output path --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index f5fd58719..0a2e20966 100644 --- a/pom.xml +++ b/pom.xml @@ -294,6 +294,7 @@ maven-javadoc-plugin 3.4.0 + ${project.basedir}/docs @${project.basedir}/javadoc.options From b8bb695c0e91a146856a53cfab2f68a89deb6aa4 Mon Sep 17 00:00:00 2001 From: Dengke Date: Wed, 4 Sep 2024 16:53:21 -0700 Subject: [PATCH 20/37] don't ignore any warnings now --- javadoc.options | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javadoc.options b/javadoc.options index 0b31d4871..ebd80f027 100644 --- a/javadoc.options +++ b/javadoc.options @@ -8,5 +8,5 @@ -notimestamp -exclude software.amazon.awssdk.crt.internal -quiet --Xdoclint:all,-missing +-Xdoclint:all -Xwerror From db4e92da0ce9c245808e60728a6749dc69d8c02c Mon Sep 17 00:00:00 2001 From: Dengke Date: Wed, 4 Sep 2024 16:58:04 -0700 Subject: [PATCH 21/37] :) you complaining about the thing you are not generating. --- .../software/amazon/awssdk/crt/internal/ExtractLib.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java b/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java index dd31dafd4..358cc95c3 100644 --- a/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java +++ b/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java @@ -17,6 +17,11 @@ public class ExtractLib { private static final String CRT_LIB_NAME = "aws-crt-jni"; + + /** + * Extract the CRT JNI library on current platform to a specific File + * @param extractFile the File extracting to + */ public static void extractLibrary(File extractFile) { try { @@ -79,6 +84,7 @@ public static void extractLibrary(File extractFile) { /** * Extract the CRT JNI library on current platform to a specific path. + * @param path the path extracting to */ public static void extractLibrary(String path) { String libraryName = System.mapLibraryName(CRT_LIB_NAME); From 4c2a9790a0c57e458aae9037c71ef9840a955bc9 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 6 Sep 2024 09:55:45 -0700 Subject: [PATCH 22/37] trivial --- pom.xml | 2 +- .../java/software/amazon/awssdk/crt/internal/ExtractLib.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0a2e20966..5805e88fd 100644 --- a/pom.xml +++ b/pom.xml @@ -360,7 +360,7 @@ org.graalvm.sdk graal-sdk - 21.3.11 + 21.3.11 provided true diff --git a/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java b/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java index 358cc95c3..479bdd7b8 100644 --- a/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java +++ b/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java @@ -1,3 +1,7 @@ +/** + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0. + */ package software.amazon.awssdk.crt.internal; import java.io.File; From a7ac437fab03eba54d29628f0dffb0aafb5ce573 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 6 Sep 2024 10:08:14 -0700 Subject: [PATCH 23/37] format --- .../amazon/awssdk/crt/internal/ExtractLib.java | 17 ++++++++++------- .../awssdk/crt/internal/NativeFeature.java | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java b/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java index 479bdd7b8..eca313f8d 100644 --- a/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java +++ b/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java @@ -21,9 +21,9 @@ public class ExtractLib { private static final String CRT_LIB_NAME = "aws-crt-jni"; - /** * Extract the CRT JNI library on current platform to a specific File + * * @param extractFile the File extracting to */ public static void extractLibrary(File extractFile) { @@ -41,12 +41,13 @@ public static void extractLibrary(File extractFile) { String libraryName = System.mapLibraryName(CRT_LIB_NAME); String os = CRT.getOSIdentifier(); // open a stream to read the shared lib contents from this JAR - String libResourcePath = "/" + os + "/" + CRT.getArchIdentifier() + "/" + CRT.getCRuntime(os) + "/" + libraryName; + String libResourcePath = "/" + os + "/" + CRT.getArchIdentifier() + "/" + CRT.getCRuntime(os) + "/" + + libraryName; // Check whether there is a platform specific resource path to use CrtPlatform platform = CRT.getPlatformImpl(); - if (platform != null){ + if (platform != null) { String platformLibResourcePath = platform.getResourcePath(CRT.getCRuntime(os), libraryName); - if (platformLibResourcePath != null){ + if (platformLibResourcePath != null) { libResourcePath = platformLibResourcePath; } } @@ -58,8 +59,8 @@ public static void extractLibrary(File extractFile) { // Copy from jar stream to temp file try (FileOutputStream out = new FileOutputStream(extractFile)) { int read; - byte [] bytes = new byte[1024]; - while ((read = in.read(bytes)) != -1){ + byte[] bytes = new byte[1024]; + while ((read = in.read(bytes)) != -1) { out.write(bytes, 0, read); } } @@ -88,6 +89,7 @@ public static void extractLibrary(File extractFile) { /** * Extract the CRT JNI library on current platform to a specific path. + * * @param path the path extracting to */ public static void extractLibrary(String path) { @@ -96,7 +98,8 @@ public static void extractLibrary(String path) { try { extractFile.createNewFile(); } catch (Exception ex) { - CrtRuntimeException rex = new CrtRuntimeException("Unable to create file on path:" + extractFile.getAbsolutePath()); + CrtRuntimeException rex = new CrtRuntimeException( + "Unable to create file on path:" + extractFile.getAbsolutePath()); rex.initCause(ex); throw rex; } diff --git a/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java b/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java index 9a968d820..6b3d5f537 100644 --- a/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java +++ b/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java @@ -16,7 +16,7 @@ public class NativeFeature implements Feature { @Override public void afterImageWrite(AfterImageWriteAccess access) { - new CRT(); - ExtractLib.extractLibrary(access.getImagePath().getParent().toString()); + new CRT(); + ExtractLib.extractLibrary(access.getImagePath().getParent().toString()); } } From 0e4c0974fb758fb3e96f86374eb9eca9e3415574 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 6 Sep 2024 10:12:29 -0700 Subject: [PATCH 24/37] more trivial --- src/main/java/software/amazon/awssdk/crt/CRT.java | 2 +- .../java/software/amazon/awssdk/crt/internal/ExtractLib.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/software/amazon/awssdk/crt/CRT.java b/src/main/java/software/amazon/awssdk/crt/CRT.java index 3515f2f0e..679734e5f 100644 --- a/src/main/java/software/amazon/awssdk/crt/CRT.java +++ b/src/main/java/software/amazon/awssdk/crt/CRT.java @@ -28,7 +28,7 @@ public final class CRT { private static final String CRT_ARCH_OVERRIDE_SYSTEM_PROPERTY = "aws.crt.arch"; private static final String CRT_ARCH_OVERRIDE_ENVIRONMENT_VARIABLE = "AWS_CRT_ARCH"; - private static final String CRT_LIB_NAME = "aws-crt-jni"; + public static final String CRT_LIB_NAME = "aws-crt-jni"; public static final int AWS_CRT_SUCCESS = 0; private static final CrtPlatform s_platform; diff --git a/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java b/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java index eca313f8d..69b623211 100644 --- a/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java +++ b/src/main/java/software/amazon/awssdk/crt/internal/ExtractLib.java @@ -19,7 +19,6 @@ * Internal API, not for external usage. */ public class ExtractLib { - private static final String CRT_LIB_NAME = "aws-crt-jni"; /** * Extract the CRT JNI library on current platform to a specific File @@ -38,7 +37,7 @@ public static void extractLibrary(File extractFile) { if (!extractFile.setReadable(true, true)) { throw new CrtRuntimeException("Unable to make shared library readable by owner only"); } - String libraryName = System.mapLibraryName(CRT_LIB_NAME); + String libraryName = System.mapLibraryName(CRT.CRT_LIB_NAME); String os = CRT.getOSIdentifier(); // open a stream to read the shared lib contents from this JAR String libResourcePath = "/" + os + "/" + CRT.getArchIdentifier() + "/" + CRT.getCRuntime(os) + "/" @@ -93,7 +92,7 @@ public static void extractLibrary(File extractFile) { * @param path the path extracting to */ public static void extractLibrary(String path) { - String libraryName = System.mapLibraryName(CRT_LIB_NAME); + String libraryName = System.mapLibraryName(CRT.CRT_LIB_NAME); File extractFile = new File(path, libraryName); try { extractFile.createNewFile(); From b86e67beb438858b798d7eb5dd24b76aecb5fea9 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 6 Sep 2024 13:24:39 -0700 Subject: [PATCH 25/37] add graalvm to the class name as native is nto very clear in our code base --- android/crt/build.gradle | 2 +- .../internal/{NativeFeature.java => GraalVMNativeFeature.java} | 2 +- .../software.amazon.awssdk/crt/aws-crt/native-image.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename src/main/java/software/amazon/awssdk/crt/internal/{NativeFeature.java => GraalVMNativeFeature.java} (91%) diff --git a/android/crt/build.gradle b/android/crt/build.gradle index df2e433ab..837c93082 100644 --- a/android/crt/build.gradle +++ b/android/crt/build.gradle @@ -76,7 +76,7 @@ android { main { java.srcDir '../../src/main/java' java.srcDir 'src/main/java' - java.exclude '**/NativeFeature.java' + java.exclude '**/GraalVMNativeFeature.java' } androidTest { setRoot '../../src/test' diff --git a/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java b/src/main/java/software/amazon/awssdk/crt/internal/GraalVMNativeFeature.java similarity index 91% rename from src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java rename to src/main/java/software/amazon/awssdk/crt/internal/GraalVMNativeFeature.java index 6b3d5f537..f032c1aec 100644 --- a/src/main/java/software/amazon/awssdk/crt/internal/NativeFeature.java +++ b/src/main/java/software/amazon/awssdk/crt/internal/GraalVMNativeFeature.java @@ -12,7 +12,7 @@ * Implementation of GraalVM feature to extract the share lib to the image path. * Internal API, not for external usage. */ -public class NativeFeature implements Feature { +public class GraalVMNativeFeature implements Feature { @Override public void afterImageWrite(AfterImageWriteAccess access) { diff --git a/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/native-image.properties b/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/native-image.properties index 6c493230b..19e1a2989 100644 --- a/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/native-image.properties +++ b/src/main/resources/META-INF/native-image/software.amazon.awssdk/crt/aws-crt/native-image.properties @@ -1 +1 @@ -Args=--enable-url-protocols=jar --features=software.amazon.awssdk.crt.internal.NativeFeature +Args=--enable-url-protocols=jar --features=software.amazon.awssdk.crt.internal.GraalVMNativeFeature From 2a5dc32ed1d0873ec8c0eb23dc890908b4568f24 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 6 Sep 2024 17:03:15 -0700 Subject: [PATCH 26/37] address comments --- README.md | 7 +++++++ javadoc.options | 7 +------ pom.xml | 8 +++++++- src/main/java/software/amazon/awssdk/crt/CRT.java | 2 +- .../amazon/awssdk/crt/internal/GraalVMNativeFeature.java | 4 ++++ 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8394455a0..28e9ccafe 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,13 @@ Platforms without FIPS compliance are also included in this jar, for compatibili > [!WARNING] > The classifier, and platforms with FIPS compliance are subject to change in the future. +## GraalVM support + +Since version v0.29.20, GraalVM native image was supported. You can compile your application with AWS CRT in a GraalVM native image project without any additional configuration. + +Since version v0.30.12, GraalVM support was updated. Instead of packaging the JNI shared lib with native image as resource, the corresponding shared lib will be written to the same directory as the native image. +In this way, it reduces the native image size around 30%, and avoids the extra loading time needed for extracting the JNI lib to the temporary path for load. No additional configuration needed. +**Note**: the extracted JNI lib, `libaws-crt-jni.*` , will need to be exist in the directory containing the native image, if you move the native image to different directory. ## System Properties diff --git a/javadoc.options b/javadoc.options index ebd80f027..4ae135b6b 100644 --- a/javadoc.options +++ b/javadoc.options @@ -1,12 +1,7 @@ -d docs -public --windowtitle 'AWS Common Runtime for Java/JVM' --doctitle 'AWS Common Runtime for Java/JVM' --header 'AWS Common Runtime for Java/JVM' --bottom 'Copyright © Amazon.com, Inc. or its affiliates. All Rights Reserved.' -sourcepath src/main/java -notimestamp --exclude software.amazon.awssdk.crt.internal -quiet --Xdoclint:all +-Xdoclint:all,-missing -Xwerror diff --git a/pom.xml b/pom.xml index 5805e88fd..b529e81d1 100644 --- a/pom.xml +++ b/pom.xml @@ -294,7 +294,13 @@ maven-javadoc-plugin 3.4.0 + + AWS Common Runtime for Java/JVM + AWS Common Runtime for Java/JVM +
AWS Common Runtime for Java/JVM
+ Copyright © Amazon.com, Inc. or its affiliates. All Rights Reserved. ${project.basedir}/docs + software.amazon.awssdk.crt.internal @${project.basedir}/javadoc.options @@ -360,7 +366,7 @@ org.graalvm.sdk graal-sdk - 21.3.11 + 21.3.11 provided true diff --git a/src/main/java/software/amazon/awssdk/crt/CRT.java b/src/main/java/software/amazon/awssdk/crt/CRT.java index 679734e5f..490005a6d 100644 --- a/src/main/java/software/amazon/awssdk/crt/CRT.java +++ b/src/main/java/software/amazon/awssdk/crt/CRT.java @@ -277,7 +277,7 @@ private static void extractAndLoadLibrary(String path) { tempSharedLib = File.createTempFile(tempSharedLibPrefix, libraryName, tmpdirFile); } catch (IOException ex){ - System.err.println("Unable to create temp file to extract AWS CRT library" + ex); + System.err.println("Unable to create temp file to extract AWS CRT library: " + ex); ex.printStackTrace(); CrtRuntimeException rex = new CrtRuntimeException("Unable to create temp file to extract AWS CRT library"); rex.initCause(ex); diff --git a/src/main/java/software/amazon/awssdk/crt/internal/GraalVMNativeFeature.java b/src/main/java/software/amazon/awssdk/crt/internal/GraalVMNativeFeature.java index f032c1aec..b1e5c3b28 100644 --- a/src/main/java/software/amazon/awssdk/crt/internal/GraalVMNativeFeature.java +++ b/src/main/java/software/amazon/awssdk/crt/internal/GraalVMNativeFeature.java @@ -10,6 +10,10 @@ /** * Implementation of GraalVM feature to extract the share lib to the image path. + * From GraalVM docs: + * > When loading native libraries using System.loadLibrary() (and related APIs), + * > the native image will search the directory containing the native image before searching the Java library path + * https://www.graalvm.org/latest/reference-manual/native-image/dynamic-features/JNI/#loading-native-libraries * Internal API, not for external usage. */ public class GraalVMNativeFeature implements Feature { From e444bfc444d1de05528a19770138e16b42c71c74 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 6 Sep 2024 18:44:14 -0700 Subject: [PATCH 27/37] maybe --- src/main/java/software/amazon/awssdk/crt/CRT.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/software/amazon/awssdk/crt/CRT.java b/src/main/java/software/amazon/awssdk/crt/CRT.java index 490005a6d..c3654e67e 100644 --- a/src/main/java/software/amazon/awssdk/crt/CRT.java +++ b/src/main/java/software/amazon/awssdk/crt/CRT.java @@ -36,12 +36,18 @@ public final class CRT { // Scan for and invoke any platform specific initialization s_platform = findPlatformImpl(); jvmInit(); + String graalVMImageCode = System.getProperty("org.graalvm.nativeimage.imagecode"); try { // If the lib is already present/loaded or is in java.library.path, just use it System.loadLibrary(CRT_LIB_NAME); } catch (UnsatisfiedLinkError e) { // otherwise, load from the jar this class is in - loadLibraryFromJar(); + if (graalVMImageCode != null && graalVMImageCode == "runtime") { + throw new CrtRuntimeException( + "Unable to load AWS CRT lib for GraalVM runtime: Make sure the libaws-crt-jni exists in the the directory containing the native image"); + } else { + loadLibraryFromJar(); + } } // Initialize the CRT From 79ac10e017ca819aa6484ebb6ab3fd3f7661aaea Mon Sep 17 00:00:00 2001 From: Dengke Date: Mon, 9 Sep 2024 08:46:48 -0700 Subject: [PATCH 28/37] trivial --- src/main/java/software/amazon/awssdk/crt/CRT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/software/amazon/awssdk/crt/CRT.java b/src/main/java/software/amazon/awssdk/crt/CRT.java index c3654e67e..62d8e3992 100644 --- a/src/main/java/software/amazon/awssdk/crt/CRT.java +++ b/src/main/java/software/amazon/awssdk/crt/CRT.java @@ -36,11 +36,11 @@ public final class CRT { // Scan for and invoke any platform specific initialization s_platform = findPlatformImpl(); jvmInit(); - String graalVMImageCode = System.getProperty("org.graalvm.nativeimage.imagecode"); try { // If the lib is already present/loaded or is in java.library.path, just use it System.loadLibrary(CRT_LIB_NAME); } catch (UnsatisfiedLinkError e) { + String graalVMImageCode = System.getProperty("org.graalvm.nativeimage.imagecode"); // otherwise, load from the jar this class is in if (graalVMImageCode != null && graalVMImageCode == "runtime") { throw new CrtRuntimeException( From 5854997cca6a329e81efa4436da59398ea9efddc Mon Sep 17 00:00:00 2001 From: Dengke Date: Mon, 9 Sep 2024 13:14:42 -0700 Subject: [PATCH 29/37] keep the options at one place --- .github/workflows/ci.yml | 2 +- .github/workflows/docs.yml | 2 +- javadoc.options | 7 ------- make-docs.sh | 2 ++ pom.xml | 12 +++++++----- 5 files changed, 11 insertions(+), 14 deletions(-) delete mode 100644 javadoc.options diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68fec865c..d296f22a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -274,7 +274,7 @@ jobs: # check that docs can still build check-docs: - runs-on: ubuntu-22.04 # latest + runs-on: ubuntu-22.04 # use same version as docs.yml steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4c5dd6380..fc99ab2c7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -9,7 +9,7 @@ on: jobs: update-docs-branch: - runs-on: ubuntu-20.04 # latest + runs-on: ubuntu-22.04 # use same version as ci.yml's check-docs permissions: contents: write # allow push steps: diff --git a/javadoc.options b/javadoc.options deleted file mode 100644 index 4ae135b6b..000000000 --- a/javadoc.options +++ /dev/null @@ -1,7 +0,0 @@ --d docs --public --sourcepath src/main/java --notimestamp --quiet --Xdoclint:all,-missing --Xwerror diff --git a/make-docs.sh b/make-docs.sh index 58f3b3f06..f16043302 100755 --- a/make-docs.sh +++ b/make-docs.sh @@ -9,5 +9,7 @@ rm -rf docs/ # build mvn clean javadoc:javadoc -Prelease +# mvn generates the doc in apidocs/ subfolder, move it out +mv docs/apidocs/* docs/ popd >/dev/null diff --git a/pom.xml b/pom.xml index b529e81d1..28c2fbe36 100644 --- a/pom.xml +++ b/pom.xml @@ -294,16 +294,18 @@ maven-javadoc-plugin 3.4.0 - + ${project.basedir}/docs AWS Common Runtime for Java/JVM AWS Common Runtime for Java/JVM
AWS Common Runtime for Java/JVM
Copyright © Amazon.com, Inc. or its affiliates. All Rights Reserved. - ${project.basedir}/docs + public + src/main/java + true + true + all,-missing + true software.amazon.awssdk.crt.internal - - @${project.basedir}/javadoc.options -
From 833daba6821116fc856d8b20ed7847604c0ea828 Mon Sep 17 00:00:00 2001 From: Dengke Date: Mon, 9 Sep 2024 13:16:03 -0700 Subject: [PATCH 30/37] no needs for -missing on java 11 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 28c2fbe36..0673a6f5b 100644 --- a/pom.xml +++ b/pom.xml @@ -303,7 +303,7 @@ src/main/java true true - all,-missing + all true software.amazon.awssdk.crt.internal
From 3953deea17c2b68202a5190e901e382c565e532e Mon Sep 17 00:00:00 2001 From: Dengke Date: Mon, 9 Sep 2024 13:39:31 -0700 Subject: [PATCH 31/37] just cp instead of redirect it --- make-docs.sh | 2 +- pom.xml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/make-docs.sh b/make-docs.sh index f16043302..568163d75 100755 --- a/make-docs.sh +++ b/make-docs.sh @@ -10,6 +10,6 @@ rm -rf docs/ # build mvn clean javadoc:javadoc -Prelease # mvn generates the doc in apidocs/ subfolder, move it out -mv docs/apidocs/* docs/ +cp -r target/site/apidocs/ docs/ popd >/dev/null diff --git a/pom.xml b/pom.xml index 0673a6f5b..f34f30a6d 100644 --- a/pom.xml +++ b/pom.xml @@ -294,7 +294,6 @@ maven-javadoc-plugin 3.4.0 - ${project.basedir}/docs AWS Common Runtime for Java/JVM AWS Common Runtime for Java/JVM
AWS Common Runtime for Java/JVM
From 814357b003c5c90dfb1029b2dbbd1fd6804cd348 Mon Sep 17 00:00:00 2001 From: Dengke Date: Mon, 9 Sep 2024 13:45:13 -0700 Subject: [PATCH 32/37] update comments --- make-docs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make-docs.sh b/make-docs.sh index 568163d75..34e59ba0e 100755 --- a/make-docs.sh +++ b/make-docs.sh @@ -9,7 +9,7 @@ rm -rf docs/ # build mvn clean javadoc:javadoc -Prelease -# mvn generates the doc in apidocs/ subfolder, move it out +# mvn generates the doc in target/site/apidocs/ by default, move it to our common doc folder cp -r target/site/apidocs/ docs/ popd >/dev/null From cf326f39aca78c7724924069f35a236a6ebcef2b Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Tue, 10 Sep 2024 17:53:13 -0700 Subject: [PATCH 33/37] docs tweaks - move javadoc settings to be global, not just in the "release" profile - move cmake-configure out of the "generate-sources" phase, so it doesn't run during javadoc generation (yay faster iteration) --- make-docs.sh | 9 +++++---- pom.xml | 32 ++++++++++++++++++-------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/make-docs.sh b/make-docs.sh index 34e59ba0e..2da708239 100755 --- a/make-docs.sh +++ b/make-docs.sh @@ -2,14 +2,15 @@ set -e -pushd $(dirname $0) >/dev/null +pushd $(dirname $0) > /dev/null # clean rm -rf docs/ # build -mvn clean javadoc:javadoc -Prelease -# mvn generates the doc in target/site/apidocs/ by default, move it to our common doc folder +mvn javadoc:javadoc -Dmaven.javadoc.failOnWarnings=true + +# copy to docs/ cp -r target/site/apidocs/ docs/ -popd >/dev/null +popd > /dev/null diff --git a/pom.xml b/pom.xml index f34f30a6d..572d076ad 100644 --- a/pom.xml +++ b/pom.xml @@ -162,7 +162,7 @@ cmake-configure - generate-sources + generate-resources exec @@ -293,19 +293,6 @@ org.apache.maven.plugins maven-javadoc-plugin 3.4.0 - - AWS Common Runtime for Java/JVM - AWS Common Runtime for Java/JVM -
AWS Common Runtime for Java/JVM
- Copyright © Amazon.com, Inc. or its affiliates. All Rights Reserved. - public - src/main/java - true - true - all - true - software.amazon.awssdk.crt.internal -
attach-javadocs @@ -504,6 +491,23 @@ 0
+ + org.apache.maven.plugins + maven-javadoc-plugin + 3.4.0 + + AWS Common Runtime for Java/JVM + AWS Common Runtime for Java/JVM +
AWS Common Runtime for Java/JVM
+ Copyright © Amazon.com, Inc. or its affiliates. All Rights Reserved. + public + src/main/java + true + true + all + software.amazon.awssdk.crt.internal +
+
From 56763e63792274429e213529f9e9726c2020bf93 Mon Sep 17 00:00:00 2001 From: Dengke Tang Date: Fri, 13 Sep 2024 09:00:51 -0700 Subject: [PATCH 34/37] Apply suggestions from code review Co-authored-by: Michael Graeb --- README.md | 2 +- src/main/java/software/amazon/awssdk/crt/CRT.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 28e9ccafe..ec56bfae1 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ Since version v0.29.20, GraalVM native image was supported. You can compile your Since version v0.30.12, GraalVM support was updated. Instead of packaging the JNI shared lib with native image as resource, the corresponding shared lib will be written to the same directory as the native image. In this way, it reduces the native image size around 30%, and avoids the extra loading time needed for extracting the JNI lib to the temporary path for load. No additional configuration needed. -**Note**: the extracted JNI lib, `libaws-crt-jni.*` , will need to be exist in the directory containing the native image, if you move the native image to different directory. +**Note**: the JNI shared lib must be in the same directory as the GraalVM native image. If you move the native image, you must move this file too. It is `aws-crt-jni.dll` on Windows, `libaws-crt-jni.dylib` on macOS, and `libaws-crt-jni.so` on Unix. ## System Properties diff --git a/src/main/java/software/amazon/awssdk/crt/CRT.java b/src/main/java/software/amazon/awssdk/crt/CRT.java index 62d8e3992..07dd2409e 100644 --- a/src/main/java/software/amazon/awssdk/crt/CRT.java +++ b/src/main/java/software/amazon/awssdk/crt/CRT.java @@ -44,7 +44,8 @@ public final class CRT { // otherwise, load from the jar this class is in if (graalVMImageCode != null && graalVMImageCode == "runtime") { throw new CrtRuntimeException( - "Unable to load AWS CRT lib for GraalVM runtime: Make sure the libaws-crt-jni exists in the the directory containing the native image"); + "Failed to load '" + System.mapLibraryName(CRT_LIB_NAME) + + "'. Make sure this file is in the same directory as the GraalVM native image. "); } else { loadLibraryFromJar(); } From 9159d2f302ee59807f270b94ac40e2411a301a78 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 13 Sep 2024 09:01:35 -0700 Subject: [PATCH 35/37] move the comments --- src/main/java/software/amazon/awssdk/crt/CRT.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/software/amazon/awssdk/crt/CRT.java b/src/main/java/software/amazon/awssdk/crt/CRT.java index 07dd2409e..10f4b3e0d 100644 --- a/src/main/java/software/amazon/awssdk/crt/CRT.java +++ b/src/main/java/software/amazon/awssdk/crt/CRT.java @@ -41,12 +41,12 @@ public final class CRT { System.loadLibrary(CRT_LIB_NAME); } catch (UnsatisfiedLinkError e) { String graalVMImageCode = System.getProperty("org.graalvm.nativeimage.imagecode"); - // otherwise, load from the jar this class is in if (graalVMImageCode != null && graalVMImageCode == "runtime") { throw new CrtRuntimeException( "Failed to load '" + System.mapLibraryName(CRT_LIB_NAME) + "'. Make sure this file is in the same directory as the GraalVM native image. "); } else { + // otherwise, load from the jar this class is in loadLibraryFromJar(); } } From f52a4107121ed62497d468645feb609e85de3629 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 13 Sep 2024 09:56:23 -0700 Subject: [PATCH 36/37] run it on arm-mac --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d296f22a5..94e532b78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,7 +133,7 @@ jobs: ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} linux-musl-arm: - runs-on: ubuntu-24.04 # latest + runs-on: macos-14 #latest strategy: matrix: image: From a9129943f9aec679e8477f1cc7995c0f5df05727 Mon Sep 17 00:00:00 2001 From: Dengke Date: Fri, 13 Sep 2024 09:57:26 -0700 Subject: [PATCH 37/37] fine --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94e532b78..d296f22a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,7 +133,7 @@ jobs: ./linux-container-ci.sh ${{ env.BUILDER_VERSION }} aws-crt-${{ matrix.image }} build -p ${{ env.PACKAGE_NAME }} linux-musl-arm: - runs-on: macos-14 #latest + runs-on: ubuntu-24.04 # latest strategy: matrix: image: