Allow external override of the sandbox native library path - #21592
Conversation
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 449a89f.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
449a89f to
2938bf7
Compare
|
❌ Gradle check result for 2938bf7: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Add OPENSEARCH_NATIVE_LIB env var (or -PnativeLibOverride project property) so
sandbox tests can reuse a prebuilt libopensearch_native.{dylib,so,dll} from
another worktree, a blessed shared copy, or a CI-provided binary. When set,
buildRustLibrary is skipped via onlyIf and ext.nativeLibPath resolves to the
override path.
All 14 sandbox/plugins build.gradle sites already read
project(':sandbox:libs:dataformat-native').ext.nativeLibPath, so the override
propagates to every consumer without per-plugin changes. ./gradlew run is
unaffected — it already accepts -Dnative.lib.path via tests.jvm.argline and
does not depend on buildRustLibrary.
Without the env var / property, behavior is unchanged: buildRustLibrary runs
(or is UP-TO-DATE) and rust/target/release/libopensearch_native.dylib is used.
Signed-off-by: bowenlan-amzn <bowenlan23@gmail.com>
2938bf7 to
ad17ed9
Compare
|
❕ Gradle check result for ad17ed9: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21592 +/- ##
============================================
+ Coverage 73.50% 73.52% +0.02%
+ Complexity 74644 74623 -21
============================================
Files 5980 5980
Lines 338777 338777
Branches 48848 48848
============================================
+ Hits 249011 249081 +70
+ Misses 69946 69795 -151
- Partials 19820 19901 +81 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
❌ Gradle check result for 6462775: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for b3dc2cb: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for 6f5b1a0: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Description
Add
OPENSEARCH_NATIVE_LIBenv var (or-PnativeLibOverrideGradle project property) so sandbox tests can reuse a prebuiltlibopensearch_native.{dylib,so,dll}from another worktree, a blessed shared copy, or a CI-provided binary.When set:
buildRustLibraryis skipped viaonlyIfext.nativeLibPathresolves to the override pathAll 14
sandbox/pluginsbuild.gradle sites already readproject(':sandbox:libs:dataformat-native').ext.nativeLibPath, so the override propagates to every consumer without per-plugin changes../gradlew runis unaffected—it already accepts-Dnative.lib.pathviatests.jvm.arglineand does not depend onbuildRustLibrary.Without the env var / property, behavior is unchanged:
buildRustLibraryruns (or is UP-TO-DATE) andrust/target/release/libopensearch_native.dylibis used.Usage
Example: bless a shared .dylib from one worktree for all others
Then in any other worktree:
OPENSEARCH_NATIVE_LIB=~/.cache/opensearch-sandbox/native/current.dylib \ ./gradlew check -p sandbox -Dsandbox.enabled=trueCheck List
--signoffBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certification of Origin and signing off your commits, please check here.