Skip to content
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- **Shared-map host tests now exercise provisioned language runtimes.** The
Lua, JavaScript, Python, Perl, and Ruby bridges now compile with the
sandbox ABI enabled and receive their detected runtime library paths,
instead of failing before their grant-map checks run.
15 changes: 15 additions & 0 deletions tests/sandbox/detect_host_langs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ for v in lua5.4 lua5.3 lua5.2; do
if pkg-config --exists $v 2>/dev/null; then
LUA_CFLAGS=$(pkg-config --cflags $v)
LUA_LIBS=$(pkg-config --libs $v)
LUA_LIBNAME=$(pkg-config --libs-only-l $v | sed -n 's/.*-l\([^ ]*\).*/lib\1.so/p')
AETHER_LUA_SONAME=$(ldconfig -p 2>/dev/null | awk -v lib="$LUA_LIBNAME" '$1 == lib { print $NF; exit }')
export AETHER_LUA_SONAME
LUA_CMD=$(echo $v | tr -d '.') # lua54, lua53, etc — some systems use this
# Try common command names
for cmd in $v lua; do
Expand All @@ -26,6 +29,8 @@ for v in python3 python3.12 python3.11 python3.10; do
PY_CFLAGS=$($cfg --includes 2>/dev/null)
PY_LIBS="-l$(echo $v | tr -d .)" # -lpython311 etc doesn't work, try embed
PY_LIBS=$($cfg --ldflags --embed 2>/dev/null || $cfg --ldflags 2>/dev/null)
AETHER_PYTHON_SONAME=$($v -c 'import os, sysconfig; print(os.path.join(sysconfig.get_config_var("LIBDIR") or "", sysconfig.get_config_var("INSTSONAME") or ""))' 2>/dev/null)
export AETHER_PYTHON_SONAME
PY_AVAILABLE=1
break
fi
Expand All @@ -36,6 +41,8 @@ if [ $PY_AVAILABLE -eq 0 ]; then
if pkg-config --exists $v 2>/dev/null; then
PY_CFLAGS=$(pkg-config --cflags $v)
PY_LIBS=$(pkg-config --libs $v)
AETHER_PYTHON_SONAME=$(python3 -c 'import os, sysconfig; print(os.path.join(sysconfig.get_config_var("LIBDIR") or "", sysconfig.get_config_var("INSTSONAME") or ""))' 2>/dev/null)
export AETHER_PYTHON_SONAME
PY_AVAILABLE=1
break
fi
Expand All @@ -53,6 +60,8 @@ if perl -MExtUtils::Embed -e ccopts >/dev/null 2>&1; then
PERL_SO=$(find /usr/lib -name "$PERL_LIBDIR" 2>/dev/null | head -1)
if [ -n "$PERL_SO" ]; then
PERL_LIBS="$PERL_SO -ldl -lm -lpthread -lcrypt"
AETHER_PERL_SONAME="$PERL_SO"
export AETHER_PERL_SONAME
fi
fi
# Fallback: try -lperl
Expand All @@ -68,6 +77,10 @@ for v in ruby-3.3 ruby-3.2 ruby-3.1 ruby-3.0 ruby; do
if pkg-config --exists $v 2>/dev/null; then
RUBY_CFLAGS=$(pkg-config --cflags $v)
RUBY_LIBS=$(pkg-config --libs $v)
if command -v ruby >/dev/null 2>&1; then
AETHER_RUBY_SONAME=$(ruby -rrbconfig -e 'print File.join(RbConfig::CONFIG["libdir"], RbConfig::CONFIG["LIBRUBY_SO"])' 2>/dev/null)
export AETHER_RUBY_SONAME
fi
RUBY_AVAILABLE=1
break
fi
Expand All @@ -78,6 +91,8 @@ JS_AVAILABLE=0
if [ -f /usr/include/duktape.h ]; then
JS_CFLAGS=""
JS_LIBS="-lduktape"
AETHER_DUKTAPE_SONAME=$(ldconfig -p 2>/dev/null | awk '/libduktape\.so/ { print $NF; exit }')
export AETHER_DUKTAPE_SONAME
JS_AVAILABLE=1
fi

Expand Down
10 changes: 5 additions & 5 deletions tests/sandbox/test_shared_map_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ LUA_OUT=$(gcc -o $AE_TMP/test_map_lua \
"$ROOT/contrib/host/lua/aether_host_lua.c" \
"$ROOT/runtime/aether_sandbox.c" \
"$ROOT/runtime/aether_shared_map.c" \
$LUA_CFLAGS -I"$ROOT/runtime" -DAETHER_HAS_LUA \
$LUA_CFLAGS -I"$ROOT/runtime" -DAETHER_HAS_LUA -DAETHER_HAS_SANDBOX \
-L"$ROOT/build" -laether $LUA_LIBS -ldl -lm -lrt \
-Wno-discarded-qualifiers \
-xc - 2>/dev/null << 'CEOF'
Expand Down Expand Up @@ -88,7 +88,7 @@ JS_OUT=$(gcc -o $AE_TMP/test_map_js \
"$ROOT/contrib/host/duktape/aether_host_duktape.c" \
"$ROOT/runtime/aether_sandbox.c" \
"$ROOT/runtime/aether_shared_map.c" \
$JS_CFLAGS -I"$ROOT/runtime" -DAETHER_HAS_DUKTAPE \
$JS_CFLAGS -I"$ROOT/runtime" -DAETHER_HAS_DUKTAPE -DAETHER_HAS_SANDBOX \
-L"$ROOT/build" -laether $JS_LIBS -ldl -lm -lrt \
-Wno-discarded-qualifiers \
-xc - 2>/dev/null << 'CEOF'
Expand Down Expand Up @@ -135,7 +135,7 @@ PY_OUT=$(gcc -o $AE_TMP/test_map_py \
"$ROOT/contrib/host/python/aether_host_python.c" \
"$ROOT/runtime/aether_sandbox.c" \
"$ROOT/runtime/aether_shared_map.c" \
$PY_CFLAGS -I"$ROOT/runtime" -DAETHER_HAS_PYTHON \
$PY_CFLAGS -I"$ROOT/runtime" -DAETHER_HAS_PYTHON -DAETHER_HAS_SANDBOX \
-L"$ROOT/build" -laether $PY_LIBS -ldl -lm -lrt \
-Wno-discarded-qualifiers \
-xc - 2>/dev/null << 'CEOF'
Expand Down Expand Up @@ -186,7 +186,7 @@ PERL_OUT=$(gcc -o $AE_TMP/test_map_perl \
"$ROOT/contrib/host/perl/aether_host_perl.c" \
"$ROOT/runtime/aether_sandbox.c" \
"$ROOT/runtime/aether_shared_map.c" \
$PERL_CFLAGS -I"$ROOT/runtime" -DAETHER_HAS_PERL \
$PERL_CFLAGS -I"$ROOT/runtime" -DAETHER_HAS_PERL -DAETHER_HAS_SANDBOX \
-L"$ROOT/build" -laether $PERL_LIBS -lrt \
-Wno-discarded-qualifiers \
-xc - 2>/dev/null << 'CEOF'
Expand Down Expand Up @@ -233,7 +233,7 @@ RUBY_OUT=$(gcc -o $AE_TMP/test_map_ruby \
"$ROOT/contrib/host/ruby/aether_host_ruby.c" \
"$ROOT/runtime/aether_sandbox.c" \
"$ROOT/runtime/aether_shared_map.c" \
$RUBY_CFLAGS -I"$ROOT/runtime" -DAETHER_HAS_RUBY \
$RUBY_CFLAGS -I"$ROOT/runtime" -DAETHER_HAS_RUBY -DAETHER_HAS_SANDBOX \
-L"$ROOT/build" -laether $RUBY_LIBS -ldl -lm -lrt \
-Wno-discarded-qualifiers \
-xc - 2>/dev/null << 'CEOF'
Expand Down
Loading