Build Information
Failed to build XGrammar, reference 0.1.0 (e0f2de), with Swift 6.3 for Android on 19 Apr 2026 20:21:58 UTC.
Build Command
bash -c docker run --pull=always --rm -v "checkouts-4609320-2":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/swiftpackageindex/spi-images:android-6.3-latest swift build --swift-sdk aarch64-unknown-linux-android28 2>&1Build Log
========================================
RunAll
========================================
Builder version: 4.70.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/mattt/swift-xgrammar.git
Reference: 0.1.0
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/mattt/swift-xgrammar
* tag 0.1.0 -> FETCH_HEAD
HEAD is now at e0f2de3 Add CI workflow (#1)
Cloned https://github.com/mattt/swift-xgrammar.git
Revision (git rev-parse @):
e0f2de361aa4891dbca5113629bc90ab8e5c3888
SUCCESS checkout https://github.com/mattt/swift-xgrammar.git at 0.1.0
========================================
Build
========================================
Selected platform: android
Swift version: 6.3
Building package at path: $PWD
https://github.com/mattt/swift-xgrammar.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4609320-2":/host -w "$PWD" -e JAVA_HOME="/root/.sdkman/candidates/java/current" -e SPI_BUILD="1" -e SPI_PROCESSING="1" registry.gitlab.com/swiftpackageindex/spi-images:android-6.3-latest swift build --swift-sdk aarch64-unknown-linux-android28 2>&1
android-6.3-latest: Pulling from swiftpackageindex/spi-images
Digest: sha256:9008270ea37a55e78725e6225015adb5eff8582da520c5232bf0499f32c36dc4
Status: Image is up to date for registry.gitlab.com/swiftpackageindex/spi-images:android-6.3-latest
Building for debugging...
[0/21] Write sources
[1/21] Write swift-version--4F562202D5529B1.txt
[2/21] Compiling logging.cc
[3/21] Compiling recursion_guard.cc
[4/21] Compiling regex_converter.cc
[5/21] Compiling testing.cc
[6/21] Compiling compiled_grammar.cc
[7/21] Compiling grammar_printer.cc
[8/21] Compiling tokenizer_info.cc
[9/21] Compiling grammar_matcher.cc
[10/21] Compiling json_schema_converter.cc
[11/21] Compiling grammar_parser.cc
[12/21] Compiling structural_tag.cc
[13/21] Compiling grammar_compiler.cc
[14/21] Compiling grammar_functor.cc
[15/21] Compiling earley_parser.cc
[16/21] Compiling grammar.cc
[17/21] Compiling fsm_builder.cc
[18/21] Compiling Cxgrammar bridging.cc
[19/21] Compiling config.cc
[20/21] Compiling fsm.cc
[22/29] Compiling XGrammar Matcher.swift
[23/30] Compiling XGrammar Configuration.swift
[24/30] Compiling XGrammar Errors.swift
[25/30] Compiling XGrammar Formatting.swift
[26/30] Compiling XGrammar Grammar.swift
[27/30] Compiling XGrammar Compiler.swift
[28/30] Emitting module XGrammar
[29/30] Compiling XGrammar Bridging.swift
/host/spi-builder-workspace/Sources/XGrammar/Bridging.swift:30:32: error: cannot find 'strdup' in scope
28 | cStrings.reserveCapacity(strings.count)
29 | for string in strings {
30 | guard let duplicated = strdup(string) else {
| `- error: cannot find 'strdup' in scope
31 | for ptr in cStrings {
32 | if let p = ptr { free(UnsafeMutablePointer(mutating: p)) }
/host/spi-builder-workspace/Sources/XGrammar/Bridging.swift:32:34: error: cannot find 'free' in scope
30 | guard let duplicated = strdup(string) else {
31 | for ptr in cStrings {
32 | if let p = ptr { free(UnsafeMutablePointer(mutating: p)) }
| `- error: cannot find 'free' in scope
33 | }
34 | throw XGrammarError.runtimeError("Failed to allocate C string.")
/host/spi-builder-workspace/Sources/XGrammar/Bridging.swift:40:30: error: cannot find 'free' in scope
38 | defer {
39 | for ptr in cStrings {
40 | if let p = ptr { free(UnsafeMutablePointer(mutating: p)) }
| `- error: cannot find 'free' in scope
41 | }
42 | }
[30/30] Compiling XGrammar TokenizerInfo.swift
BUILD FAILURE 6.3 android