Make job mail-related commands not available in wasm

WebAssembly doesn't have std::time::Instant, which is used by the
job mailbox, so this commits restricts the mailbox commands
so that they aren't available in WebAssembly targets.
This commit is contained in:
cosineblast 2025-03-22 08:52:57 -03:00
parent 481da34342
commit 37b69b8c4c
2 changed files with 16 additions and 5 deletions

View File

@ -452,11 +452,15 @@ pub fn add_shell_command_context(mut engine_state: EngineState) -> EngineState {
JobList, JobList,
JobKill, JobKill,
JobId, JobId,
Job,
};
#[cfg(not(target_family = "wasm"))]
bind_command! {
JobSend, JobSend,
JobRecv, JobRecv,
JobFlush, JobFlush,
Job, }
};
#[cfg(all(unix, feature = "os"))] #[cfg(all(unix, feature = "os"))]
bind_command! { bind_command! {

View File

@ -1,16 +1,20 @@
mod is_admin; mod is_admin;
mod job; mod job;
mod job_flush;
mod job_id; mod job_id;
mod job_kill; mod job_kill;
mod job_list; mod job_list;
mod job_recv;
mod job_send;
mod job_spawn; mod job_spawn;
#[cfg(all(unix, feature = "os"))] #[cfg(all(unix, feature = "os"))]
mod job_unfreeze; mod job_unfreeze;
#[cfg(not(target_family = "wasm"))]
mod job_flush;
#[cfg(not(target_family = "wasm"))]
mod job_recv;
#[cfg(not(target_family = "wasm"))]
mod job_send;
pub use is_admin::IsAdmin; pub use is_admin::IsAdmin;
pub use job::Job; pub use job::Job;
pub use job_id::JobId; pub use job_id::JobId;
@ -18,8 +22,11 @@ pub use job_kill::JobKill;
pub use job_list::JobList; pub use job_list::JobList;
pub use job_spawn::JobSpawn; pub use job_spawn::JobSpawn;
#[cfg(not(target_family = "wasm"))]
pub use job_flush::JobFlush; pub use job_flush::JobFlush;
#[cfg(not(target_family = "wasm"))]
pub use job_recv::JobRecv; pub use job_recv::JobRecv;
#[cfg(not(target_family = "wasm"))]
pub use job_send::JobSend; pub use job_send::JobSend;
#[cfg(all(unix, feature = "os"))] #[cfg(all(unix, feature = "os"))]