@@ -38,23 +38,69 @@ build_make() {
3838 make -C " $root " -j" $jobs " " $@ "
3939}
4040
41- run_release_binary_check () {
42- local check=$1
43- shift
44- env LJ_RELEASE_RUN_STOCK=0 " $@ " " $root /tools/ci/lua_test.sh" " $check "
41+ smoke_code=' print(jit.os, jit.arch); local threading = require("threading"); assert(type(threading.spawn) == "function"); assert(type(threading.gcstats) == "function")'
42+
43+ assert_platform_output () {
44+ local label=$1
45+ local out=$2
46+ local osname=$3
47+ if ! printf ' %s\n' " $out " |
48+ grep -Eq " (^|[[:space:]])${osname} [[:space:]]+x64($|[[:space:]])" ; then
49+ printf ' %s\n' " $out " >&2
50+ printf ' CI %s smoke did not report %s x64\n' " $label " " $osname " >&2
51+ exit 1
52+ fi
53+ }
54+
55+ run_direct_smoke () {
56+ local label=$1
57+ local bin=$2
58+ local osname=$3
59+ local out
60+ if [ ! -x " $bin " ]; then
61+ printf ' CI %s smoke binary is not executable: %s\n' " $label " " $bin " >&2
62+ exit 1
63+ fi
64+ if ! out=$( " $bin " -e " $smoke_code " 2>&1 ) ; then
65+ printf ' %s\n' " $out " >&2
66+ exit 1
67+ fi
68+ assert_platform_output " $label " " $out " " $osname "
69+ printf ' CI %s binary smoke passed\n' " $label "
70+ }
71+
72+ run_windows_smoke () {
73+ local bin=$1
74+ local runner=${LJ_CI_WINDOWS_RUNNER:- ${LJ_RELEASE_WINDOWS_RUNNER:- wine} }
75+ local out
76+ if [ ! -f " $bin " ]; then
77+ printf ' CI Windows smoke binary is missing: %s\n' " $bin " >&2
78+ exit 1
79+ fi
80+ if ! command -v " $runner " > /dev/null 2>&1 ; then
81+ printf ' CI Windows smoke runner is not in PATH: %s\n' " $runner " >&2
82+ exit 1
83+ fi
84+ if ! out=$( WINEDEBUG=-all " $runner " " $bin " -e " $smoke_code " 2>&1 ) ; then
85+ printf ' %s\n' " $out " >&2
86+ exit 1
87+ fi
88+ assert_platform_output " Windows" " $out " " Windows"
89+ printf ' CI Windows binary smoke passed\n'
4590}
4691
4792case " $platform " in
4893 linux-x86_64)
4994 make_clean
5095 build_make
51- run_release_binary_check release_linux_binary \
52- LJ_RELEASE_REQUIRE=linux \
53- LJ_RELEASE_LINUX_BIN=" $root /src/luajit"
96+ run_direct_smoke " Linux" " $root /src/luajit" " Linux"
5497 ;;
5598 macos-x86_64)
5699 export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET:- 13.0}
57- macos_make_args=(TARGET_SYS=Darwin)
100+ macos_make_args=(
101+ TARGET_SYS=Darwin
102+ TARGET_FLAGS=" ${LJ_CI_MACOS_TARGET_FLAGS:- ${LJ_RELEASE_MACOS_TARGET_FLAGS:- -arch x86_64} } "
103+ )
58104 if [ -n " ${LJ_CI_MACOS_CC:- ${LJ_RELEASE_MACOS_CC:- } } " ]; then
59105 macos_make_args+=(CC=" ${LJ_CI_MACOS_CC:- ${LJ_RELEASE_MACOS_CC:- } } " )
60106 fi
@@ -66,9 +112,7 @@ case "$platform" in
66112 fi
67113 make_clean
68114 build_make " ${macos_make_args[@]} "
69- run_release_binary_check release_macos_binary \
70- LJ_RELEASE_REQUIRE=macos \
71- LJ_RELEASE_MACOS_BIN=" $root /src/luajit"
115+ run_direct_smoke " macOS" " $root /src/luajit" " OSX"
72116 ;;
73117 windows-x86_64-ucrt)
74118 cross=${LJ_CI_WINDOWS_CROSS:- ${LJ_RELEASE_WINDOWS_CROSS:- x86_64-w64-mingw32ucrt-} }
@@ -81,9 +125,6 @@ case "$platform" in
81125 )
82126 make_clean
83127 build_make " ${windows_make_args[@]} "
84- run_release_binary_check release_windows_binary \
85- LJ_RELEASE_REQUIRE=windows \
86- LJ_RELEASE_WINDOWS_BIN=" $root /src/luajit.exe" \
87- LJ_RELEASE_WINDOWS_RUNNER=" ${LJ_RELEASE_WINDOWS_RUNNER:- wine} "
128+ run_windows_smoke " $root /src/luajit.exe"
88129 ;;
89130esac
0 commit comments