Skip to content

Commit ff70bcd

Browse files
Remove spurious path stuff
1 parent d738ee9 commit ff70bcd

4 files changed

Lines changed: 10 additions & 11 deletions

File tree

.github/workflows/build-java.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,8 @@ jobs:
3737
with:
3838
workflow: "build-libs.yml"
3939
path: ./libs
40-
- name: Update Windows Path
41-
run: echo "${{ github.workspace }}/libs" | Out-File -FilePath $env:GITHUB_PATH -Append
42-
shell: pwsh
4340
- name: Build with Gradle
4441
run: |
45-
echo $env:GITHUB_PATH
4642
python ../devops/build_sdks.py
4743
gradle build
4844
shell: pwsh

.github/workflows/release-java.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
branch: main
4141
- name: Publish package
4242
run: |
43-
echo "${{ github.workspace }}/libs" | Out-File -FilePath $env:GITHUB_PATH -Append
4443
python ../devops/build_sdks.py --package-version=${{ github.event.inputs.packageVersion }}
4544
gradle publish
4645
working-directory: java

java/src/main/java/OkapiNative.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import com.sun.jna.Native;
33
import com.sun.jna.Platform;
44

5+
import java.io.File;
6+
import java.nio.file.Files;
57
import java.nio.file.Paths;
68

79

@@ -65,10 +67,13 @@ public static String getLibraryPath() {
6567
if (overrideLibraryPath != null && overrideLibraryPath.strip().length() > 0)
6668
return Paths.get(overrideLibraryPath).toAbsolutePath().toString();
6769

68-
var okapi_lib_path = System.getenv("OKAPI_LIBRARY_PATH");
70+
var okapi_lib_path = System.getenv("LD_LIBRARY_PATH");
6971
if (okapi_lib_path != null && okapi_lib_path.strip().length() > 0) {
70-
// Get the library name
71-
return Paths.get(okapi_lib_path, getLibraryName()).toAbsolutePath().toString();
72+
for (var path: okapi_lib_path.split(File.pathSeparator)) {
73+
var testPath = Paths.get(path, getLibraryName());
74+
if (Files.exists(testPath))
75+
return testPath.toAbsolutePath().toString();
76+
}
7277
}
7378
// System native path load
7479
return "okapi";

python/trinsicokapi/wrapper.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ def find_native_lib() -> str:
4545
return lib_path
4646
lib_name = "okapi"
4747
# Allow for manual override and then manually check, since LINUX Python doesn't always work. :(
48-
found_lib_path = _check_path(os.getenv('OKAPI_LIBRARY_PATH', ''), lib_name) \
49-
or find_library(lib_path) \
50-
or _check_path(os.getenv('LD_LIBRARY_PATH', ''), lib_name)
48+
found_lib_path = _check_path(os.getenv('LD_LIBRARY_PATH', ''), lib_name) \
49+
or find_library(lib_path)
5150
return found_lib_path
5251

5352

0 commit comments

Comments
 (0)