Skip to content

[wasmfs] Expose wasmfs headers file for out-of-tree filesystems #24744

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

martenrichter
Copy link

This moves wasmfs header files to the public include file directory, so that it is possible to develop wasmfs file systems, out of tree.
Open points:

  • There are some prototypical classes of wasmfs, which may be beneficial for certain types of file systems. I did not include them, as I restricted the files to the bare minimum of abstract base classes.

  • It would be good if out-of-tree filesystems could detect, if the wasmfs headers are in the public include directory and may have some kind of semantic versioning scheme, if the interface changes (e.g., to use the preprocessor). Do you think a global Emscripten macro would help?

@sbc100
Copy link
Collaborator

sbc100 commented Jul 21, 2025

For versioning we already have emscripten/version.h which looks like this:

/* Automatically generated by tools/system_libs.py */                                
#define __EMSCRIPTEN_major__ 4                                                       
#define __EMSCRIPTEN_minor__ 0                                                       
#define __EMSCRIPTEN_tiny__ 12    


#pragma once

#include "file.h"
#include <emscripten/wasmfs_internal/file.h>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you leave these as-is, if the files remain in the same directory?

Copy link
Author

Choose a reason for hiding this comment

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

I will revert for headers..., but it may take until next weekend...

Copy link
Author

Choose a reason for hiding this comment

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

Ok, fixed.

@@ -15,7 +15,7 @@

#pragma once

#include "file.h"
#include <emscripten/wasmfs_internal/file.h>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would hope we could keep wasmfs_internal headers in the system/lib/wasmfs directory and then have them installed via the install_system_headers help in tools/system_libs.py. No need to relocate them in git to system/include I would hope.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, I will check, if this PR is necessary at all.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, change it as suggested,

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.

2 participants