The Swift Package Index logo.Swift Package Index

Build Information

Failed to build swift-jni, reference main (90d863), with Swift 6.3 for Wasm on 19 Apr 2026 12:51:10 UTC.

Build Command

bash -c docker run --pull=always --rm -v "checkouts-4609320-3":/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:wasm-6.3-latest swift build --swift-sdk swift-6.3-RELEASE_wasm 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.70.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/skiptools/swift-jni.git
Reference: main
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
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main
HEAD is now at 90d8639 Update CI to use Swift 6.3.1
Cloned https://github.com/skiptools/swift-jni.git
Revision (git rev-parse @):
90d8639e261a8e23f2621897e3ad61ac14f81d12
SUCCESS checkout https://github.com/skiptools/swift-jni.git at main
========================================
Build
========================================
Selected platform:         wasm
Swift version:             6.3
Building package at path:  $PWD
https://github.com/skiptools/swift-jni.git
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4609320-3":/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:wasm-6.3-latest swift build --swift-sdk swift-6.3-RELEASE_wasm 2>&1
wasm-6.3-latest: Pulling from swiftpackageindex/spi-images
Digest: sha256:d69f4e7582c319245442d62a08b2d7c7fd5a0c0c69f5d2ef11d1530cd8d3329b
Status: Image is up to date for registry.gitlab.com/swiftpackageindex/spi-images:wasm-6.3-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:1479:23: error: cannot find 'dlopen' in scope
1477 |         for libname in [nil, "libnativehelper.so", "libart.so", "libdvm.so"] {
1478 |             // Windows TODO: need to use LoadLibraryW (see https://github.com/swiftlang/sourcekit-lsp/blob/main/Sources/SourceKitD/dlopen.swift)
1479 |             let lib = dlopen(libname, RTLD_NOW)
     |                       `- error: cannot find 'dlopen' in scope
1480 |             typealias JavaVMPtr = UnsafeMutablePointer<JavaVM?>
1481 |             typealias GetCreatedJavaVMs = @convention(c) (_ pvm: UnsafeMutablePointer<JavaVMPtr?>, _ count: Int32, _ num: UnsafeMutablePointer<Int32>) -> jint
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1479:39: error: cannot find 'RTLD_NOW' in scope
1477 |         for libname in [nil, "libnativehelper.so", "libart.so", "libdvm.so"] {
1478 |             // Windows TODO: need to use LoadLibraryW (see https://github.com/swiftlang/sourcekit-lsp/blob/main/Sources/SourceKitD/dlopen.swift)
1479 |             let lib = dlopen(libname, RTLD_NOW)
     |                                       `- error: cannot find 'RTLD_NOW' in scope
1480 |             typealias JavaVMPtr = UnsafeMutablePointer<JavaVM?>
1481 |             typealias GetCreatedJavaVMs = @convention(c) (_ pvm: UnsafeMutablePointer<JavaVMPtr?>, _ count: Int32, _ num: UnsafeMutablePointer<Int32>) -> jint
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1484:43: error: cannot find 'dlsym' in scope
1482 |
1483 |             // Windows TODO: need to use GetProcAddress
1484 |             guard let getCreatedJavaVMs = dlsym(lib, "JNI_GetCreatedJavaVMs").map({ unsafeBitCast($0, to: (GetCreatedJavaVMs).self) }) else {
     |                                           `- error: cannot find 'dlsym' in scope
1485 |                 continue
1486 |             }
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1519:44: error: cannot find 'dlsym' in scope
1517 |         typealias CreateJavaVM = @convention(c) (_ pvm: UnsafeMutablePointer<UnsafeMutablePointer<JavaVM?>?>?, _ penv: UnsafeMutablePointer<UnsafeMutablePointer<JNIEnv?>?>?, _ args: UnsafeMutableRawPointer) -> jint
1518 |
1519 |         guard let JNI_CreateJavaVM_dlsym = dlsym(library, "JNI_CreateJavaVM").map({ unsafeBitCast($0, to: (CreateJavaVM).self) }) else {
     |                                            `- error: cannot find 'dlsym' in scope
1520 |             throw JVMError(description: "Unable to dlsym JNI_CreateJavaVM")
1521 |         }
[5/8] Compiling SwiftJNI SwiftJNI.swift
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1479:23: error: cannot find 'dlopen' in scope
1477 |         for libname in [nil, "libnativehelper.so", "libart.so", "libdvm.so"] {
1478 |             // Windows TODO: need to use LoadLibraryW (see https://github.com/swiftlang/sourcekit-lsp/blob/main/Sources/SourceKitD/dlopen.swift)
1479 |             let lib = dlopen(libname, RTLD_NOW)
     |                       `- error: cannot find 'dlopen' in scope
1480 |             typealias JavaVMPtr = UnsafeMutablePointer<JavaVM?>
1481 |             typealias GetCreatedJavaVMs = @convention(c) (_ pvm: UnsafeMutablePointer<JavaVMPtr?>, _ count: Int32, _ num: UnsafeMutablePointer<Int32>) -> jint
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1479:39: error: cannot find 'RTLD_NOW' in scope
1477 |         for libname in [nil, "libnativehelper.so", "libart.so", "libdvm.so"] {
1478 |             // Windows TODO: need to use LoadLibraryW (see https://github.com/swiftlang/sourcekit-lsp/blob/main/Sources/SourceKitD/dlopen.swift)
1479 |             let lib = dlopen(libname, RTLD_NOW)
     |                                       `- error: cannot find 'RTLD_NOW' in scope
1480 |             typealias JavaVMPtr = UnsafeMutablePointer<JavaVM?>
1481 |             typealias GetCreatedJavaVMs = @convention(c) (_ pvm: UnsafeMutablePointer<JavaVMPtr?>, _ count: Int32, _ num: UnsafeMutablePointer<Int32>) -> jint
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1484:43: error: cannot find 'dlsym' in scope
1482 |
1483 |             // Windows TODO: need to use GetProcAddress
1484 |             guard let getCreatedJavaVMs = dlsym(lib, "JNI_GetCreatedJavaVMs").map({ unsafeBitCast($0, to: (GetCreatedJavaVMs).self) }) else {
     |                                           `- error: cannot find 'dlsym' in scope
1485 |                 continue
1486 |             }
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1519:44: error: cannot find 'dlsym' in scope
1517 |         typealias CreateJavaVM = @convention(c) (_ pvm: UnsafeMutablePointer<UnsafeMutablePointer<JavaVM?>?>?, _ penv: UnsafeMutablePointer<UnsafeMutablePointer<JNIEnv?>?>?, _ args: UnsafeMutableRawPointer) -> jint
1518 |
1519 |         guard let JNI_CreateJavaVM_dlsym = dlsym(library, "JNI_CreateJavaVM").map({ unsafeBitCast($0, to: (CreateJavaVM).self) }) else {
     |                                            `- error: cannot find 'dlsym' in scope
1520 |             throw JVMError(description: "Unable to dlsym JNI_CreateJavaVM")
1521 |         }
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1568:12: error: cannot find 'getenv' in scope
1566 |
1567 |         // if JAVA_HOME is unset, default to the Homebrew installation
1568 |         if getenv("JAVA_HOME") == nil {
     |            `- error: cannot find 'getenv' in scope
1569 |             if FileManager.default.fileExists(atPath: "/opt/homebrew/opt/java") {
1570 |                 setenv("JAVA_HOME", "/opt/homebrew/opt/java", 0) // Homebrew ARM location
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1570:17: error: cannot find 'setenv' in scope
1568 |         if getenv("JAVA_HOME") == nil {
1569 |             if FileManager.default.fileExists(atPath: "/opt/homebrew/opt/java") {
1570 |                 setenv("JAVA_HOME", "/opt/homebrew/opt/java", 0) // Homebrew ARM location
     |                 `- error: cannot find 'setenv' in scope
1571 |             } else if FileManager.default.fileExists(atPath: "/usr/local/opt/java") {
1572 |                 setenv("JAVA_HOME", "/usr/local/opt/java", 0) // Homebrew Intel location
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1572:17: error: cannot find 'setenv' in scope
1570 |                 setenv("JAVA_HOME", "/opt/homebrew/opt/java", 0) // Homebrew ARM location
1571 |             } else if FileManager.default.fileExists(atPath: "/usr/local/opt/java") {
1572 |                 setenv("JAVA_HOME", "/usr/local/opt/java", 0) // Homebrew Intel location
     |                 `- error: cannot find 'setenv' in scope
1573 |             } else {
1574 |                 throw JVMError(description: "No JAVA_HOME set, and could not locate default Java installation")
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1577:25: error: cannot find 'getenv' in scope
1575 |             }
1576 |         }
1577 |         let JAVA_HOME = getenv("JAVA_HOME")!
     |                         `- error: cannot find 'getenv' in scope
1578 |         let javaHome = URL(fileURLWithPath: String(validatingUTF8: JAVA_HOME)!)
1579 |
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1598:79: error: cannot infer key path type from context; consider explicitly specifying a root type
1596 |
1597 |         guard let lib = libs.first(where: { FileManager.default.isReadableFile(atPath: $0.path) }) else {
1598 |             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
1599 |         }
1600 |
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1602:27: error: cannot find 'dlopen' in scope
1600 |
1601 |         // TODO: on macOS, reduce signal interception debugging issues by locating libjsig.dylib and adding it to DYLD_INSERT_LIBRARIES
1602 |         guard let dylib = dlopen(lib.path, RTLD_NOW) else {
     |                           `- error: cannot find 'dlopen' in scope
1603 |             if let error = dlerror() {
1604 |                 throw JVMError(description: "dlopen error: \(String(cString: error))")
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1602:44: error: cannot find 'RTLD_NOW' in scope
1600 |
1601 |         // TODO: on macOS, reduce signal interception debugging issues by locating libjsig.dylib and adding it to DYLD_INSERT_LIBRARIES
1602 |         guard let dylib = dlopen(lib.path, RTLD_NOW) else {
     |                                            `- error: cannot find 'RTLD_NOW' in scope
1603 |             if let error = dlerror() {
1604 |                 throw JVMError(description: "dlopen error: \(String(cString: error))")
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1603:28: error: cannot find 'dlerror' in scope
1601 |         // TODO: on macOS, reduce signal interception debugging issues by locating libjsig.dylib and adding it to DYLD_INSERT_LIBRARIES
1602 |         guard let dylib = dlopen(lib.path, RTLD_NOW) else {
1603 |             if let error = dlerror() {
     |                            `- error: cannot find 'dlerror' in scope
1604 |                 throw JVMError(description: "dlopen error: \(String(cString: error))")
1605 |             } else {
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1621:27: error: cannot find 'strlen' in scope
1619 |     init(_ string: String) {
1620 |         (length, buffer) = string.withCString {
1621 |             let len = Int(strlen($0) + 1)
     |                           `- error: cannot find 'strlen' in scope
1622 |             let dst = UnsafePointer(strcpy(UnsafeMutablePointer<CChar>.allocate(capacity: len), $0))
1623 |             return (len, dst!)
/host/spi-builder-workspace/Sources/SwiftJNI/SwiftJNI.swift:1622:37: error: cannot find 'strcpy' in scope
1620 |         (length, buffer) = string.withCString {
1621 |             let len = Int(strlen($0) + 1)
1622 |             let dst = UnsafePointer(strcpy(UnsafeMutablePointer<CChar>.allocate(capacity: len), $0))
     |                                     `- error: cannot find 'strcpy' in scope
1623 |             return (len, dst!)
1624 |         }
BUILD FAILURE 6.3 wasm