Stream: git-wasmtime

Topic: wasmtime / PR #14356 Simplify metadata/file-type handling...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2026 at 22:09):

alexcrichton opened PR #14356 from alexcrichton:refactor-metadata to bytecodealliance:main:

Avoid unwrapping structures into a shape only to re-wrap them later on into a WASI-defined shape. Instead remove various extension traits and shuffling of fields and instead use an enum for the definitions of Metadata and FileType which are either standard library types or rustix-based types. Accessors then delegate to the appropriate fields depending on how the data lies at rest.

The goal here is to remove layer of cognitive indirection where there's a platform-specific source of truth for the underlying data. Accessors where a specific type is requested or a particular operation is where the interpretation of the underlying data happens then.

Note that the reason that std::fs::Metadata alone isn't sufficient is that the Rust standard library doesn't bind functions like statat and there's no way to create a std::fs::Metadata externally from the standard library, hence the Unix-specific layer where metadata might be std::fs::Metadata and might be rustix::fs::Stat.

prtest:full

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.md

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2026 at 22:12):

alexcrichton edited PR #14356:

Avoid unwrapping structures into a shape only to re-wrap them later on into a WASI-defined shape. Instead remove various extension traits and shuffling of fields and instead use an enum for the definitions of Metadata and FileType which are either standard library types or rustix-based types. Accessors then delegate to the appropriate fields depending on how the data lies at rest.

The goal here is to remove layer of cognitive indirection where there's a platform-specific source of truth for the underlying data. Accessors where a specific type is requested or a particular operation is where the interpretation of the underlying data happens then.

Note that the reason that std::fs::Metadata alone isn't sufficient is that the Rust standard library doesn't bind functions like statat and there's no way to create a std::fs::Metadata externally from the standard library, hence the Unix-specific layer where metadata might be std::fs::Metadata and might be rustix::fs::Stat.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.md

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2026 at 22:27):

alexcrichton updated PR #14356.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2026 at 22:27):

alexcrichton has marked PR #14356 as ready for review.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2026 at 22:27):

alexcrichton requested dicej for a review on PR #14356.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2026 at 22:27):

alexcrichton requested wasmtime-wasi-reviewers for a review on PR #14356.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 18 2026 at 23:45):

github-actions[bot] added the label wasi on PR #14356.


Last updated: Sep 20 2026 at 18:08 UTC