Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions sandbox/libs/dataformat-native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,21 @@ task buildRustLibrary(type: Exec) {
outputs.file nativeLibFile
}

// Expose the native lib path so plugins can reference it for tests
ext.nativeLibPath = nativeLibFile
// External override: reuse a prebuilt .dylib from another worktree, a blessed shared copy,
// or a CI-provided binary. Set OPENSEARCH_NATIVE_LIB (env) or -PnativeLibOverride to an
// absolute .dylib/.so/.dll path; buildRustLibrary is skipped and nativeLibPath resolves to
// the override. Consumers across sandbox/plugins read ext.nativeLibPath, so the override
// propagates without per-plugin changes.
def nativeLibOverride = project.findProperty('nativeLibOverride') ?: System.getenv('OPENSEARCH_NATIVE_LIB')
def resolvedNativeLib = nativeLibOverride ? file(nativeLibOverride) : nativeLibFile
ext.nativeLibPath = resolvedNativeLib
buildRustLibrary.onlyIf { nativeLibOverride == null }

assemble.dependsOn buildRustLibrary

test {
systemProperty 'tests.security.manager', 'false'
systemProperty 'native.lib.path', nativeLibFile.absolutePath
systemProperty 'native.lib.path', resolvedNativeLib.absolutePath
jvmArgs += ['--enable-native-access=ALL-UNNAMED']
dependsOn buildRustLibrary
}
Expand Down
Loading