Skip to content

Commit

Permalink
chore(build): fix exec script of LuaRocks on macOS (#13782)
Browse files Browse the repository at this point in the history
Create symbolic links against `.dylib` instead of `.so` on macOS.

KAG-5571
  • Loading branch information
ADD-SP authored Oct 24, 2024
1 parent 9a5353e commit 7599271
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions build/luarocks/templates/luarocks_exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,26 @@ OPENSSL_DIR=$root_path/$openssl_path
# but the linker expects `libexpat.so` to be present.
# So we create a symlink to the actual file
# if it doesn't exist.
if ! test -e $EXPAT_DIR/lib/libexpat.so; then
so=$(ls $EXPAT_DIR/lib/libexpat.*)
if [[ -z $so ]]; then
echo "No expat library found in $EXPAT_DIR/lib"
exit 1
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS uses `.dylib``
if ! test -e $EXPAT_DIR/lib/libexpat.dylib; then
dylib=$(ls $EXPAT_DIR/lib/libexpat.*)
if [[ -z $dylib ]]; then
echo "No expat library found in $EXPAT_DIR/lib"
exit 1
fi
ln -s $dylib $EXPAT_DIR/lib/libexpat.dylib
fi
else
# Linux uses `.so``
if ! test -e $EXPAT_DIR/lib/libexpat.so; then
so=$(ls $EXPAT_DIR/lib/libexpat.*)
if [[ -z $so ]]; then
echo "No expat library found in $EXPAT_DIR/lib"
exit 1
fi
ln -s $so $EXPAT_DIR/lib/libexpat.so
fi
ln -s $so $EXPAT_DIR/lib/libexpat.so
fi

# we use system libyaml on macos
Expand Down

1 comment on commit 7599271

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bazel Build

Docker image available kong/kong:75992713bec9db211572ed8f121d1a62a753ee67
Artifacts available https://github.com/Kong/kong/actions/runs/11491861074

Please sign in to comment.