Get rid of java.library.path when running the K/N compiler

This commit is contained in:
Ilya Matveev
2020-04-27 16:28:01 +07:00
committed by Ilya Matveev
parent 903d780194
commit a99c22fbcf
8 changed files with 6 additions and 25 deletions
+3 -6
View File
@@ -192,13 +192,11 @@ final List<File> stdLibSrc = [
]
// These files are built before the 'dist' is complete,
// so we provide custom values for
// konan.home, --runtime, -Djava.library.path etc
// so we provide custom values for konan.home, --runtime etc
targetList.each { target ->
def konanJvmArgs = [*HostManager.regularJvmArgs,
"-Dkonan.home=${rootProject.projectDir}/dist",
"-Djava.library.path=${project.buildDir}/nativelibs/$hostName",
"-Dkonan.home=${rootProject.projectDir}/dist"
]
def defaultArgs = ['-nopack', '-nostdlib', '-no-default-libs', '-no-endorsed-libs']
@@ -295,8 +293,7 @@ task debugCompiler(type: JavaExec) {
classpath = project.fileTree("${distDir.canonicalPath}/konan/lib/") {
include '*.jar'
}
jvmArgs "-Dorg.jetbrains.kotlin.native.home=${distDir.canonicalPath}",
"-Djava.library.path=${distDir.canonicalPath}/konan/nativelib"
jvmArgs "-Dorg.jetbrains.kotlin.native.home=${distDir.canonicalPath}"
enableAssertions = true
args = findProperty("konan.debug.args").toString().tokenize() ?: []
}
+1 -2
View File
@@ -13,8 +13,7 @@ test {
def dist = project.rootProject.file("dist").canonicalPath
systemProperties = [
'org.jetbrains.kotlin.native.home': dist,
'java.library.path': "$dist/konan/nativelib"
'org.jetbrains.kotlin.native.home': dist
]
}
test.dependsOn ':dist'
@@ -79,8 +79,7 @@ class RunExternalTestGroup extends JavaExec {
classpath = project.fileTree("$dist.canonicalPath/konan/lib/") {
include '*.jar'
}
jvmArgs "-Dkonan.home=${dist.canonicalPath}", "-Xmx4G",
"-Djava.library.path=${dist.canonicalPath}/konan/nativelib"
jvmArgs "-Dkonan.home=${dist.canonicalPath}", "-Xmx4G"
enableAssertions = true
def sources = File.createTempFile(name,".lst")
sources.deleteOnExit()
@@ -307,15 +307,5 @@ class NativeInteropPlugin implements Plugin<Project> {
interopStubGenerator project(path: ":Interop:StubGenerator")
interopStubGenerator project(path: ":endorsedLibraries:kotlinx.cli", configuration: "jvmRuntimeElements")
}
// FIXME: choose tasks more wisely
prj.tasks.withType(JavaExec) {
if (!name.endsWith("InteropStubs")) {
systemProperties "java.library.path": prj.files(
nativeLibsDir,
runtimeNativeLibsDir
).asPath
}
}
}
}
-1
View File
@@ -67,7 +67,6 @@ NATIVE_LIB="${KONAN_HOME}/konan/nativelib"
java_opts=(-ea \
-Xmx3G \
-XX:TieredStopAtLevel=1 \
"-Djava.library.path=${NATIVE_LIB}" \
"-Dkonan.home=${KONAN_HOME}" \
-Dfile.encoding=UTF-8 \
${JAVA_OPTS})
-1
View File
@@ -62,7 +62,6 @@ set "KONAN_CLASSPATH=%KONAN_JAR%;%TROVE_JAR%"
set JAVA_OPTS=-ea ^
-Xmx3G ^
-XX:TieredStopAtLevel=1 ^
"-Djava.library.path=%NATIVE_LIB%" ^
"-Dkonan.home=%_KONAN_HOME%" ^
-Dfile.encoding=UTF-8 ^
%JAVA_OPTS%
@@ -74,7 +74,6 @@ def nativeSrc = new File("$projectDir/src/main/kotlin-native")
targetList.each { target ->
def konanJvmArgs = [*HostManager.regularJvmArgs,
"-Dkonan.home=${rootProject.projectDir}/dist",
"-Djava.library.path=${project.buildDir}/nativelibs/$hostName",
]
def defaultArgs = ['-nopack', '-no-default-libs', '-no-endorsed-libs']
@@ -71,8 +71,7 @@ internal abstract class KonanCliRunner(
}
override val additionalSystemProperties = mutableMapOf(
"konan.home" to konanHome,
"java.library.path" to "$konanHome/konan/nativelib"
"konan.home" to konanHome
)
override val environment = mutableMapOf("LIBCLANG_DISABLE_CRASH_RECOVERY" to "1")