GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Freebsd support by mfechner · Pull Request #698 · voidzero-dev/vite-task

Conversation

@mfechner

@mfechner mfechner commented Aug 24, 2026

Copy link
Copy Markdown
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.

mmatuska reacted with rocket emoji
All reactions
  • 🚀 1 reaction
mfechner added 2 commits August 24, 2026 08:36
@mfechner
feat(fspy): add FreeBSD no-op backend
8c39976
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.
@mfechner
feat(fspy_nostd): add FreeBSD backend
f606be6
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 Aug 24, 2026
@mfechner
devel/vite-plus: added vite-plus 0.2.9
c9a28d6
Required patches are recorded upstream:
voidzero-dev/vite-plus#2537
voidzero-dev/vite-task#698
voidzero-dev/vite-plus#2552
wan9chi
wan9chi requested changes Oct 6, 2026
View reviewed changes

@wan9chi wan9chi left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The 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 cache.input and cache.output.

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
@mfechner

mfechner commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

I'm not that comfortable in rust like I'm in go, but I will give it try.
It definitely will require careful review ;)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mfechner

mfechner commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

@wan9chi I have a first try here: #829

Can you please review it and let me know if more change are required?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mfechner

mfechner commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

I will close that pull request as another approach got already merged.
Thanks again!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mfechner mfechner closed this Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@wan9chi wan9chi wan9chi requested changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mfechner @wan9chi
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.