abrown opened issue #5643:
In https://github.com/bytecodealliance/wasmtime/pull/5326, we discussed extensively how to resolve the build errors related to
fd_fdstat_set_flags, awasi-commonfunction. When attempting to apply locking towasi-commonto enable multi-threaded access, this function was the sole remaining issue preventing the implementation ofWasiSnapshotPreview1from using&self(what we wanted to switch to) instead of the current&mut self. Iffd_fdstat_set_flagscould take&selfinstead, this would result in a variety of benefits:
- there would be no need to wrap
WasiCtx(and friends) in an inner structure containing anArc; theArccould be applied to the top-levelHoststructure instead- all of
WasiSnapshotPreview1could be implemented in terms of&selfinstead of&mut self- several supporting
derive(Clone)and mutating functions could go awayAt some point I had heard of discussions to modify this API; if and when that happens, the above improvements could be made.
alexcrichton labeled issue #5643:
In https://github.com/bytecodealliance/wasmtime/pull/5326, we discussed extensively how to resolve the build errors related to
fd_fdstat_set_flags, awasi-commonfunction. When attempting to apply locking towasi-commonto enable multi-threaded access, this function was the sole remaining issue preventing the implementation ofWasiSnapshotPreview1from using&self(what we wanted to switch to) instead of the current&mut self. Iffd_fdstat_set_flagscould take&selfinstead, this would result in a variety of benefits:
- there would be no need to wrap
WasiCtx(and friends) in an inner structure containing anArc; theArccould be applied to the top-levelHoststructure instead- all of
WasiSnapshotPreview1could be implemented in terms of&selfinstead of&mut self- several supporting
derive(Clone)and mutating functions could go awayAt some point I had heard of discussions to modify this API; if and when that happens, the above improvements could be made.
Last updated: Dec 06 2025 at 06:05 UTC