Skip to content

Commit 585db18

Browse files
committed
fix: advance cross-platform CI qualification
1 parent 66dfcd9 commit 585db18

6 files changed

Lines changed: 65 additions & 35 deletions

File tree

‎.github/workflows/canonical-ci.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ jobs:
162162
set -euo pipefail
163163
cmake -S modules/cli -B cli-analysis -G Ninja \
164164
-DCMAKE_BUILD_TYPE=Debug -DVIX_CLI_BUILD_TESTS=OFF \
165+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
165166
-DVIX_REQUESTS_BUILD_TESTS=OFF -DVIX_REQUESTS_BUILD_EXAMPLES=OFF \
166167
-DVIX_CORE_WITH_UI=OFF -DVIX_CORE_FETCH_UI=OFF -DVIX_CORE_WITH_MYSQL=OFF
167168
shopt -s globstar nullglob

‎domains/files/src/FilesWindows.cpp‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ namespace vix::files
4646
case EINVAL: identity = errors::invalid_path; break;
4747
default: break;
4848
}
49+
char description[256]{};
50+
const auto description_status = ::strerror_s(description, sizeof(description), value);
51+
const std::string message = description_status == 0 ? description : "unknown C runtime error";
4952
return detail::allocation_or_terminate([&]
5053
{
51-
return Error{identity, std::string(operation) + ": " + std::strerror(value)};
54+
return Error{identity, std::string(operation) + ": " + message};
5255
});
5356
}
5457

‎domains/network/CMakeLists.txt‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,19 @@ if (ANDROID)
1919
message(FATAL_ERROR
2020
"Vix Network Android support is limited to arm64-v8a and x86_64; got '${CMAKE_ANDROID_ARCH_ABI}'.")
2121
endif()
22-
if (NOT CMAKE_SYSTEM_VERSION OR CMAKE_SYSTEM_VERSION VERSION_LESS 21)
22+
set(_vix_network_android_api "")
23+
if (DEFINED ANDROID_PLATFORM_LEVEL)
24+
set(_vix_network_android_api "${ANDROID_PLATFORM_LEVEL}")
25+
elseif (ANDROID_PLATFORM MATCHES "android-([0-9]+)$")
26+
set(_vix_network_android_api "${CMAKE_MATCH_1}")
27+
elseif (DEFINED CMAKE_ANDROID_API)
28+
set(_vix_network_android_api "${CMAKE_ANDROID_API}")
29+
elseif (CMAKE_SYSTEM_VERSION MATCHES "^([0-9]+)$")
30+
set(_vix_network_android_api "${CMAKE_MATCH_1}")
31+
elseif (CMAKE_SYSTEM_VERSION MATCHES "android-([0-9]+)$")
32+
set(_vix_network_android_api "${CMAKE_MATCH_1}")
33+
endif()
34+
if (_vix_network_android_api STREQUAL "" OR _vix_network_android_api LESS 21)
2335
message(FATAL_ERROR
2436
"Vix Network Android requires NDK platform/API level 21 or newer (epoll_create1, eventfd, accept4).")
2537
endif()

‎domains/process/src/ProcessPosix.cpp‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,10 @@ namespace vix::process
527527
std::unique_lock spawn_lock(provider_spawn_mutex, std::defer_lock);
528528
#if defined(__APPLE__) && defined(POSIX_SPAWN_CLOEXEC_DEFAULT) && \
529529
defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500
530-
if (!__builtin_available(macOS 10.15, *))
530+
bool cloexec_default_available = false;
531+
if (__builtin_available(macOS 10.15, *))
532+
cloexec_default_available = true;
533+
if (!cloexec_default_available)
531534
spawn_lock.lock();
532535
#else
533536
spawn_lock.lock();

‎modules/cli‎

‎standard/tests/CMakeLists.txt‎

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -167,51 +167,60 @@ add_test(
167167
COMMAND vix_standard_completion_test
168168
)
169169

170-
add_executable(vix_standard_completion_fault_test
171-
completion_fault_test.cpp
172-
)
170+
# These runtime fault cases intentionally throw. The current WASI Preview 2
171+
# SDK has no C++ exception runtime, so that platform validates the
172+
# exception-disabled API through the compile probes below instead.
173+
if (NOT CMAKE_SYSTEM_NAME STREQUAL "WASI")
174+
add_executable(vix_standard_completion_fault_test
175+
completion_fault_test.cpp
176+
)
173177

174-
target_compile_features(vix_standard_completion_fault_test PRIVATE cxx_std_20)
178+
target_compile_features(vix_standard_completion_fault_test PRIVATE cxx_std_20)
175179

176-
target_link_libraries(vix_standard_completion_fault_test
177-
PRIVATE
178-
vix::standard
179-
)
180+
target_link_libraries(vix_standard_completion_fault_test
181+
PRIVATE
182+
vix::standard
183+
)
180184

181-
add_test(
182-
NAME vix_standard_completion_value_fault_test
183-
COMMAND vix_standard_completion_fault_test value
184-
)
185+
add_test(
186+
NAME vix_standard_completion_value_fault_test
187+
COMMAND vix_standard_completion_fault_test value
188+
)
185189

186-
add_test(
187-
NAME vix_standard_completion_error_fault_test
188-
COMMAND vix_standard_completion_fault_test error
189-
)
190+
add_test(
191+
NAME vix_standard_completion_error_fault_test
192+
COMMAND vix_standard_completion_fault_test error
193+
)
190194

191-
add_test(
192-
NAME vix_standard_completion_taken_value_fault_test
193-
COMMAND vix_standard_completion_fault_test taken_value
194-
)
195+
add_test(
196+
NAME vix_standard_completion_taken_value_fault_test
197+
COMMAND vix_standard_completion_fault_test taken_value
198+
)
195199

196-
add_test(
197-
NAME vix_standard_completion_second_take_fault_test
198-
COMMAND vix_standard_completion_fault_test second_take
199-
)
200+
add_test(
201+
NAME vix_standard_completion_second_take_fault_test
202+
COMMAND vix_standard_completion_fault_test second_take
203+
)
204+
endif()
200205

201-
set_tests_properties(
206+
set(_vix_standard_fault_tests
202207
vix_standard_result_value_fault_test
203208
vix_standard_result_error_fault_test
204209
vix_standard_result_taken_value_fault_test
205210
vix_standard_result_second_take_fault_test
206211
vix_standard_time_duration_fault_test
207212
vix_standard_time_deadline_fault_test
208-
vix_standard_completion_value_fault_test
209-
vix_standard_completion_error_fault_test
210-
vix_standard_completion_taken_value_fault_test
211-
vix_standard_completion_second_take_fault_test
212213
vix_standard_cancellation_callback_fault_test
213-
PROPERTIES WILL_FAIL TRUE
214214
)
215+
if (NOT CMAKE_SYSTEM_NAME STREQUAL "WASI")
216+
list(APPEND _vix_standard_fault_tests
217+
vix_standard_completion_value_fault_test
218+
vix_standard_completion_error_fault_test
219+
vix_standard_completion_taken_value_fault_test
220+
vix_standard_completion_second_take_fault_test
221+
)
222+
endif()
223+
set_tests_properties(${_vix_standard_fault_tests} PROPERTIES WILL_FAIL TRUE)
215224

216225
# Repository verification convenience only. This is deliberately not a
217226
# dependency of vix::standard: consumers receive the header-only programming
@@ -227,8 +236,10 @@ add_custom_target(vix_standard_check
227236
vix_standard_cancellation_test
228237
vix_standard_cancellation_fault_test
229238
vix_standard_completion_test
230-
vix_standard_completion_fault_test
231239
)
240+
if (NOT CMAKE_SYSTEM_NAME STREQUAL "WASI")
241+
add_dependencies(vix_standard_check vix_standard_completion_fault_test)
242+
endif()
232243

233244
function(vix_standard_expect_compile_failure name source)
234245
try_compile(${name}_compiled

0 commit comments

Comments
 (0)