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
Can we enable LIBCXX_ENABLE_FILESYSTEM in libcxx? #125
Comments
At a quick glance, it looks like the only thing in libcxx that needs It would probably be straightforward to get the filesystem library to build if you disabled use of We could also talk about adding functionality to WASI to support a subset of |
Dan, I've done what you suggested but I then have other issues with functions referenced in "filesystem_common.h" or "operations.cpp" which are not available in WASI such as:
I'll follow the same idea as for statvfs and see where i get. Thanks for your help. :-) |
For fchmod/chmod the underlying functions were added to WASI ephemeral here: https://github.com/WebAssembly/WASI/pull/170/files. I imagine that once we make next snapshot and this migrates into wasi-sdk we can them implement fchmod and chmod. For chdir/getcwd we don't currently implement them in wasi-libc, but I don't see why we couldn't implement this purely in userspace. realpath looks a bit more tricky. We already support readlink (via __wasi_path_readlink) which might be enough get a useful implementation. |
Hi there!
I have just recompiled wasi-sdk v10 for a project I am working on and I thought I'd try to enable LIBCXX_ENABLE_FILESYSTEM for libcxx in order to have access to std::filesystem from my WASM code - the custom environment I am using is WASI-capable and works fine with C file I/O and C++ streams, but I hit a problem when trying to use std::filesystem::create_directory (or std::__fs::filesystem::create_directory as it seems to be named here).
My problem is that enabling the flag leads to an include error with a missing <sys/statvfs.h> included in "filesystem_common.h": does anyone know if it is at all possible to get std::filesystem to compile in libcxx for use in WASM?
For a bit of context, I am compiling under Ubuntu 18.04 (through WSL in Windows 10), cloned the wasi-sdk repo and used make. Everything works as expected without the flag.
Thanks a lot for your hard work!!!
The text was updated successfully, but these errors were encountered: