Repository navigation
0.2.2: Emscripten (wasm32-emscripten) - #9
Merged
Merged
Conversation
…en's C library and openkal-emscripten 0.6.0; fs::read without a 64 KiB stack array; an enquiry asks for the kind it reads absence from
… git pins are removed
Sunrisepeak
added a commit
to mcpplibs/mcpp-index
that referenced
this pull request
Oct 28, 2026
Adds mcpplibs.os 0.2.2 (mcpplibs/os#9; tag 0.2.2 on 2b46d9f): the wasm32-emscripten target over Emscripten's C library and openkal-emscripten 0.6.0; fs::read without a 64 KiB stack array; stamp_of / identity_of ask for the kind. GLOBAL is the GitHub tag archive, CN the byte-identical GitCode mcpp-res/os asset (sha256 33c5d946...4e3e). Member tests/examples/os moves to 0.2.2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #8, which GitHub closed when its base branch (#7's
os-0.2.1) was deleted after #7 was squash-merged. The same commit, cherry-picked ontomain, plus one commit that removes the temporary git pins now that openkal-emscripten 0.6.0 is in the index.mcpplibs.os had no
wasm32-emscriptentarget. A program that imports it, such as openmui's web build, stops at the first module:This adds the target over Emscripten's C library and openkal-emscripten 0.6.0 (mcpplibs/openkal-emscripten#8, merged and tagged
0.6.0, which brings it to openkal 0.17.1; in the index since mcpplibs/mcpp-index#618). Running the tests on the target also found three defects that are not specific to Emscripten.The target
platform::emscripten,architecture::wasm32andis_emscripten. They are selected bysrc/targets/emscripten.cppmandsrc/arch/wasm32.cppm.host()is a constant expression, as on a native target.[target.'cfg(os = "emscripten")'.dependencies] openkal-emscripten = "0.6.0".src/emscripten/:machine:wasm32. The processor count is the one Emscripten reports (the host's in a-pthreadlink, otherwise one), and the memory is unknown.library: not supported. A wasm module loads another only when it is linked with-sMAIN_MODULE.execreplaces no program's image, and the terminal is always in the foreground.dup/dup2, because openkal-emscripten's streams are the C library's descriptors.memfs,nodefs,idbfs, …), asked of itsFS.src/posix/fs.cpp.openkal.processthere is no stop word, soavailable()andrequested()are false andend_as_requested()does nothing. The openkal implementation moves unchanged tosrc/kal/interrupt.cpp, whichcfg(not(os = "emscripten"))selects. Before this change, a program that calledinterrupt::available()did not link on Emscripten.openkal.process, soprocess::self,run,spawnand so on fail at link, naming the openkal symbol.checks/absentasserts this in CI.process.ois linked into every program, but wasm-ld reports only undefined symbols that are reached, so a program that does not start one links.Defects found on the way (they affect every target)
fs::readoverflowed a wasm module's whole stack. It read throughchar buf[65536]on the stack, and Emscripten's default stack is 65536 bytes ("Stack overflow detected"). It now reads into the string's own storage (resize_and_overwrite), which also saves a copy.stamp_ofandidentity_ofreported existing files as not found.info()asked openkal only for the size, time or identity, then readkindto detect absence. openkal says an implementation fills only the fields that are asked for, and openkal-emscripten does exactly that, sokindstayed 0 (kal_node_absent).info()now also asks for the kind.caps()first. On a volume that has neither, they check that the request is refused withnot_supportedand changes nothing.fs_testnames its scratch directory with random bytes where no program can be named.CI
A new
emscripten (node) dev/releasejob:checks/emscripten, the package's own tests by#include) under node;checks/constantsfor the target;checks/absent.The three check projects resolve openkal-emscripten 0.6.0 from the index (the git
revpins of #8 are removed; the lock reads[email protected]).Measured locally (mcpp 2026.10.27.1, the CI's pin)
mcpp testpasses 7 of 7.checks/emscriptenpasses 5 of 5 with--profile devand with--profile release;checks/constantsbuilds for wasm;checks/absentfails at link namingkal_process_self.failed to read compiled module ... imports must be built before being imported(mcpplibs.os.error / mcpplibs.os.terminal). That is the GCC module-map defect fixed in 2026.10.27.1 (the version this repository's CI states as its minimum), not a flake of this change.Release order
openkal-emscripten#8 merged and tagged 0.6.0.donemcpp-index gains openkal-emscripten 0.6.0.done (mcpp-index#618)