Skip to content

Commit b14b38a

Browse files
committed
rapidyaml works in ys native-image now
1 parent a56b709 commit b14b38a

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

common/native.mk

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,17 @@ NATIVE_OPTS := \
66
--initialize-at-build-time \
77
--enable-preview \
88
--enable-url-protocols=https \
9+
--emit=build-report \
910
-march=compatibility \
11+
-H:IncludeResources=SCI_VERSION \
12+
-H:IncludeResources='librapidyaml\.0\.8\.0\.so' \
1013
-H:ReflectionConfigurationFiles=reflection.json \
1114
-H:+ReportExceptionStackTraces \
12-
-H:IncludeResources=SCI_VERSION \
1315
-H:Log=registerResource: \
1416
-J-Dclojure.spec.skip-macros=true \
1517
-J-Dclojure.compiler.direct-linking=true \
1618
-J-Xmx3g \
1719

18-
ifdef YS_NATIVE_INCLUDE_LIBRAPIDYAML
19-
NATIVE_OPTS += \
20-
-H:IncludeResources=".*librapidyaml\.0\.8\.0\.so"
21-
endif
22-
23-
ifdef YS_NATIVE_BUILD_REPORT
24-
NATIVE_OPTS += --emit build-report
25-
endif
26-
2720
export MUSL_HOME := $(YS_TMP)/musl
2821
export PATH := $(MUSL_HOME)/bin:$(PATH)
2922

rapidyaml/src/main/java/org/rapidyaml/NativeLibLoader.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class NativeLibLoader {
1111
public static void loadLibraryFromResource(String libraryName)
1212
throws IOException
1313
{
14-
System.out.println("libraryName: " + libraryName);
14+
// System.out.println("libraryName: " + libraryName);
1515
ClassLoader classLoader =
1616
Thread.currentThread().getContextClassLoader();
1717

@@ -23,12 +23,12 @@ public static void loadLibraryFromResource(String libraryName)
2323
"Failed to load library resource '" +
2424
libraryName + "' from NativeLibLoader");
2525

26-
System.out.println("inputStream: " + inputStream);
26+
// System.out.println("inputStream: " + inputStream);
2727

2828
File tempDir = createTempDir();
2929
// tempDir.deleteOnExit();
3030
File tempFile = new File(tempDir, libraryName);
31-
System.out.println("tempFile: " + tempFile);
31+
// System.out.println("tempFile: " + tempFile);
3232

3333
Files.copy(
3434
inputStream,
@@ -44,7 +44,7 @@ public static void loadLibraryFromResource(String libraryName)
4444
// tempFile.delete();
4545
}
4646

47-
System.out.println("Loaded library from temp file");
47+
// System.out.println("Loaded library from temp file");
4848
}
4949

5050
private static File createTempDir() throws IOException {

0 commit comments

Comments
 (0)