fix(opensearch): don't include the jna library on mac for x86-64 (#4847)

* fix(opensearch): don't include the jna library on mac for x86-64

there seems to be some linker issue with loading libc. calling these
native functions doesn't seem strictly necessary. maybe better that
the package works at all.

in macos 13 and later, it works fine, so maybe this workaround could
be removed when macos 12 is no longer supported

* fix(opensearch): remove some windows-only code that is breaking

* fix(opensearch): err, that was in the wrong spot
This commit is contained in:
Scott J. Goldman 2024-01-14 18:17:05 -08:00 committed by GitHub
parent ca17ab65c1
commit 94618b6182
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,9 +24,20 @@ build:
openblas.net: "*"
script:
# there seems to be a loader bug with trying to dlopen libc on macos 12 and earlier.
# remove this step when macos 12 and under are no longer supported.
- run: |
sed -i 's|JNAKernel32Library.getInstance();|//JNAKernel32Library.getInstance();|' server/src/main/java/org/opensearch/bootstrap/Bootstrap.java
if: darwin/x86-64
- gradle -Dbuild.snapshot=false ":distribution:archives:no-jdk-{{hw.platform}}-tar:assemble"
- run: tar --strip-components=1 -xf $SRCROOT/distribution/archives/no-jdk-{{hw.platform}}-tar/build/distributions/opensearch-*.tar.gz
working-directory: ${{prefix}}
# there seems to be a loader bug with trying to dlopen libc on macos 12 and earlier.
# remove this step when macos 12 and under are no longer supported.
- run: |
rm -f lib/jna-*.jar
if: darwin/x86-64
working-directory: ${{prefix}}
- run: 'sed -i "s|#\s*cluster.name: .*|cluster.name: opensearch_pkgx|" opensearch.yml'
working-directory: ${{prefix}}/config