Build Information
Failed to build swift-jni, reference 0.5.1 (71385f), with Swift 6.2 for Wasm on 10 Oct 2026 07:21:28 UTC.
Build Command
bash -c docker run --pull=always --rm -v "checkouts-54344847-0":/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.2-latest swift build --swift-sdk swift-6.2-RELEASE_wasm 2>&1Build Log
========================================
RunAll
========================================
Builder version: 5.1.1
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/skiptools/swift-jni.git
Reference: 0.5.1
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/skiptools/swift-jni
* tag 0.5.1 -> FETCH_HEAD
HEAD is now at 71385f8 Merge pull request #11 from skiptools/perf/string-newstringutf
Cloned https://github.com/skiptools/swift-jni.git
Revision (git rev-parse @):
71385f88cfff14409fe105e27fcad3ebd44348d0
SUCCESS checkout https://github.com/skiptools/swift-jni.git at 0.5.1
========================================
Build
========================================
Selected platform: wasm
Swift version: 6.2
Building package at path: $PWD
https://github.com/skiptools/swift-jni.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-54344847-0":/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.2-latest swift build --swift-sdk swift-6.2-RELEASE_wasm 2>&1
wasm-6.2-latest: Pulling from saguaro1/spi-images
Digest: sha256:c092ff8dc506a2a30e6239b6992792fd4f7dfaaa46cac3b3c48d8fe35e954282
Status: Image is up to date for registry.gitlab.com/saguaro1/spi-images:wasm-6.2-latest
Building for debugging...
[0/6] Write sources
[1/6] Compiling CJNI cjni.c
[2/6] Write swift-version-24593BA9C3E375BF.txt
error: emit-module command failed with exit code 1 (use -v to see invocation)
[4/8] Emitting module SwiftJNI
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1491:23: error: cannot find 'dlopen' in scope
1489 | for libname in [nil, "libnativehelper.so", "libart.so", "libdvm.so"] {
1490 | // Windows TODO: need to use LoadLibraryW (see https://github.com/swiftlang/sourcekit-lsp/blob/main/Sources/SourceKitD/dlopen.swift)
1491 | let lib = dlopen(libname, RTLD_NOW)
| `- error: cannot find 'dlopen' in scope
1492 | typealias JavaVMPtr = UnsafeMutablePointer<JavaVM?>
1493 | typealias GetCreatedJavaVMs = @convention(c) (_ pvm: UnsafeMutablePointer<JavaVMPtr?>, _ count: Int32, _ num: UnsafeMutablePointer<Int32>) -> jint
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1491:39: error: cannot find 'RTLD_NOW' in scope
1489 | for libname in [nil, "libnativehelper.so", "libart.so", "libdvm.so"] {
1490 | // Windows TODO: need to use LoadLibraryW (see https://github.com/swiftlang/sourcekit-lsp/blob/main/Sources/SourceKitD/dlopen.swift)
1491 | let lib = dlopen(libname, RTLD_NOW)
| `- error: cannot find 'RTLD_NOW' in scope
1492 | typealias JavaVMPtr = UnsafeMutablePointer<JavaVM?>
1493 | typealias GetCreatedJavaVMs = @convention(c) (_ pvm: UnsafeMutablePointer<JavaVMPtr?>, _ count: Int32, _ num: UnsafeMutablePointer<Int32>) -> jint
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1496:43: error: cannot find 'dlsym' in scope
1494 |
1495 | // Windows TODO: need to use GetProcAddress
1496 | guard let getCreatedJavaVMs = dlsym(lib, "JNI_GetCreatedJavaVMs").map({ unsafeBitCast($0, to: (GetCreatedJavaVMs).self) }) else {
| `- error: cannot find 'dlsym' in scope
1497 | continue
1498 | }
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1531:44: error: cannot find 'dlsym' in scope
1529 | typealias CreateJavaVM = @convention(c) (_ pvm: UnsafeMutablePointer<UnsafeMutablePointer<JavaVM?>?>?, _ penv: UnsafeMutablePointer<UnsafeMutablePointer<JNIEnv?>?>?, _ args: UnsafeMutableRawPointer) -> jint
1530 |
1531 | guard let JNI_CreateJavaVM_dlsym = dlsym(library, "JNI_CreateJavaVM").map({ unsafeBitCast($0, to: (CreateJavaVM).self) }) else {
| `- error: cannot find 'dlsym' in scope
1532 | throw JVMError(description: "Unable to dlsym JNI_CreateJavaVM")
1533 | }
[5/8] Compiling SwiftJNI SwiftJNI.swift
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1398:26: warning: 'init(validatingUTF8:)' is deprecated: replaced by 'String.init(validatingCString:)' [#DeprecatedDeclaration]
1396 | }
1397 | defer { jni.ReleaseStringUTFChars(env, obj, chars) }
1398 | if let str = String(validatingUTF8: chars) {
| |- warning: 'init(validatingUTF8:)' is deprecated: replaced by 'String.init(validatingCString:)' [#DeprecatedDeclaration]
| `- note: use 'String.init(validatingCString:)' instead
1399 | return str
1400 | }
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1491:23: error: cannot find 'dlopen' in scope
1489 | for libname in [nil, "libnativehelper.so", "libart.so", "libdvm.so"] {
1490 | // Windows TODO: need to use LoadLibraryW (see https://github.com/swiftlang/sourcekit-lsp/blob/main/Sources/SourceKitD/dlopen.swift)
1491 | let lib = dlopen(libname, RTLD_NOW)
| `- error: cannot find 'dlopen' in scope
1492 | typealias JavaVMPtr = UnsafeMutablePointer<JavaVM?>
1493 | typealias GetCreatedJavaVMs = @convention(c) (_ pvm: UnsafeMutablePointer<JavaVMPtr?>, _ count: Int32, _ num: UnsafeMutablePointer<Int32>) -> jint
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1491:39: error: cannot find 'RTLD_NOW' in scope
1489 | for libname in [nil, "libnativehelper.so", "libart.so", "libdvm.so"] {
1490 | // Windows TODO: need to use LoadLibraryW (see https://github.com/swiftlang/sourcekit-lsp/blob/main/Sources/SourceKitD/dlopen.swift)
1491 | let lib = dlopen(libname, RTLD_NOW)
| `- error: cannot find 'RTLD_NOW' in scope
1492 | typealias JavaVMPtr = UnsafeMutablePointer<JavaVM?>
1493 | typealias GetCreatedJavaVMs = @convention(c) (_ pvm: UnsafeMutablePointer<JavaVMPtr?>, _ count: Int32, _ num: UnsafeMutablePointer<Int32>) -> jint
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1496:43: error: cannot find 'dlsym' in scope
1494 |
1495 | // Windows TODO: need to use GetProcAddress
1496 | guard let getCreatedJavaVMs = dlsym(lib, "JNI_GetCreatedJavaVMs").map({ unsafeBitCast($0, to: (GetCreatedJavaVMs).self) }) else {
| `- error: cannot find 'dlsym' in scope
1497 | continue
1498 | }
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1531:44: error: cannot find 'dlsym' in scope
1529 | typealias CreateJavaVM = @convention(c) (_ pvm: UnsafeMutablePointer<UnsafeMutablePointer<JavaVM?>?>?, _ penv: UnsafeMutablePointer<UnsafeMutablePointer<JNIEnv?>?>?, _ args: UnsafeMutableRawPointer) -> jint
1530 |
1531 | guard let JNI_CreateJavaVM_dlsym = dlsym(library, "JNI_CreateJavaVM").map({ unsafeBitCast($0, to: (CreateJavaVM).self) }) else {
| `- error: cannot find 'dlsym' in scope
1532 | throw JVMError(description: "Unable to dlsym JNI_CreateJavaVM")
1533 | }
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1580:12: error: cannot find 'getenv' in scope
1578 |
1579 | // if JAVA_HOME is unset, default to the Homebrew installation
1580 | if getenv("JAVA_HOME") == nil {
| `- error: cannot find 'getenv' in scope
1581 | if FileManager.default.fileExists(atPath: "/opt/homebrew/opt/java") {
1582 | setenv("JAVA_HOME", "/opt/homebrew/opt/java", 0) // Homebrew ARM location
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1582:17: error: cannot find 'setenv' in scope
1580 | if getenv("JAVA_HOME") == nil {
1581 | if FileManager.default.fileExists(atPath: "/opt/homebrew/opt/java") {
1582 | setenv("JAVA_HOME", "/opt/homebrew/opt/java", 0) // Homebrew ARM location
| `- error: cannot find 'setenv' in scope
1583 | } else if FileManager.default.fileExists(atPath: "/usr/local/opt/java") {
1584 | setenv("JAVA_HOME", "/usr/local/opt/java", 0) // Homebrew Intel location
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1584:17: error: cannot find 'setenv' in scope
1582 | setenv("JAVA_HOME", "/opt/homebrew/opt/java", 0) // Homebrew ARM location
1583 | } else if FileManager.default.fileExists(atPath: "/usr/local/opt/java") {
1584 | setenv("JAVA_HOME", "/usr/local/opt/java", 0) // Homebrew Intel location
| `- error: cannot find 'setenv' in scope
1585 | } else {
1586 | throw JVMError(description: "No JAVA_HOME set, and could not locate default Java installation")
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1589:25: error: cannot find 'getenv' in scope
1587 | }
1588 | }
1589 | let JAVA_HOME = getenv("JAVA_HOME")!
| `- error: cannot find 'getenv' in scope
1590 | let javaHome = URL(fileURLWithPath: String(validatingUTF8: JAVA_HOME)!)
1591 |
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1610:79: error: cannot infer key path type from context; consider explicitly specifying a root type
1608 |
1609 | guard let lib = libs.first(where: { FileManager.default.isReadableFile(atPath: $0.path) }) else {
1610 | throw JVMError(description: "Could not find libjvm in: \(libs.map(\.path))")
| `- error: cannot infer key path type from context; consider explicitly specifying a root type
1611 | }
1612 |
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1614:27: error: cannot find 'dlopen' in scope
1612 |
1613 | // TODO: on macOS, reduce signal interception debugging issues by locating libjsig.dylib and adding it to DYLD_INSERT_LIBRARIES
1614 | guard let dylib = dlopen(lib.path, RTLD_NOW) else {
| `- error: cannot find 'dlopen' in scope
1615 | if let error = dlerror() {
1616 | throw JVMError(description: "dlopen error: \(String(cString: error))")
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1614:44: error: cannot find 'RTLD_NOW' in scope
1612 |
1613 | // TODO: on macOS, reduce signal interception debugging issues by locating libjsig.dylib and adding it to DYLD_INSERT_LIBRARIES
1614 | guard let dylib = dlopen(lib.path, RTLD_NOW) else {
| `- error: cannot find 'RTLD_NOW' in scope
1615 | if let error = dlerror() {
1616 | throw JVMError(description: "dlopen error: \(String(cString: error))")
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1615:28: error: cannot find 'dlerror' in scope
1613 | // TODO: on macOS, reduce signal interception debugging issues by locating libjsig.dylib and adding it to DYLD_INSERT_LIBRARIES
1614 | guard let dylib = dlopen(lib.path, RTLD_NOW) else {
1615 | if let error = dlerror() {
| `- error: cannot find 'dlerror' in scope
1616 | throw JVMError(description: "dlopen error: \(String(cString: error))")
1617 | } else {
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1633:27: error: cannot find 'strlen' in scope
1631 | init(_ string: String) {
1632 | (length, buffer) = string.withCString {
1633 | let len = Int(strlen($0) + 1)
| `- error: cannot find 'strlen' in scope
1634 | let dst = UnsafePointer(strcpy(UnsafeMutablePointer<CChar>.allocate(capacity: len), $0))
1635 | return (len, dst!)
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1634:37: error: cannot find 'strcpy' in scope
1632 | (length, buffer) = string.withCString {
1633 | let len = Int(strlen($0) + 1)
1634 | let dst = UnsafePointer(strcpy(UnsafeMutablePointer<CChar>.allocate(capacity: len), $0))
| `- error: cannot find 'strcpy' in scope
1635 | return (len, dst!)
1636 | }
[#DeprecatedDeclaration]: <https://docs.swift.org/compiler/documentation/diagnostics/deprecated-declaration>
BUILD FAILURE 6.2 wasm