Skip to content

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

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-wasm32-bit and 64-bit WebAssemblyenhancementSolving this issue will likely involve adding new logic or components to the codebase.libcIssues related to libzigc and Zig's vendored libc code.os-wasiWebAssembly System Interface

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions