GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — Freebsd support by mfechner · Pull Request #698 · voidzero-dev/vite-task Conversation
Contributor
Started to add FreeBSD support as mentioned here: voidzero-dev/vite-plus#2537
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Linux records a child's file-system accesses via a seccomp-user-notifications supervisor and macOS via Detours artifacts + an LD_PRELOAD interposer. FreeBSD has neither facility in this crate, so fspy previously could not be compiled there at all. Add a no-op backend so fspy builds on FreeBSD: the command is spawned and waited on normally, and PathAccessIterable::iter yields no entries. Callers (e.g. vp_command::run_command_with_fspy) keep working on FreeBSD — they simply observe zero path accesses, which is an honest result for a platform without tracing support. The change: - Adds src/freebsd.rs, a SpyImpl that spawns the command via into_tokio_command + tokio::task::spawn_blocking and returns an empty PathAccessIterable, mirroring the async shape of the Linux/macOS backends. - Routes os_impl to freebsd.rs under #[cfg(target_os = "freebsd")] in lib.rs, and gates the ipc and arena modules off FreeBSD. - Gates the Exec import and Command::get_exec/set_exec off FreeBSD in command.rs. - Moves fspy_shared_unix, nix, and fspy_preload_unix behind cfg(all(unix, not(target_os = "freebsd"))) in Cargo.toml, keeping them out of the FreeBSD build graph (and its fspy_nostd/fspy_client_unix subtree). bumpalo and materialized_artifact remain general dependencies since both are pure-Rust and FreeBSD-safe, and materialized_artifact is also used by the Windows backend. fspy_nostd is the no_std low-level crate that fspy, fspy_shared,
fspy_shm, fspy_ipc_str, and fspy_nostd_alloc all depend on. Its
backends were gated to Linux, macOS, and Windows only, so on FreeBSD the
whole fspy build failed to compile — every one of these crates stopped
at fspy_nostd with "OsCStr"/"Error" undefined. This is the last
compilation blocker for the FreeBSD no-op backend from the accompanying
fspy change.
FreeBSD is a BSD, so rather than duplicating a fourth syscall surface the
crate routes it onto the existing libc-based macOS backends:
- mm (mmap/munmap/mprotect), param::page_size (sysconf), and fd
(close/AT_FDCWD) are API-identical to macOS and now shared.
- fs reuses the macOS openat/unlinkat/fstat/ftruncate backend.
- error::last_os_error uses libc::__error, present on FreeBSD.
Two pieces are Darwin-specific and are handled explicitly:
- F_GETPATH is a macOS fcntl command, so fcntl_getpath and the
F_GETPATH-based getcwd are macOS-only.
- FreeBSD implements getcwd with the standard getcwd(2) call,
normalizing the empty-buffer case to Error::RANGE to match the
macOS contract (FreeBSD reports it as EINVAL).
env and io remain off FreeBSD: their only consumers
(fspy_client_unix/fspy_shared_unix/fspy_preload_unix) are already
excluded from the FreeBSD build by the fspy no-op backend, and the
macOS env implementation relies on _NSGetArgv/_NSGetEnviron, which
FreeBSD does not expose.
freebsd-git
pushed a commit
to freebsd/freebsd-ports
that referenced
this pull request
Required patches are recorded upstream: voidzero-dev/vite-plus#2537 voidzero-dev/vite-task#698 voidzero-dev/vite-plus#2552
wan9chi
requested changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for working on this! Can you try gating all the fspy* at the crate level, so that we don't have to gate items individually or implement no-op backend? For platforms where fspy is not implemented, we can require manual We should gate fspy* crates under Windows, macOS or Linux only, so that any non-supported platforms (including but not limited to freebsd) can benefit from it.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Contributor
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | ||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |