wasi-sdk icon indicating copy to clipboard operation
wasi-sdk copied to clipboard

ICU support

Open dbezhetskov opened this issue 4 years ago • 3 comments

Hi, right now wasm-sdk isn't strong enough to support ICU libs and some needs to create workarounds for that, for example https://bugzilla.mozilla.org/show_bug.cgi?id=1706949.

But iiuc wasi with atomic and threads support will support ICU libs eventually, right?

dbezhetskov avatar May 18 '21 10:05 dbezhetskov

Just to see if I understand the issue here @dbezhetskov -- right now, you can't compile the ICU libraries for the WASI target because they assume the presence of <atomic> and <thread>, right? And I guess the question is, is it the plan of WASI SDK to add support for <atomic> / <thread> even in a no-threads configuration, or do we need to get a WASI patch upstream in ICU?

wingo avatar May 18 '21 13:05 wingo

For more info on the current status of thread support see https://github.com/WebAssembly/wasi-libc/issues/209. (In fact, this issue should probably be moved to wasi-libc).

I think we probably should include a version of wasi-libc that has null and . That would allow code that expects threading and atomics at compile time to be built (even though new thread creation would then fail at runtime). I imagine code such as ICU works find in single threaded mode too. However, I would also considering filing a bug upstream in ICU suggesting they add a configuration option such as HAS_THREADS that could be disabled on platforms such as WASI.

sbc100 avatar May 18 '21 14:05 sbc100

Thanks @wingo for the clarification, right, we don't need to patch ICU sources, we just need <atomic> and <thread>. In my opinion it is better to add no-op/stub implementation of threads and atomics in WASI repo rather than adding HAS_THREADS support in ICU because right now only WASI requires no-thread build.

@sbc100 Just for your information, we already have some noop workaround for threads in mozilla for wasi https://phabricator.services.mozilla.com/D110073.

dbezhetskov avatar May 19 '21 07:05 dbezhetskov

The situation has changed since this issue was posted: now, if you want atomics support you can use the wasm32-wasi-threads target. Also, if only stubbed-out support is needed, take a look at: #22.

abrown avatar Aug 08 '23 22:08 abrown