Skip to content

wasi-libc updates are on hold in favor of moving implementation code to libzigc #24923

Closed

Description

@alexrp

#24889 updated our import of wasi-libc such that it's now on musl 1.2.5, matching our import of upstream musl. This allowed deleting a bit more duplicate code that I didn't in #22905.

However, we're not particularly happy with how the wasi-libc project is structured and developed. Going forward, we will not be importing new versions of wasi-libc; instead, the implementation code should be migrated to libzigc as Zig code. The goal here is that we only provide the upstream wasi-libc headers, although there may even be quite a bit of room for improvement on that front.

Here's how much implementation code we currently carry from wasi-libc:

❯ cloc lib/libc/wasi
     356 text files.
     349 unique files.
       7 files ignored.

github.com/AlDanial/cloc v 2.04  T=0.06 s (6132.7 files/s, 543509.9 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                              239           2416           2607          16678
C/C++ Header                   110           1448            253           7528
-------------------------------------------------------------------------------
SUM:                           349           3864           2860          24206
-------------------------------------------------------------------------------

However, I would note that a significant portion of this is still duplicate musl code, e.g. because a file has a small section of __wasilibc_unmodified_upstream code, or because some files are duplicated due to C preprocessor idiosyncrasies. I think once you trim the fluff, this is actually a fairly surmountable sub-project.

Related:

Activity

  1. added this to the post-1.0 milestone on Aug 20, 2025
  2. added
    enhancement
    arch-wasm
    os-wasi
    libc
    on Aug 20, 2025
  3. modified the milestones: post-1.0, 0.16.0 on Mar 17, 2026
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

    arch-wasmenhancementlibcos-wasi

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions