The Swift Package Index logo.Swift Package Index

Has it really been five years since Swift Package Index launched? Read our anniversary blog post!

Build Information

Failed to build swift-fileio, reference main (974398), with Swift 6.1 for Wasm on 15 Jun 2025 18:03:44 UTC.

Build Command

bash -c docker run --pull=always --rm -v "checkouts-4606859-0":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:wasm-6.1-latest swift build --swift-sdk wasm32-unknown-wasi 2>&1

Build Log

========================================
RunAll
========================================
Builder version: 4.63.1
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/p-x9/swift-fileio.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/p-x9/swift-fileio
 * branch            main       -> FETCH_HEAD
 * [new branch]      main       -> origin/main
HEAD is now at 9743989 Merge pull request #16 from p-x9/feature/precondition-fastpath
Cloned https://github.com/p-x9/swift-fileio.git
Revision (git rev-parse @):
97439890d86e707f3df49a91365d25389f5f8b6f
SUCCESS checkout https://github.com/p-x9/swift-fileio.git at main
========================================
Build
========================================
Selected platform:         wasm
Swift version:             6.1
Building package at path:  $PWD
https://github.com/p-x9/swift-fileio.git
https://github.com/p-x9/swift-fileio.git
WARNING: environment variable SUPPRESS_SWIFT_6_FLAGS is not set
{
  "dependencies" : [
  ],
  "manifest_display_name" : "swift-fileio",
  "name" : "swift-fileio",
  "path" : "/host/spi-builder-workspace",
  "platforms" : [
  ],
  "products" : [
    {
      "name" : "FileIO",
      "targets" : [
        "FileIO"
      ],
      "type" : {
        "library" : [
          "automatic"
        ]
      }
    }
  ],
  "targets" : [
    {
      "c99name" : "FileIOTests",
      "module_type" : "SwiftTarget",
      "name" : "FileIOTests",
      "path" : "Tests/FileIOTests",
      "sources" : [
        "FileIOTests.swift"
      ],
      "target_dependencies" : [
        "FileIO"
      ],
      "type" : "test"
    },
    {
      "c99name" : "FileIO",
      "module_type" : "SwiftTarget",
      "name" : "FileIO",
      "path" : "Sources/FileIO",
      "product_memberships" : [
        "FileIO"
      ],
      "sources" : [
        "FileIO.swift",
        "MemoryMappedFile.swift",
        "StreamedFile.swift"
      ],
      "type" : "library"
    }
  ],
  "tools_version" : "5.9"
}
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4606859-0":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:wasm-6.1-latest swift build --swift-sdk wasm32-unknown-wasi -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete -Xswiftc -enable-upcoming-feature -Xswiftc StrictConcurrency -Xswiftc -enable-upcoming-feature -Xswiftc DisableOutwardActorInference -Xswiftc -enable-upcoming-feature -Xswiftc GlobalActorIsolatedTypesUsability -Xswiftc -enable-upcoming-feature -Xswiftc InferSendableFromCaptures 2>&1
wasm-6.1-latest: Pulling from finestructure/spi-images
Digest: sha256:1d9b2ff10447e71c7331541368dc204699fc22b6bc9ef4efb815c3e4c1ba42e3
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:wasm-6.1-latest
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-24593BA9C3E375BF.txt
[3/6] Compiling FileIO StreamedFile.swift
error: emit-module command failed with exit code 1 (use -v to see invocation)
[4/6] Compiling FileIO FileIO.swift
[5/6] Emitting module FileIO
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:107:13: error: cannot find 'msync' in scope
105 |         data.withUnsafeBytes { buffer in
106 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
107 |             msync(ptr.advanced(by: offset), data.count, MS_SYNC)
    |             `- error: cannot find 'msync' in scope
108 |         }
109 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:107:57: error: cannot find 'MS_SYNC' in scope
105 |         data.withUnsafeBytes { buffer in
106 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
107 |             msync(ptr.advanced(by: offset), data.count, MS_SYNC)
    |                                                         `- error: cannot find 'MS_SYNC' in scope
108 |         }
109 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:113:9: error: cannot find 'msync' in scope
111 |     @inlinable @inline(__always)
112 |     public func sync() {
113 |         msync(ptr, size, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
114 |     }
115 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:113:26: error: cannot find 'MS_SYNC' in scope
111 |     @inlinable @inline(__always)
112 |     public func sync() {
113 |         msync(ptr, size, MS_SYNC)
    |                          `- error: cannot find 'MS_SYNC' in scope
114 |     }
115 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:160:13: error: cannot find 'msync' in scope
158 |         data.withUnsafeBytes { buffer in
159 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
160 |             msync(ptr.advanced(by: offset), data.count + tailSize, MS_SYNC)
    |             `- error: cannot find 'msync' in scope
161 |         }
162 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:160:68: error: cannot find 'MS_SYNC' in scope
158 |         data.withUnsafeBytes { buffer in
159 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
160 |             msync(ptr.advanced(by: offset), data.count + tailSize, MS_SYNC)
    |                                                                    `- error: cannot find 'MS_SYNC' in scope
161 |         }
162 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:215:9: error: cannot find 'msync' in scope
213 |             .assumingMemoryBound(to: T.self)
214 |             .pointee = value
215 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
216 |     }
217 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:215:49: error: cannot find 'MS_SYNC' in scope
213 |             .assumingMemoryBound(to: T.self)
214 |             .pointee = value
215 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |                                                 `- error: cannot find 'MS_SYNC' in scope
216 |     }
217 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:292:9: error: cannot find 'msync' in scope
290 |     @inlinable @inline(__always)
291 |     public func sync() {
292 |         msync(parent.ptr.advanced(by: baseOffset), size, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
293 |     }
294 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:292:58: error: cannot find 'MS_SYNC' in scope
290 |     @inlinable @inline(__always)
291 |     public func sync() {
292 |         msync(parent.ptr.advanced(by: baseOffset), size, MS_SYNC)
    |                                                          `- error: cannot find 'MS_SYNC' in scope
293 |     }
294 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:352:9: error: cannot find 'msync' in scope
350 |             .assumingMemoryBound(to: T.self)
351 |             .pointee = value
352 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
353 |     }
354 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:352:49: error: cannot find 'MS_SYNC' in scope
350 |             .assumingMemoryBound(to: T.self)
351 |             .pointee = value
352 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |                                                 `- error: cannot find 'MS_SYNC' in scope
353 |     }
354 | }
[6/6] Compiling FileIO MemoryMappedFile.swift
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:69:27: error: cannot find 'PROT_READ' in scope
 67 |         }
 68 |
 69 |         var prot: Int32 = PROT_READ
    |                           `- error: cannot find 'PROT_READ' in scope
 70 |         if isWritable { prot |= PROT_WRITE }
 71 |         let ptr = mmap(nil, Int(fileSize), prot, MAP_SHARED, fd, 0)
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:70:33: error: cannot find 'PROT_WRITE' in scope
 68 |
 69 |         var prot: Int32 = PROT_READ
 70 |         if isWritable { prot |= PROT_WRITE }
    |                                 `- error: cannot find 'PROT_WRITE' in scope
 71 |         let ptr = mmap(nil, Int(fileSize), prot, MAP_SHARED, fd, 0)
 72 |         guard let ptr,
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:71:19: error: cannot find 'mmap' in scope
 69 |         var prot: Int32 = PROT_READ
 70 |         if isWritable { prot |= PROT_WRITE }
 71 |         let ptr = mmap(nil, Int(fileSize), prot, MAP_SHARED, fd, 0)
    |                   `- error: cannot find 'mmap' in scope
 72 |         guard let ptr,
 73 |               _fastPath(ptr != MAP_FAILED) else {
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:71:50: error: cannot find 'MAP_SHARED' in scope
 69 |         var prot: Int32 = PROT_READ
 70 |         if isWritable { prot |= PROT_WRITE }
 71 |         let ptr = mmap(nil, Int(fileSize), prot, MAP_SHARED, fd, 0)
    |                                                  `- error: cannot find 'MAP_SHARED' in scope
 72 |         guard let ptr,
 73 |               _fastPath(ptr != MAP_FAILED) else {
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:71:24: error: 'nil' requires a contextual type
 69 |         var prot: Int32 = PROT_READ
 70 |         if isWritable { prot |= PROT_WRITE }
 71 |         let ptr = mmap(nil, Int(fileSize), prot, MAP_SHARED, fd, 0)
    |                        `- error: 'nil' requires a contextual type
 72 |         guard let ptr,
 73 |               _fastPath(ptr != MAP_FAILED) else {
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:107:13: error: cannot find 'msync' in scope
105 |         data.withUnsafeBytes { buffer in
106 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
107 |             msync(ptr.advanced(by: offset), data.count, MS_SYNC)
    |             `- error: cannot find 'msync' in scope
108 |         }
109 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:107:57: error: cannot find 'MS_SYNC' in scope
105 |         data.withUnsafeBytes { buffer in
106 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
107 |             msync(ptr.advanced(by: offset), data.count, MS_SYNC)
    |                                                         `- error: cannot find 'MS_SYNC' in scope
108 |         }
109 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:113:9: error: cannot find 'msync' in scope
111 |     @inlinable @inline(__always)
112 |     public func sync() {
113 |         msync(ptr, size, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
114 |     }
115 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:113:26: error: cannot find 'MS_SYNC' in scope
111 |     @inlinable @inline(__always)
112 |     public func sync() {
113 |         msync(ptr, size, MS_SYNC)
    |                          `- error: cannot find 'MS_SYNC' in scope
114 |     }
115 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:117:9: error: cannot find 'munmap' in scope
115 |
116 |     private func unmap() {
117 |         munmap(ptr, size)
    |         `- error: cannot find 'munmap' in scope
118 |     }
119 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:132:27: error: cannot find 'PROT_READ' in scope
130 |         unmap()
131 |
132 |         var prot: Int32 = PROT_READ
    |                           `- error: cannot find 'PROT_READ' in scope
133 |         if isWritable { prot |= PROT_WRITE }
134 |         let ptr = mmap(nil, newSize, prot, MAP_SHARED, fileDescriptor, 0)
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:133:33: error: cannot find 'PROT_WRITE' in scope
131 |
132 |         var prot: Int32 = PROT_READ
133 |         if isWritable { prot |= PROT_WRITE }
    |                                 `- error: cannot find 'PROT_WRITE' in scope
134 |         let ptr = mmap(nil, newSize, prot, MAP_SHARED, fileDescriptor, 0)
135 |         guard let ptr,
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:134:19: error: cannot find 'mmap' in scope
132 |         var prot: Int32 = PROT_READ
133 |         if isWritable { prot |= PROT_WRITE }
134 |         let ptr = mmap(nil, newSize, prot, MAP_SHARED, fileDescriptor, 0)
    |                   `- error: cannot find 'mmap' in scope
135 |         guard let ptr,
136 |               ptr != MAP_FAILED else {
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:134:44: error: cannot find 'MAP_SHARED' in scope
132 |         var prot: Int32 = PROT_READ
133 |         if isWritable { prot |= PROT_WRITE }
134 |         let ptr = mmap(nil, newSize, prot, MAP_SHARED, fileDescriptor, 0)
    |                                            `- error: cannot find 'MAP_SHARED' in scope
135 |         guard let ptr,
136 |               ptr != MAP_FAILED else {
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:134:24: error: 'nil' requires a contextual type
132 |         var prot: Int32 = PROT_READ
133 |         if isWritable { prot |= PROT_WRITE }
134 |         let ptr = mmap(nil, newSize, prot, MAP_SHARED, fileDescriptor, 0)
    |                        `- error: 'nil' requires a contextual type
135 |         guard let ptr,
136 |               ptr != MAP_FAILED else {
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:160:13: error: cannot find 'msync' in scope
158 |         data.withUnsafeBytes { buffer in
159 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
160 |             msync(ptr.advanced(by: offset), data.count + tailSize, MS_SYNC)
    |             `- error: cannot find 'msync' in scope
161 |         }
162 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:160:68: error: cannot find 'MS_SYNC' in scope
158 |         data.withUnsafeBytes { buffer in
159 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
160 |             msync(ptr.advanced(by: offset), data.count + tailSize, MS_SYNC)
    |                                                                    `- error: cannot find 'MS_SYNC' in scope
161 |         }
162 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:215:9: error: cannot find 'msync' in scope
213 |             .assumingMemoryBound(to: T.self)
214 |             .pointee = value
215 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
216 |     }
217 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:215:49: error: cannot find 'MS_SYNC' in scope
213 |             .assumingMemoryBound(to: T.self)
214 |             .pointee = value
215 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |                                                 `- error: cannot find 'MS_SYNC' in scope
216 |     }
217 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:292:9: error: cannot find 'msync' in scope
290 |     @inlinable @inline(__always)
291 |     public func sync() {
292 |         msync(parent.ptr.advanced(by: baseOffset), size, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
293 |     }
294 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:292:58: error: cannot find 'MS_SYNC' in scope
290 |     @inlinable @inline(__always)
291 |     public func sync() {
292 |         msync(parent.ptr.advanced(by: baseOffset), size, MS_SYNC)
    |                                                          `- error: cannot find 'MS_SYNC' in scope
293 |     }
294 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:352:9: error: cannot find 'msync' in scope
350 |             .assumingMemoryBound(to: T.self)
351 |             .pointee = value
352 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
353 |     }
354 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:352:49: error: cannot find 'MS_SYNC' in scope
350 |             .assumingMemoryBound(to: T.self)
351 |             .pointee = value
352 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |                                                 `- error: cannot find 'MS_SYNC' in scope
353 |     }
354 | }
Running build ...
bash -c docker run --pull=always --rm -v "checkouts-4606859-0":/host -w "$PWD" registry.gitlab.com/finestructure/spi-images:wasm-6.1-latest swift build --swift-sdk wasm32-unknown-wasi 2>&1
wasm-6.1-latest: Pulling from finestructure/spi-images
Digest: sha256:1d9b2ff10447e71c7331541368dc204699fc22b6bc9ef4efb815c3e4c1ba42e3
Status: Image is up to date for registry.gitlab.com/finestructure/spi-images:wasm-6.1-latest
[0/1] Planning build
Building for debugging...
[0/1] Write swift-version-24593BA9C3E375BF.txt
error: emit-module command failed with exit code 1 (use -v to see invocation)
[2/5] Compiling FileIO FileIO.swift
[3/5] Compiling FileIO StreamedFile.swift
[4/5] Emitting module FileIO
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:107:13: error: cannot find 'msync' in scope
105 |         data.withUnsafeBytes { buffer in
106 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
107 |             msync(ptr.advanced(by: offset), data.count, MS_SYNC)
    |             `- error: cannot find 'msync' in scope
108 |         }
109 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:107:57: error: cannot find 'MS_SYNC' in scope
105 |         data.withUnsafeBytes { buffer in
106 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
107 |             msync(ptr.advanced(by: offset), data.count, MS_SYNC)
    |                                                         `- error: cannot find 'MS_SYNC' in scope
108 |         }
109 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:113:9: error: cannot find 'msync' in scope
111 |     @inlinable @inline(__always)
112 |     public func sync() {
113 |         msync(ptr, size, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
114 |     }
115 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:113:26: error: cannot find 'MS_SYNC' in scope
111 |     @inlinable @inline(__always)
112 |     public func sync() {
113 |         msync(ptr, size, MS_SYNC)
    |                          `- error: cannot find 'MS_SYNC' in scope
114 |     }
115 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:160:13: error: cannot find 'msync' in scope
158 |         data.withUnsafeBytes { buffer in
159 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
160 |             msync(ptr.advanced(by: offset), data.count + tailSize, MS_SYNC)
    |             `- error: cannot find 'msync' in scope
161 |         }
162 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:160:68: error: cannot find 'MS_SYNC' in scope
158 |         data.withUnsafeBytes { buffer in
159 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
160 |             msync(ptr.advanced(by: offset), data.count + tailSize, MS_SYNC)
    |                                                                    `- error: cannot find 'MS_SYNC' in scope
161 |         }
162 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:215:9: error: cannot find 'msync' in scope
213 |             .assumingMemoryBound(to: T.self)
214 |             .pointee = value
215 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
216 |     }
217 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:215:49: error: cannot find 'MS_SYNC' in scope
213 |             .assumingMemoryBound(to: T.self)
214 |             .pointee = value
215 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |                                                 `- error: cannot find 'MS_SYNC' in scope
216 |     }
217 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:292:9: error: cannot find 'msync' in scope
290 |     @inlinable @inline(__always)
291 |     public func sync() {
292 |         msync(parent.ptr.advanced(by: baseOffset), size, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
293 |     }
294 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:292:58: error: cannot find 'MS_SYNC' in scope
290 |     @inlinable @inline(__always)
291 |     public func sync() {
292 |         msync(parent.ptr.advanced(by: baseOffset), size, MS_SYNC)
    |                                                          `- error: cannot find 'MS_SYNC' in scope
293 |     }
294 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:352:9: error: cannot find 'msync' in scope
350 |             .assumingMemoryBound(to: T.self)
351 |             .pointee = value
352 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
353 |     }
354 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:352:49: error: cannot find 'MS_SYNC' in scope
350 |             .assumingMemoryBound(to: T.self)
351 |             .pointee = value
352 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |                                                 `- error: cannot find 'MS_SYNC' in scope
353 |     }
354 | }
[5/5] Compiling FileIO MemoryMappedFile.swift
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:69:27: error: cannot find 'PROT_READ' in scope
 67 |         }
 68 |
 69 |         var prot: Int32 = PROT_READ
    |                           `- error: cannot find 'PROT_READ' in scope
 70 |         if isWritable { prot |= PROT_WRITE }
 71 |         let ptr = mmap(nil, Int(fileSize), prot, MAP_SHARED, fd, 0)
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:70:33: error: cannot find 'PROT_WRITE' in scope
 68 |
 69 |         var prot: Int32 = PROT_READ
 70 |         if isWritable { prot |= PROT_WRITE }
    |                                 `- error: cannot find 'PROT_WRITE' in scope
 71 |         let ptr = mmap(nil, Int(fileSize), prot, MAP_SHARED, fd, 0)
 72 |         guard let ptr,
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:71:19: error: cannot find 'mmap' in scope
 69 |         var prot: Int32 = PROT_READ
 70 |         if isWritable { prot |= PROT_WRITE }
 71 |         let ptr = mmap(nil, Int(fileSize), prot, MAP_SHARED, fd, 0)
    |                   `- error: cannot find 'mmap' in scope
 72 |         guard let ptr,
 73 |               _fastPath(ptr != MAP_FAILED) else {
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:71:50: error: cannot find 'MAP_SHARED' in scope
 69 |         var prot: Int32 = PROT_READ
 70 |         if isWritable { prot |= PROT_WRITE }
 71 |         let ptr = mmap(nil, Int(fileSize), prot, MAP_SHARED, fd, 0)
    |                                                  `- error: cannot find 'MAP_SHARED' in scope
 72 |         guard let ptr,
 73 |               _fastPath(ptr != MAP_FAILED) else {
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:71:24: error: 'nil' requires a contextual type
 69 |         var prot: Int32 = PROT_READ
 70 |         if isWritable { prot |= PROT_WRITE }
 71 |         let ptr = mmap(nil, Int(fileSize), prot, MAP_SHARED, fd, 0)
    |                        `- error: 'nil' requires a contextual type
 72 |         guard let ptr,
 73 |               _fastPath(ptr != MAP_FAILED) else {
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:107:13: error: cannot find 'msync' in scope
105 |         data.withUnsafeBytes { buffer in
106 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
107 |             msync(ptr.advanced(by: offset), data.count, MS_SYNC)
    |             `- error: cannot find 'msync' in scope
108 |         }
109 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:107:57: error: cannot find 'MS_SYNC' in scope
105 |         data.withUnsafeBytes { buffer in
106 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
107 |             msync(ptr.advanced(by: offset), data.count, MS_SYNC)
    |                                                         `- error: cannot find 'MS_SYNC' in scope
108 |         }
109 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:113:9: error: cannot find 'msync' in scope
111 |     @inlinable @inline(__always)
112 |     public func sync() {
113 |         msync(ptr, size, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
114 |     }
115 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:113:26: error: cannot find 'MS_SYNC' in scope
111 |     @inlinable @inline(__always)
112 |     public func sync() {
113 |         msync(ptr, size, MS_SYNC)
    |                          `- error: cannot find 'MS_SYNC' in scope
114 |     }
115 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:117:9: error: cannot find 'munmap' in scope
115 |
116 |     private func unmap() {
117 |         munmap(ptr, size)
    |         `- error: cannot find 'munmap' in scope
118 |     }
119 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:132:27: error: cannot find 'PROT_READ' in scope
130 |         unmap()
131 |
132 |         var prot: Int32 = PROT_READ
    |                           `- error: cannot find 'PROT_READ' in scope
133 |         if isWritable { prot |= PROT_WRITE }
134 |         let ptr = mmap(nil, newSize, prot, MAP_SHARED, fileDescriptor, 0)
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:133:33: error: cannot find 'PROT_WRITE' in scope
131 |
132 |         var prot: Int32 = PROT_READ
133 |         if isWritable { prot |= PROT_WRITE }
    |                                 `- error: cannot find 'PROT_WRITE' in scope
134 |         let ptr = mmap(nil, newSize, prot, MAP_SHARED, fileDescriptor, 0)
135 |         guard let ptr,
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:134:19: error: cannot find 'mmap' in scope
132 |         var prot: Int32 = PROT_READ
133 |         if isWritable { prot |= PROT_WRITE }
134 |         let ptr = mmap(nil, newSize, prot, MAP_SHARED, fileDescriptor, 0)
    |                   `- error: cannot find 'mmap' in scope
135 |         guard let ptr,
136 |               ptr != MAP_FAILED else {
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:134:44: error: cannot find 'MAP_SHARED' in scope
132 |         var prot: Int32 = PROT_READ
133 |         if isWritable { prot |= PROT_WRITE }
134 |         let ptr = mmap(nil, newSize, prot, MAP_SHARED, fileDescriptor, 0)
    |                                            `- error: cannot find 'MAP_SHARED' in scope
135 |         guard let ptr,
136 |               ptr != MAP_FAILED else {
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:134:24: error: 'nil' requires a contextual type
132 |         var prot: Int32 = PROT_READ
133 |         if isWritable { prot |= PROT_WRITE }
134 |         let ptr = mmap(nil, newSize, prot, MAP_SHARED, fileDescriptor, 0)
    |                        `- error: 'nil' requires a contextual type
135 |         guard let ptr,
136 |               ptr != MAP_FAILED else {
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:160:13: error: cannot find 'msync' in scope
158 |         data.withUnsafeBytes { buffer in
159 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
160 |             msync(ptr.advanced(by: offset), data.count + tailSize, MS_SYNC)
    |             `- error: cannot find 'msync' in scope
161 |         }
162 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:160:68: error: cannot find 'MS_SYNC' in scope
158 |         data.withUnsafeBytes { buffer in
159 |             memcpy(ptr.advanced(by: offset), buffer.baseAddress!, data.count)
160 |             msync(ptr.advanced(by: offset), data.count + tailSize, MS_SYNC)
    |                                                                    `- error: cannot find 'MS_SYNC' in scope
161 |         }
162 |     }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:215:9: error: cannot find 'msync' in scope
213 |             .assumingMemoryBound(to: T.self)
214 |             .pointee = value
215 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
216 |     }
217 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:215:49: error: cannot find 'MS_SYNC' in scope
213 |             .assumingMemoryBound(to: T.self)
214 |             .pointee = value
215 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |                                                 `- error: cannot find 'MS_SYNC' in scope
216 |     }
217 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:292:9: error: cannot find 'msync' in scope
290 |     @inlinable @inline(__always)
291 |     public func sync() {
292 |         msync(parent.ptr.advanced(by: baseOffset), size, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
293 |     }
294 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:292:58: error: cannot find 'MS_SYNC' in scope
290 |     @inlinable @inline(__always)
291 |     public func sync() {
292 |         msync(parent.ptr.advanced(by: baseOffset), size, MS_SYNC)
    |                                                          `- error: cannot find 'MS_SYNC' in scope
293 |     }
294 |
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:352:9: error: cannot find 'msync' in scope
350 |             .assumingMemoryBound(to: T.self)
351 |             .pointee = value
352 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |         `- error: cannot find 'msync' in scope
353 |     }
354 | }
/host/spi-builder-workspace/Sources/FileIO/MemoryMappedFile.swift:352:49: error: cannot find 'MS_SYNC' in scope
350 |             .assumingMemoryBound(to: T.self)
351 |             .pointee = value
352 |         msync(ptr.advanced(by: offset), length, MS_SYNC)
    |                                                 `- error: cannot find 'MS_SYNC' in scope
353 |     }
354 | }
BUILD FAILURE 6.1 wasm