chore(deps): bump VoidLibrary to de1fdcda
VoidBuildSystem CI / 1 · Requirements (push) Successful in 6s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 4m17s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 4m25s
VoidBuildSystem CI / 2B · Windows Wine build (sanitizers) (push) Successful in 5m11s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 5m25s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 6m12s
VoidBuildSystem CI / 2C · Windows native build (debug) (push) Successful in 6m20s
VoidBuildSystem CI / 2C · Windows native build (sanitizers) (push) Failing after 22s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 3m35s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 1m38s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 2m42s
VoidBuildSystem CI / 3B · Windows Wine test (sanitizers) (push) Successful in 2m45s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 2m55s
VoidBuildSystem CI / 2C · Windows native build (relwithdebinfo) (push) Successful in 4m10s
VoidBuildSystem CI / 3C · Windows native test (debug) (push) Failing after 55s
VoidBuildSystem CI / 3C · Windows native test (sanitizers) (push) Failing after 15s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Failing after 6m29s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Failing after 6m34s
VoidBuildSystem CI / 4A · Linux package (debug) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Skipped
VoidBuildSystem CI / 3C · Windows native test (relwithdebinfo) (push) Failing after 48s
VoidBuildSystem CI / 4B · Windows package (debug) (push) Successful in 1m54s
VoidBuildSystem CI / 4B · Windows package (sanitizers) (push) Successful in 16s
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Successful in 4m0s
VoidBuildSystem CI / 5 · Release (push) Skipped
VoidBuildSystem CI / 1 · Requirements (push) Successful in 6s
VoidBuildSystem CI / 2B · Windows Wine build (debug) (push) Successful in 4m17s
VoidBuildSystem CI / 2A · Linux build (debug) (push) Successful in 4m25s
VoidBuildSystem CI / 2B · Windows Wine build (sanitizers) (push) Successful in 5m11s
VoidBuildSystem CI / 2A · Linux build (sanitizers) (push) Successful in 5m25s
VoidBuildSystem CI / 2A · Linux build (relwithdebinfo) (push) Successful in 6m12s
VoidBuildSystem CI / 2C · Windows native build (debug) (push) Successful in 6m20s
VoidBuildSystem CI / 2C · Windows native build (sanitizers) (push) Failing after 22s
VoidBuildSystem CI / 2B · Windows Wine build (relwithdebinfo) (push) Successful in 3m35s
VoidBuildSystem CI / 3A · Linux test (sanitizers) (push) Successful in 1m38s
VoidBuildSystem CI / 3B · Windows Wine test (relwithdebinfo) (push) Successful in 2m42s
VoidBuildSystem CI / 3B · Windows Wine test (sanitizers) (push) Successful in 2m45s
VoidBuildSystem CI / 3B · Windows Wine test (debug) (push) Successful in 2m55s
VoidBuildSystem CI / 2C · Windows native build (relwithdebinfo) (push) Successful in 4m10s
VoidBuildSystem CI / 3C · Windows native test (debug) (push) Failing after 55s
VoidBuildSystem CI / 3C · Windows native test (sanitizers) (push) Failing after 15s
VoidBuildSystem CI / 3A · Linux test (relwithdebinfo) (push) Failing after 6m29s
VoidBuildSystem CI / 3A · Linux test (debug) (push) Failing after 6m34s
VoidBuildSystem CI / 4A · Linux package (debug) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (relwithdebinfo) (push) Skipped
VoidBuildSystem CI / 4A · Linux package (sanitizers) (push) Skipped
VoidBuildSystem CI / 3C · Windows native test (relwithdebinfo) (push) Failing after 48s
VoidBuildSystem CI / 4B · Windows package (debug) (push) Successful in 1m54s
VoidBuildSystem CI / 4B · Windows package (sanitizers) (push) Successful in 16s
VoidBuildSystem CI / 4B · Windows package (relwithdebinfo) (push) Successful in 4m0s
VoidBuildSystem CI / 5 · Release (push) Skipped
The new pin vendors SQLite for every platform (Sqlite is now qualified on Windows), implements FileLock, symlink swap, reflink copy and timestamps on Windows (Void/Library#66), so the local Win32 lock and mtime workarounds go back to the VoidLibrary primitives, and VBS enables Void::Sqlite unconditionally since Void resolves its own backend. Verified: MinGW-w64 Windows build of all targets, vbs under Wine, SDK suite 17/17 under Wine, and the Linux suite 8/8.
This commit is contained in:
1 parent
e333bbe84b
commit
8e3fffd636
7 files changed
+14
-122
No files matched your search
+1
-1
@@ -18,7 +18,7 @@ endif()
|
|||||||
option(VBS_BUILD_TESTS "Build declaration SDK and native engine test suites" ON)
|
option(VBS_BUILD_TESTS "Build declaration SDK and native engine test suites" ON)
|
||||||
option(VBS_BUILD_BENCHMARKS "Build reproducible VBS benchmark harness" ON)
|
option(VBS_BUILD_BENCHMARKS "Build reproducible VBS benchmark harness" ON)
|
||||||
set(VBS_VOID_SOURCE_DIR "" CACHE PATH "Development-only VoidLibrary source override (bypasses pin)")
|
set(VBS_VOID_SOURCE_DIR "" CACHE PATH "Development-only VoidLibrary source override (bypasses pin)")
|
||||||
set(VBS_VOID_REVISION "482a3ea46b0050ec07f5063fd319e66180b4d2e4")
|
set(VBS_VOID_REVISION "de1fdcda72ddd6ac069fba433b13f643327efa3f")
|
||||||
include(cmake/VoidDependency.cmake)
|
include(cmake/VoidDependency.cmake)
|
||||||
vbs_add_void_dependency()
|
vbs_add_void_dependency()
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ void build(Void::Build::Project &project) {
|
|||||||
auto library = project.dependency("VoidLibrary");
|
auto library = project.dependency("VoidLibrary");
|
||||||
library
|
library
|
||||||
.git("https://git.faumaray.com/Void/VoidLibrary.git",
|
.git("https://git.faumaray.com/Void/VoidLibrary.git",
|
||||||
Void::Build::Commit{"482a3ea46b0050ec07f5063fd319e66180b4d2e4"})
|
Void::Build::Commit{"de1fdcda72ddd6ac069fba433b13f643327efa3f"})
|
||||||
.native_builder({{"VOID_ENABLED_MODULES",
|
.native_builder({{"VOID_ENABLED_MODULES",
|
||||||
"Configuration;Text;Unicode;Async;Algorithms;Crypto;Archive;Testing;Log"},
|
"Configuration;Text;Unicode;Async;Algorithms;Crypto;Archive;Testing;Log"},
|
||||||
{"BUILD_SHARED_LIBS", false}});
|
{"BUILD_SHARED_LIBS", false}});
|
||||||
|
|||||||
@@ -11,15 +11,11 @@ function(vbs_add_void_dependency)
|
|||||||
list(APPEND VOID_ENABLED_MODULES Testing)
|
list(APPEND VOID_ENABLED_MODULES Testing)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Crypto (VL-007) and Archive (VL-006) now work with zero external dependencies in VoidLibrary;
|
# Crypto (VL-007) and Archive (VL-006) work with zero external dependencies.
|
||||||
# Sqlite remains opportunistic when system SQLite3 is installed.
|
# Sqlite: Void resolves its own backend (system SQLite3, the vendored
|
||||||
find_package(SQLite3 QUIET)
|
# amalgamation, or its FetchContent fallback), so it is always available.
|
||||||
if(SQLite3_FOUND)
|
list(APPEND VOID_ENABLED_MODULES Sqlite)
|
||||||
list(APPEND VOID_ENABLED_MODULES Sqlite)
|
set(VBS_HAS_VOID_SQLITE ON PARENT_SCOPE)
|
||||||
set(VBS_HAS_VOID_SQLITE ON PARENT_SCOPE)
|
|
||||||
else()
|
|
||||||
set(VBS_HAS_VOID_SQLITE OFF PARENT_SCOPE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Void::Net (Track E4) needs Boost url/beast/asio and OpenSSL; enable it only when the
|
# Void::Net (Track E4) needs Boost url/beast/asio and OpenSSL; enable it only when the
|
||||||
# environment actually provides both, so minimal shells keep the pure-POSIX transport.
|
# environment actually provides both, so minimal shells keep the pure-POSIX transport.
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <memory>
|
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <span>
|
#include <span>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -32,31 +31,12 @@ class FileLock {
|
|||||||
acquire(const std::filesystem::path &lock_path, LockMode mode = LockMode::Exclusive,
|
acquire(const std::filesystem::path &lock_path, LockMode mode = LockMode::Exclusive,
|
||||||
bool non_blocking = false);
|
bool non_blocking = false);
|
||||||
|
|
||||||
[[nodiscard]] bool valid() const noexcept {
|
[[nodiscard]] bool valid() const noexcept { return lock_.locked(); }
|
||||||
#if defined(_WIN32)
|
void release() noexcept { lock_.unlock(); }
|
||||||
return handle_ != nullptr;
|
|
||||||
#else
|
|
||||||
return lock_.locked();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
void release() noexcept {
|
|
||||||
#if defined(_WIN32)
|
|
||||||
handle_.reset();
|
|
||||||
#else
|
|
||||||
lock_.unlock();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if defined(_WIN32)
|
|
||||||
explicit FileLock(std::shared_ptr<void> handle) noexcept : handle_{std::move(handle)} {}
|
|
||||||
// Win32 HANDLE (CreateFileW + LockFileEx) with an unlock/close deleter, because
|
|
||||||
// Void::FileSystem::FileLock is POSIX-only (Void/Library issue #66).
|
|
||||||
std::shared_ptr<void> handle_;
|
|
||||||
#else
|
|
||||||
explicit FileLock(Void::FileSystem::FileLock lock) noexcept : lock_{std::move(lock)} {}
|
explicit FileLock(Void::FileSystem::FileLock lock) noexcept : lock_{std::move(lock)} {}
|
||||||
Void::FileSystem::FileLock lock_;
|
Void::FileSystem::FileLock lock_;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FileMetadata {
|
struct FileMetadata {
|
||||||
|
|||||||
@@ -43,44 +43,6 @@ FileLock::acquire(const std::filesystem::path &lock_path, LockMode mode, bool no
|
|||||||
lock_path.string(), ec.message()))};
|
lock_path.string(), ec.message()))};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if defined(_WIN32)
|
|
||||||
// Void::FileSystem::FileLock is POSIX-only (Void/Library issue #66).
|
|
||||||
const HANDLE raw = ::CreateFileW(lock_path.c_str(), GENERIC_READ | GENERIC_WRITE,
|
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
|
||||||
nullptr, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
|
|
||||||
if (raw == INVALID_HANDLE_VALUE) {
|
|
||||||
const DWORD err = ::GetLastError();
|
|
||||||
return std::unexpected{Void::System::make_system_error(
|
|
||||||
Void::System::SystemErrorCode::io_error,
|
|
||||||
std::format("FileLock: cannot open '{}' (error {})", lock_path.string(), err),
|
|
||||||
static_cast<int>(err))};
|
|
||||||
}
|
|
||||||
OVERLAPPED overlapped{};
|
|
||||||
DWORD flags = mode == LockMode::Exclusive ? LOCKFILE_EXCLUSIVE_LOCK : 0;
|
|
||||||
if (non_blocking) {
|
|
||||||
flags |= LOCKFILE_FAIL_IMMEDIATELY;
|
|
||||||
}
|
|
||||||
if (::LockFileEx(raw, flags, 0, MAXDWORD, MAXDWORD, &overlapped) == 0) {
|
|
||||||
const DWORD err = ::GetLastError();
|
|
||||||
::CloseHandle(raw);
|
|
||||||
if (non_blocking && (err == ERROR_LOCK_VIOLATION || err == ERROR_IO_PENDING)) {
|
|
||||||
return std::unexpected{Void::System::make_system_error(
|
|
||||||
Void::System::SystemErrorCode::busy,
|
|
||||||
std::format("FileLock: '{}' is already locked", lock_path.string()), EAGAIN)};
|
|
||||||
}
|
|
||||||
return std::unexpected{Void::System::make_system_error(
|
|
||||||
Void::System::SystemErrorCode::io_error,
|
|
||||||
std::format("FileLock: locking '{}' failed (error {})", lock_path.string(), err),
|
|
||||||
static_cast<int>(err))};
|
|
||||||
}
|
|
||||||
auto handle = std::shared_ptr<void>{raw, [](void *h) {
|
|
||||||
OVERLAPPED unlock{};
|
|
||||||
(void)::UnlockFileEx(static_cast<HANDLE>(h), 0, MAXDWORD,
|
|
||||||
MAXDWORD, &unlock);
|
|
||||||
(void)::CloseHandle(static_cast<HANDLE>(h));
|
|
||||||
}};
|
|
||||||
return FileLock{std::move(handle)};
|
|
||||||
#else
|
|
||||||
const auto vl_mode = (mode == LockMode::Exclusive) ? Void::FileSystem::LockMode::Exclusive
|
const auto vl_mode = (mode == LockMode::Exclusive) ? Void::FileSystem::LockMode::Exclusive
|
||||||
: Void::FileSystem::LockMode::Shared;
|
: Void::FileSystem::LockMode::Shared;
|
||||||
if (non_blocking) {
|
if (non_blocking) {
|
||||||
@@ -100,7 +62,6 @@ FileLock::acquire(const std::filesystem::path &lock_path, LockMode mode, bool no
|
|||||||
return std::unexpected{std::move(res.error())};
|
return std::unexpected{std::move(res.error())};
|
||||||
}
|
}
|
||||||
return FileLock{std::move(*res)};
|
return FileLock{std::move(*res)};
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Void::Result::Result<FileMetadata, Void::Result::Error>
|
Void::Result::Result<FileMetadata, Void::Result::Error>
|
||||||
@@ -239,47 +200,21 @@ copy_isolated(const std::filesystem::path &src, const std::filesystem::path &dst
|
|||||||
|
|
||||||
auto res = Void::FileSystem::reflink_copy_file(src, dst, opts);
|
auto res = Void::FileSystem::reflink_copy_file(src, dst, opts);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
#if defined(_WIN32)
|
|
||||||
// No reflink support on this filesystem/host: fall back to a plain copy.
|
|
||||||
std::filesystem::copy_file(src, dst, std::filesystem::copy_options::overwrite_existing,
|
|
||||||
ec);
|
|
||||||
if (ec) {
|
|
||||||
return std::unexpected{sys_err(
|
|
||||||
ec.value(), std::format("copy_isolated: copy_file failed for '{}': {}",
|
|
||||||
dst.string(), ec.message()))};
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
return std::unexpected{std::move(res.error())};
|
return std::unexpected{std::move(res.error())};
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#if defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
(void)mode_override;
|
|
||||||
#else
|
|
||||||
if (mode_override) {
|
if (mode_override) {
|
||||||
(void)::chmod(dst.c_str(), static_cast<mode_t>(*mode_override));
|
(void)::chmod(dst.c_str(), static_cast<mode_t>(*mode_override));
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)mode_override;
|
||||||
#endif
|
#endif
|
||||||
return res->method == Void::FileSystem::CopyMethod::Reflink;
|
return res->method == Void::FileSystem::CopyMethod::Reflink;
|
||||||
}
|
}
|
||||||
|
|
||||||
Void::Result::Result<void, Void::Result::Error>
|
Void::Result::Result<void, Void::Result::Error>
|
||||||
set_canonical_mtime(const std::filesystem::path &path, std::int64_t epoch_seconds) {
|
set_canonical_mtime(const std::filesystem::path &path, std::int64_t epoch_seconds) {
|
||||||
#if defined(_WIN32)
|
|
||||||
// Void::FileSystem::set_canonical_mtime is POSIX-only (Void/Library issue #66).
|
|
||||||
std::error_code ec;
|
|
||||||
const auto stamp = std::chrono::file_clock::from_sys(
|
|
||||||
std::chrono::system_clock::time_point{std::chrono::seconds{epoch_seconds}});
|
|
||||||
std::filesystem::last_write_time(path, stamp, ec);
|
|
||||||
if (ec) {
|
|
||||||
return std::unexpected{
|
|
||||||
sys_err(ec.value(), std::format("set_canonical_mtime: failed for '{}': {}",
|
|
||||||
path.string(), ec.message()))};
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
#else
|
|
||||||
return Void::FileSystem::set_canonical_mtime(path, epoch_seconds, 0);
|
return Void::FileSystem::set_canonical_mtime(path, epoch_seconds, 0);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Void::Result::Result<void, Void::Result::Error>
|
Void::Result::Result<void, Void::Result::Error>
|
||||||
@@ -356,27 +291,8 @@ atomic_swap_symlink(const std::filesystem::path &link_path, const std::filesyste
|
|||||||
ec.value(), std::format("atomic_swap_symlink: create_directories failed for '{}'",
|
ec.value(), std::format("atomic_swap_symlink: create_directories failed for '{}'",
|
||||||
parent.string()))};
|
parent.string()))};
|
||||||
}
|
}
|
||||||
#if defined(_WIN32)
|
|
||||||
// Void::FileSystem::atomic_symlink_swap is POSIX-only (Void/Library issue #66).
|
|
||||||
// Windows symlink creation needs privileges, so the alias becomes a regular
|
|
||||||
// file copy of the target: consumers read the same content at link_path.
|
|
||||||
std::error_code target_ec;
|
|
||||||
if (!std::filesystem::is_regular_file(target, target_ec)) {
|
|
||||||
return std::unexpected{Void::System::make_system_error(
|
|
||||||
Void::System::SystemErrorCode::unsupported,
|
|
||||||
std::format("atomic_swap_symlink: cannot alias '{}' to '{}' on Windows",
|
|
||||||
link_path.string(), target.string()))};
|
|
||||||
}
|
|
||||||
const auto bytes = Void::FileSystem::read_file(target);
|
|
||||||
if (!bytes) {
|
|
||||||
return std::unexpected{std::move(bytes.error())};
|
|
||||||
}
|
|
||||||
return atomic_write_bytes(link_path, std::as_bytes(std::span<const char>{*bytes}),
|
|
||||||
/*durable_sync=*/true);
|
|
||||||
#else
|
|
||||||
return Void::FileSystem::atomic_symlink_swap(link_path, target,
|
return Void::FileSystem::atomic_symlink_swap(link_path, target,
|
||||||
Void::FileSystem::ReplaceDurability::durable_sync);
|
Void::FileSystem::ReplaceDurability::durable_sync);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool path_is_within(const std::filesystem::path &root, const std::filesystem::path &path) {
|
bool path_is_within(const std::filesystem::path &root, const std::filesystem::path &path) {
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ foreach(profile IN ITEMS debug release)
|
|||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
expect_json(git dependencies 0 source kind)
|
expect_json(git dependencies 0 source kind)
|
||||||
expect_json(482a3ea46b0050ec07f5063fd319e66180b4d2e4 dependencies 0 source revision)
|
expect_json(de1fdcda72ddd6ac069fba433b13f643327efa3f dependencies 0 source revision)
|
||||||
expect_json(native dependencies 0 builder)
|
expect_json(native dependencies 0 builder)
|
||||||
string(JSON option_type TYPE "${graph}" dependencies 0 options BUILD_SHARED_LIBS)
|
string(JSON option_type TYPE "${graph}" dependencies 0 options BUILD_SHARED_LIBS)
|
||||||
if(NOT option_type STREQUAL "BOOLEAN")
|
if(NOT option_type STREQUAL "BOOLEAN")
|
||||||
|
|||||||
@@ -77,6 +77,6 @@ VOID_TEST(ExampleContexts, example_records_sources_links_and_pin) {
|
|||||||
Void::Testing::expect_eq(project.targets().at(11).name, std::string{"vbs_v1_tests"});
|
Void::Testing::expect_eq(project.targets().at(11).name, std::string{"vbs_v1_tests"});
|
||||||
Void::Testing::expect_eq(project.targets().at(12).name, std::string{"vbs_selfhost_tests"});
|
Void::Testing::expect_eq(project.targets().at(12).name, std::string{"vbs_selfhost_tests"});
|
||||||
Void::Testing::expect_eq(project.dependencies().at(0).revision,
|
Void::Testing::expect_eq(project.dependencies().at(0).revision,
|
||||||
std::string{"482a3ea46b0050ec07f5063fd319e66180b4d2e4"});
|
std::string{"de1fdcda72ddd6ac069fba433b13f643327efa3f"});
|
||||||
Void::Testing::expect_eq(project.dependencies().at(0).builder, std::string{"native"});
|
Void::Testing::expect_eq(project.dependencies().at(0).builder, std::string{"native"});
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user