Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wasi-libc to d03829489904d38c624f6de9983190f1e5e7c9c5 #19614

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

jedisct1
Copy link
Contributor

Most notable improvements include realpath and stubs for statvfs, chmod, etc.

Other changes are for WASI 0.2 which is going to be painful to support since 3rd party tools written in Rust may become necessary in addition to LLVM (WebAssembly/wasi-sdk#402)

@jedisct1
Copy link
Contributor Author

This also removes junk we were shipping but irrelevant to webassembly.

@lin72h
Copy link

lin72h commented Apr 12, 2024

10KLoc reduce, feel so good

@jedisct1
Copy link
Contributor Author

Added the wasi-libc libdl shim, so that tools such as py2wasm can use zig cc.

@andrewrk
Copy link
Member

andrewrk commented Jun 8, 2024

man. wasi-libc kinda sucks. how about we provide libc via zig code instead?

@jedisct1
Copy link
Contributor Author

jedisct1 commented Jun 8, 2024

wasi-libc is horrible. And it's getting worse with the wasi preview 2 bits.

But rewriting it in Zig would be a lot of work.

@alexrp
Copy link
Member

alexrp commented Jan 29, 2025

@jedisct1 I've rebased this on master locally, do you mind if I force-push to your branch? I'd like to get this in for 0.14.0.

@jedisct1
Copy link
Contributor Author

Sure, go ahead!

There's been changes in wasi-libc since that PR, but the build system has become a giant spaghetti mess.

@alexrp
Copy link
Member

alexrp commented Jan 29, 2025

Yeah, I figure this is likely to be our last wasi-libc update, what with all the Rust tooling they're apparently mixing in due to the component model stuff. #2879 is probably going to be the way forward in the long term (unless we develop our own component model tooling).

@alexrp alexrp added this to the 0.14.0 milestone Jan 29, 2025
@alexrp
Copy link
Member

alexrp commented Feb 3, 2025

@andrewrk you ok with taking this as our (probably) last wasi-libc update? (At least unless/until we develop self-hosted component model tooling.)

@alexrp alexrp requested a review from andrewrk February 3, 2025 15:04
@jedisct1
Copy link
Contributor Author

jedisct1 commented Feb 3, 2025

wasi-libc still supports wasi.0.1 (aka wasi-core, wasip1, etc). So it can still be updated; I don't think the Rust tools are required for it.

@andrewrk
Copy link
Member

andrewrk commented Feb 6, 2025

you ok with taking this as our (probably) last wasi-libc update?

Yes 👍

@alexrp alexrp merged commit 1a1389c into ziglang:master Feb 6, 2025
10 checks passed
@@ -10,13 +10,17 @@ pub const CrtFile = enum {
crt1_reactor_o,
crt1_command_o,
libc_a,
libdl_a,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this strikes me as strange... wasi doesn't support dynamic linking, so what in the world is this library?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weak void *dlopen(const char *name, int flags)
{
	error = "dlopen not implemented";
	return NULL;
}

weak void *dlsym(void *library, const char *name)
{
	error = "dlsym not implemented";
	return NULL;
}

oh.

ok, well, it won't be very difficult to implement this in zig 🙄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just another one of those "emulated" WASI libraries that do nothing so existing software can compile. For whatever reason it doesn't follow the usual naming pattern.

FWIW, these all strike me as silly and I wouldn't be opposed to removing them, but that'd probably be separate work.

@alexrp alexrp removed this from the 0.14.0 milestone Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants