Skip to content

WasmFS: NODERAWFS #19417

Open
Open

Description

@kripken

As of #19400 basic NODERAWFS support is present, but we are missing two things at least:

  1. Current support mounts the current directory as the NodeFS root. That works for just writing files to the current real directory, but you can't look up out of it (e.g. you can't read /tmp/something if you began in /usr/home/me). Mounting / instead of . as that PR does might help but it didn't just work when I tried it, but it might be a start.
  2. NODERAWFS doesn't just mount NODEFS but it also apparently forwards in a more direct manner to the underlying Node APIs. I'm not sure of the details there. @sbc100 suggested perhaps implementing NODERAWFS using a replacement syscall layer, which would work for both WasmFS and otherwise. I am not sure of how important that is, though - I'm still going through tests and have not seen a failure yet, but more remain to be tested.

Activity

  1. added this to the WasmFS feature parity milestone on May 22, 2023
  2. tlively commented on Jun 5, 2023

    @tlively
    Member

    For the first, issue, we just need to go back to mounting /, but then set the initial working directory in WasmFS to correspond to the working directory in the external node file system at startup time, rather than using the WasmFS root as the initial working directory as we normally do.

    For the second issue, I share Sam's concerns. For example, if a program expects to use NODERAWFS to communicate via the file system with other programs running on the same system, then things can go very wrong if NODERAWFS is built on top of WasmFS. That's because WasmFS caches a bunch of information (e.g. directory entries and their kinds) and assumes that it has complete control over the file system. External changes that WasmFS doesn't know about can invalidate its assumptions and lead to arbitrary bad things like UB, crashes, and incorrect reads. One option is to add options to WasmFS to make it aggressively avoid caching things, but that increases complexity and code size and isn't very scalable. For example, I doubt we will ever want to add APIs to allow backends to control mtime, ctime, and atime.

  3. sbc100 commented on Jun 5, 2023

    @sbc100
    Collaborator

    Having recently looked at this I think (2) is the best way forward. Re-writing NODERAWFS to be completely independent of both the old FS and WASMFS.

  4. sbc100 commented on Jun 5, 2023

    @sbc100
    Collaborator

    IIUC there is no need to make NODERAWFS compatible with the old FS or with WASMFS. Anyone using NODERAWFS is already opting out of the VFS completely.

  5. tlively commented on Jun 7, 2023

    @tlively
    Member

    Making NODERAWFS completely separate from WasmFS sounds good to me.

  6. kripken commented on Jun 7, 2023

    @kripken
    MemberAuthor

    Sounds good to me too. It might not be urgent at this time since we have minimal WasmFS support already, but it would be good to get to eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions