Build Information
Failed to build xgrammar, reference v0.2.9 (8f9a12), with Swift 6.3 for Wasm on 10 Nov 2026 12:15:40 UTC.
Build Command
bash -c docker run --pull=always --rm -v "checkouts-54344849-2":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/saguaro1/spi-images:wasm-6.3-latest swift build --swift-sdk swift-6.3.2-RELEASE_wasm 2>&1Build Log
========================================
RunAll
========================================
Builder version: 5.1.4
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/mlc-ai/xgrammar.git
Reference: v0.2.9
Initialized empty Git repository in /host/spi-builder-workspace/.git/
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m <name>
From https://github.com/mlc-ai/xgrammar
* tag v0.2.9 -> FETCH_HEAD
HEAD is now at 8f9a127 fix: preserve forbidden bytes across counted repeat lowering (#949)
Submodule path '3rdparty/cpptrace': checked out '6689d14c203eed390ae7bb64f56a983cfd7dff9c'
Submodule path '3rdparty/dlpack': checked out 'bbd2f4d32427e548797929af08cfe2a9cbb3cf12'
Submodule path '3rdparty/googletest': checked out 'df1544bcee0c7ce35cd5ea0b3eb8cc81855a4140'
Submodule '3rdparty/cpptrace' (https://github.com/jeremy-rifkin/cpptrace.git) registered for path '3rdparty/cpptrace'
Submodule '3rdparty/dlpack' (https://github.com/dmlc/dlpack.git) registered for path '3rdparty/dlpack'
Submodule '3rdparty/googletest' (https://github.com/google/googletest.git) registered for path '3rdparty/googletest'
Cloning into '/host/spi-builder-workspace/3rdparty/cpptrace'...
Cloning into '/host/spi-builder-workspace/3rdparty/dlpack'...
Cloning into '/host/spi-builder-workspace/3rdparty/googletest'...
Cloned https://github.com/mlc-ai/xgrammar.git
Revision (git rev-parse @):
8f9a1279fdbed47739bd75b4099d1d059a1ce3e0
SUCCESS checkout https://github.com/mlc-ai/xgrammar.git at v0.2.9
========================================
Build
========================================
Selected platform: wasm
Swift version: 6.3
Building package at path: $PWD
https://github.com/mlc-ai/xgrammar.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-54344849-2":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/saguaro1/spi-images:wasm-6.3-latest swift build --swift-sdk swift-6.3.2-RELEASE_wasm 2>&1
wasm-6.3-latest: Pulling from saguaro1/spi-images
Digest: sha256:3045625b85c7b3a40ef7c4e596cfe3f6119a575d9bb01341bbf4a893a5aa001c
Status: Image is up to date for registry.gitlab.com/saguaro1/spi-images:wasm-6.3-latest
Building for debugging...
[0/29] Compiling minimax.cc
[1/29] Compiling grammar_builder.cc
[2/29] Compiling deepseek.cc
In file included from /host/spi-builder-workspace/cpp/grammar_compiler.cc:22:
/host/spi-builder-workspace/cpp/compiled_grammar_impl.h:157:16: error: no type named 'mutex' in namespace 'std'
157 | mutable std::mutex adaptive_token_mask_cache_mutex;
| ~~~~~^
In file included from /host/spi-builder-workspace/cpp/grammar_compiler.cc:30:
/host/spi-builder-workspace/cpp/support/thread_pool.h:79:46: error: no template named 'shared_future' in namespace 'std'; did you mean 'shared_ptr'?
79 | auto Submit(F&& f, Args&&... args) -> std::shared_future<std::invoke_result_t<F, Args...>> {
| ~~~~~^~~~~~~~~~~~~
| shared_ptr
/root/.swiftpm/swift-sdks/swift-6.3.2-RELEASE_wasm.artifactbundle/swift-6.3.2-RELEASE_wasm/wasm32-unknown-wasip1/WASI.sdk/include/c++/v1/__memory/shared_ptr.h:307:38: note: 'shared_ptr' declared here
307 | class _LIBCPP_SHARED_PTR_TRIVIAL_ABI shared_ptr {
| ^
In file included from /host/spi-builder-workspace/cpp/grammar_compiler.cc:30:
/host/spi-builder-workspace/cpp/support/thread_pool.h:194:20: error: no member named 'thread' in namespace 'std'; did you mean 'fread'?
194 | std::vector<std::thread> workers_;
| ^~~~~~
| fread
/root/.swiftpm/swift-sdks/swift-6.3.2-RELEASE_wasm.artifactbundle/swift-6.3.2-RELEASE_wasm/wasm32-unknown-wasip1/WASI.sdk/include/c++/v1/cstdio:144:9: note: 'fread' declared here
144 | using ::fread _LIBCPP_USING_IF_EXISTS;
| ^
In file included from /host/spi-builder-workspace/cpp/grammar_compiler.cc:30:
/host/spi-builder-workspace/cpp/support/thread_pool.h:194:15: error: template argument for template type parameter must be a type
194 | std::vector<std::thread> workers_;
| ^~~~~~~~~~~
/root/.swiftpm/swift-sdks/swift-6.3.2-RELEASE_wasm.artifactbundle/swift-6.3.2-RELEASE_wasm/wasm32-unknown-wasip1/WASI.sdk/include/c++/v1/__vector/vector.h:87:17: note: template parameter is declared here
87 | template <class _Tp, class _Allocator /* = allocator<_Tp> */>
| ^
In file included from /host/spi-builder-workspace/cpp/grammar_compiler.cc:30:
/host/spi-builder-workspace/cpp/support/thread_pool.h:198:8: error: no type named 'mutex' in namespace 'std'
198 | std::mutex queue_mutex_;
| ~~~~~^
/host/spi-builder-workspace/cpp/support/thread_pool.h:200:8: error: no type named 'condition_variable' in namespace 'std'
200 | std::condition_variable queue_condition_;
| ~~~~~^
/host/spi-builder-workspace/cpp/support/thread_pool.h:202:8: error: no type named 'condition_variable' in namespace 'std'
202 | std::condition_variable tasks_done_condition_;
| ~~~~~^
/host/spi-builder-workspace/cpp/support/thread_pool.h:37:40: error: no member named 'thread' in namespace 'std'
37 | ThreadPool(size_t num_threads = std::thread::hardware_concurrency()) {
| ~~~~~^
/host/spi-builder-workspace/cpp/support/thread_pool.h:45:35: error: no member named 'mutex' in namespace 'std'
45 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:58:35: error: no member named 'mutex' in namespace 'std'
58 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:83:39: error: no member named 'packaged_task' in namespace 'std'
83 | auto task = std::make_shared<std::packaged_task<return_type()>>(
| ^~~~~~~~~~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:87:10: error: no template named 'shared_future' in namespace 'std'; did you mean 'shared_ptr'?
87 | std::shared_future<return_type> res = task->get_future().share();
| ~~~~~^~~~~~~~~~~~~
| shared_ptr
/root/.swiftpm/swift-sdks/swift-6.3.2-RELEASE_wasm.artifactbundle/swift-6.3.2-RELEASE_wasm/wasm32-unknown-wasip1/WASI.sdk/include/c++/v1/__memory/shared_ptr.h:307:38: note: 'shared_ptr' declared here
307 | class _LIBCPP_SHARED_PTR_TRIVIAL_ABI shared_ptr {
| ^
In file included from /host/spi-builder-workspace/cpp/grammar_compiler.cc:30:
/host/spi-builder-workspace/cpp/support/thread_pool.h:90:29: error: no member named 'mutex' in namespace 'std'
90 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:112:29: error: no member named 'mutex' in namespace 'std'
112 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:129:29: error: no member named 'mutex' in namespace 'std'
129 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:163:29: error: no member named 'mutex' in namespace 'std'
163 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:169:15: error: no type named 'thread' in namespace 'std'
169 | for (std::thread& worker : workers_) {
| ~~~~~^
/host/spi-builder-workspace/cpp/support/thread_pool.h:177:29: error: no member named 'mutex' in namespace 'std'
177 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:186:27: error: no member named 'mutex' in namespace 'std'
186 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
[3/29] Compiling grammar_compiler.cc
[3/29] Compiling testing.cc
[3/29] Compiling recursion_guard.cc
[3/29] Compiling cohere.cc
[3/29] Compiling tokenizer_info.cc
[3/29] Compiling grammar_parser.cc
In file included from /host/spi-builder-workspace/cpp/grammar_matcher.cc:26:
/host/spi-builder-workspace/cpp/compiled_grammar_impl.h:157:16: error: no type named 'mutex' in namespace 'std'
157 | mutable std::mutex adaptive_token_mask_cache_mutex;
| ~~~~~^
In file included from /host/spi-builder-workspace/cpp/grammar_matcher.cc:33:
/host/spi-builder-workspace/cpp/support/thread_pool.h:79:46: error: no template named 'shared_future' in namespace 'std'; did you mean 'shared_ptr'?
79 | auto Submit(F&& f, Args&&... args) -> std::shared_future<std::invoke_result_t<F, Args...>> {
| ~~~~~^~~~~~~~~~~~~
| shared_ptr
/root/.swiftpm/swift-sdks/swift-6.3.2-RELEASE_wasm.artifactbundle/swift-6.3.2-RELEASE_wasm/wasm32-unknown-wasip1/WASI.sdk/include/c++/v1/__memory/shared_ptr.h:307:38: note: 'shared_ptr' declared here
307 | class _LIBCPP_SHARED_PTR_TRIVIAL_ABI shared_ptr {
| ^
In file included from /host/spi-builder-workspace/cpp/grammar_matcher.cc:33:
/host/spi-builder-workspace/cpp/support/thread_pool.h:194:20: error: no member named 'thread' in namespace 'std'; did you mean 'fread'?
194 | std::vector<std::thread> workers_;
| ^~~~~~
| fread
/root/.swiftpm/swift-sdks/swift-6.3.2-RELEASE_wasm.artifactbundle/swift-6.3.2-RELEASE_wasm/wasm32-unknown-wasip1/WASI.sdk/include/c++/v1/cstdio:144:9: note: 'fread' declared here
144 | using ::fread _LIBCPP_USING_IF_EXISTS;
| ^
In file included from /host/spi-builder-workspace/cpp/grammar_matcher.cc:33:
/host/spi-builder-workspace/cpp/support/thread_pool.h:194:15: error: template argument for template type parameter must be a type
194 | std::vector<std::thread> workers_;
| ^~~~~~~~~~~
/root/.swiftpm/swift-sdks/swift-6.3.2-RELEASE_wasm.artifactbundle/swift-6.3.2-RELEASE_wasm/wasm32-unknown-wasip1/WASI.sdk/include/c++/v1/__vector/vector.h:87:17: note: template parameter is declared here
87 | template <class _Tp, class _Allocator /* = allocator<_Tp> */>
| ^
In file included from /host/spi-builder-workspace/cpp/grammar_matcher.cc:33:
/host/spi-builder-workspace/cpp/support/thread_pool.h:198:8: error: no type named 'mutex' in namespace 'std'
198 | std::mutex queue_mutex_;
| ~~~~~^
/host/spi-builder-workspace/cpp/support/thread_pool.h:200:8: error: no type named 'condition_variable' in namespace 'std'
200 | std::condition_variable queue_condition_;
| ~~~~~^
/host/spi-builder-workspace/cpp/support/thread_pool.h:202:8: error: no type named 'condition_variable' in namespace 'std'
202 | std::condition_variable tasks_done_condition_;
| ~~~~~^
/host/spi-builder-workspace/cpp/support/thread_pool.h:37:40: error: no member named 'thread' in namespace 'std'
37 | ThreadPool(size_t num_threads = std::thread::hardware_concurrency()) {
| ~~~~~^
/host/spi-builder-workspace/cpp/support/thread_pool.h:45:35: error: no member named 'mutex' in namespace 'std'
45 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:58:35: error: no member named 'mutex' in namespace 'std'
58 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:83:39: error: no member named 'packaged_task' in namespace 'std'
83 | auto task = std::make_shared<std::packaged_task<return_type()>>(
| ^~~~~~~~~~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:87:10: error: no template named 'shared_future' in namespace 'std'; did you mean 'shared_ptr'?
87 | std::shared_future<return_type> res = task->get_future().share();
| ~~~~~^~~~~~~~~~~~~
| shared_ptr
/root/.swiftpm/swift-sdks/swift-6.3.2-RELEASE_wasm.artifactbundle/swift-6.3.2-RELEASE_wasm/wasm32-unknown-wasip1/WASI.sdk/include/c++/v1/__memory/shared_ptr.h:307:38: note: 'shared_ptr' declared here
307 | class _LIBCPP_SHARED_PTR_TRIVIAL_ABI shared_ptr {
| ^
In file included from /host/spi-builder-workspace/cpp/grammar_matcher.cc:33:
/host/spi-builder-workspace/cpp/support/thread_pool.h:90:29: error: no member named 'mutex' in namespace 'std'
90 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:112:29: error: no member named 'mutex' in namespace 'std'
112 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:129:29: error: no member named 'mutex' in namespace 'std'
129 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:163:29: error: no member named 'mutex' in namespace 'std'
163 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:169:15: error: no type named 'thread' in namespace 'std'
169 | for (std::thread& worker : workers_) {
| ~~~~~^
/host/spi-builder-workspace/cpp/support/thread_pool.h:177:29: error: no member named 'mutex' in namespace 'std'
177 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
/host/spi-builder-workspace/cpp/support/thread_pool.h:186:27: error: no member named 'mutex' in namespace 'std'
186 | std::unique_lock<std::mutex> lock(queue_mutex_);
| ^~~~~
[3/29] Compiling grammar_matcher.cc
In file included from /host/spi-builder-workspace/cpp/grammar_functor.cc:6:
In file included from /host/spi-builder-workspace/cpp/grammar_functor.h:17:
/host/spi-builder-workspace/cpp/compiled_grammar_impl.h:157:16: error: no type named 'mutex' in namespace 'std'
157 | mutable std::mutex adaptive_token_mask_cache_mutex;
| ~~~~~^
/host/spi-builder-workspace/cpp/grammar_functor.cc:3876:18: error: no type named 'mutex' in namespace 'std'
3876 | mutable std::mutex mutex;
| ~~~~~^
/host/spi-builder-workspace/cpp/grammar_functor.cc:3859:23: error: no member named 'mutex' in namespace 'std'; did you mean 'Shard::mutex'?
3859 | std::lock_guard<std::mutex> lock(shard.mutex);
| ^~~~~~~~~~
| Shard::mutex
/host/spi-builder-workspace/cpp/grammar_functor.cc:3876:24: note: 'Shard::mutex' declared here
3876 | mutable std::mutex mutex;
| ^
/host/spi-builder-workspace/cpp/grammar_functor.cc:3859:28: error: invalid use of non-static data member 'mutex'
3859 | std::lock_guard<std::mutex> lock(shard.mutex);
| ~~~~~^~~~~
[3/29] Compiling grammar_functor.cc
BUILD FAILURE 6.3 wasm