Skip to content

[Feature] Fuse linker #6834

@goloveychuk

Description

@goloveychuk
  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

We all want fast yarn install, and node_modules which don't eat our disk.
Pnp is pretty good solution, but it has compatibility issues: bundlers, resolvers, etc. Migration effort if pretty high.

Describe the solution you'd like

Fuse linker.
Idea consist from three elements:

  1. pnpm layout.
    I forked pnpm linker, removed hardlinks logic from it.
    I've split packages into two dirs, .store-fuse and .store-unplugged.
    Unplugged has packages which need postinstalls, they are unpacked to fs.
    Fuse has other packages, and mounted as readonly.
    If fuse linker is not supported in OS, all packages fallback to unplugged.

  2. fuse mount of .store-fuse.
    Supported os: linux (libfuse), macos 15.4 (fskit). Probably windows with wsl 2.
    For unprivileged mounts linux needs fusermount util installed.
    Macos need app installed.
    I've implemented custom fuse fs, which ended to be a bit complicated. After finished I've found out that I can generate erofs binary image instead, and reuse erofs-fuse or even erofs native mount on linux (it's supported by kernel, but needs root).

  3. fetching archives on demand from remote cache (optional)
    Fuse fs supports async fs actions, which means that we can add fetching data when its requested.

This all will make yarn install time = resolution + cache fulfil + postinstalls.

Sources: https://github.com/goloveychuk/fuse

Describe the drawbacks of your solution

Needs binaries downloaded, need support by OS, could have bugs.

Describe alternatives you've considered

pnp

@arcanis wdyt?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions