2018-02-08 17:26:18 +01:00
|
|
|
source common.sh
|
|
|
|
|
2022-06-22 22:41:14 +02:00
|
|
|
if [[ $BUILD_SHARED_LIBS != 1 ]]; then
|
2023-03-16 21:00:20 +01:00
|
|
|
skipTest "Plugins are not supported"
|
2022-06-22 22:41:14 +02:00
|
|
|
fi
|
|
|
|
|
2024-04-04 01:38:09 +02:00
|
|
|
# FIXME(Qyriad): this is working around Meson putting `libplugintest.so.p` in the same place
|
|
|
|
# as `libplugintest.so`, so `libplugintest.*` grabs both.
|
|
|
|
libext=so
|
|
|
|
if [[ "$(uname -s)" == Darwin ]]; then
|
|
|
|
libext=dylib
|
|
|
|
fi
|
|
|
|
|
|
|
|
res=$(nix --option setting-set true --option plugin-files "$PWD/plugins/libplugintest.$libext" eval --expr builtins.anotherNull)
|
2018-02-08 17:26:18 +01:00
|
|
|
|
|
|
|
[ "$res"x = "nullx" ]
|
2024-03-11 08:50:57 +01:00
|
|
|
|
|
|
|
# Plugin load failing due to missing symbols
|
2024-04-04 01:38:09 +02:00
|
|
|
res=$(nix --option plugin-files "$PWD/plugins/libplugintestfail.$libext" eval --expr '1234 + 5' 2>&1)
|
2024-03-11 08:50:57 +01:00
|
|
|
# We expect this to succeed evaluating
|
|
|
|
echo "$res" | grep 1239 >/dev/null
|
|
|
|
# On Linux, we expect this to print some failure of dlopen.
|
|
|
|
# Only on Linux do we expect for sure that -z now is set on the .so file, so it
|
|
|
|
# will definitely fail to load instead of lazy loading (and thus not hitting
|
|
|
|
# the missing symbol).
|
|
|
|
# FIXME(jade): does there exist an equivalent of -z now on macOS that eluded us
|
|
|
|
# in search?
|
|
|
|
if [[ "$(uname -s)" == Linux ]]; then
|
|
|
|
echo "$res" | grep "could not dynamically open plugin file" >/dev/null
|
|
|
|
fi
|