Build Information
Successful build of SwiftRandom with Swift 6.0 for Linux.
Swift 6 data race errors: 1
Build Command
bash -c docker run --rm -v "checkouts-4609320-0":/host -w "$workDir" registry.gitlab.com/finestructure/spi-images:basic-6.0-latest swift build --triple x86_64-unknown-linux-gnu -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete 2>&1
Build Log
========================================
RunAll
========================================
Builder version: 4.40.0
Interrupt handler set up.
========================================
Checkout
========================================
Clone URL: https://github.com/iamjono/SwiftRandom.git
Reference: master
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/iamjono/SwiftRandom
* branch master -> FETCH_HEAD
* [new branch] master -> origin/master
HEAD is now at dc56acb adding swift 4 SPM convention
Cloned https://github.com/iamjono/SwiftRandom.git
Revision (git rev-parse @):
dc56acbbe52138b38473c79f31d06417f420ad11
SUCCESS checkout https://github.com/iamjono/SwiftRandom.git at master
========================================
Build
========================================
Selected platform: linux
Swift version: 6.0
Building package at path: $workDir
https://github.com/iamjono/SwiftRandom.git
Running build ...
bash -c docker run --rm -v "checkouts-4609320-0":/host -w "$workDir" registry.gitlab.com/finestructure/spi-images:basic-6.0-latest swift build --triple x86_64-unknown-linux-gnu -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete 2>&1
Building for debugging...
[0/2] Write sources
[1/2] Write swift-version-24593BA9C3E375BF.txt
[3/6] Compiling SwiftRandom URandom.swift
/host/spi-builder-workspace/Sources/SwiftRandom/URandom.swift:27:23: warning: static property 'sharedRandom' is not concurrency-safe because non-'Sendable' type 'any Random' may have shared mutable state; this is an error in the Swift 6 language mode
25 |
26 | /// Random singleton. Keep in mind that using this will leave the file connection open.
27 | public static let sharedRandom: Random = URandom()
| |- warning: static property 'sharedRandom' is not concurrency-safe because non-'Sendable' type 'any Random' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'sharedRandom' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
28 |
29 | /// Initialize URandom
/host/spi-builder-workspace/Sources/SwiftRandom/Random.swift:13:17: note: protocol 'Random' does not conform to the 'Sendable' protocol
11 | Random is a pluggable random number generator that depends on the OS provided.
12 | */
13 | public protocol Random {
| `- note: protocol 'Random' does not conform to the 'Sendable' protocol
14 |
15 | /// Get a byte array of random UInt8s
/host/spi-builder-workspace/Sources/SwiftRandom/URandom.swift:62:16: warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
60 | public var int16: Int16 {
61 | let bytes = read(numBytes: 2)
62 | return UnsafeMutableRawPointer(mutating: bytes).assumingMemoryBound(to: Int16.self).pointee
| | |- note: implicit argument conversion from '[Int8]' to 'UnsafeRawPointer' produces a pointer valid only for the duration of the call to 'init(mutating:)'
| | `- note: use the 'withUnsafeBytes' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
| `- warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
63 | }
64 |
/host/spi-builder-workspace/Sources/SwiftRandom/URandom.swift:73:16: warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
71 | public var int32: Int32 {
72 | let bytes = read(numBytes: 4)
73 | return UnsafeMutableRawPointer(mutating: bytes).assumingMemoryBound(to: Int32.self).pointee
| | |- note: implicit argument conversion from '[Int8]' to 'UnsafeRawPointer' produces a pointer valid only for the duration of the call to 'init(mutating:)'
| | `- note: use the 'withUnsafeBytes' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
| `- warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
74 | }
75 |
/host/spi-builder-workspace/Sources/SwiftRandom/URandom.swift:84:16: warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
82 | public var int64: Int64 {
83 | let bytes = read(numBytes: 8)
84 | return UnsafeMutableRawPointer(mutating: bytes).assumingMemoryBound(to: Int64.self).pointee
| | |- note: implicit argument conversion from '[Int8]' to 'UnsafeRawPointer' produces a pointer valid only for the duration of the call to 'init(mutating:)'
| | `- note: use the 'withUnsafeBytes' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
| `- warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
85 | }
86 |
/host/spi-builder-workspace/Sources/SwiftRandom/URandom.swift:95:16: warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
93 | public var int: Int {
94 | let bytes = read(numBytes: MemoryLayout<Int>.size)
95 | return UnsafeMutableRawPointer(mutating: bytes).assumingMemoryBound(to: Int.self).pointee
| | |- note: implicit argument conversion from '[Int8]' to 'UnsafeRawPointer' produces a pointer valid only for the duration of the call to 'init(mutating:)'
| | `- note: use the 'withUnsafeBytes' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
| `- warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
96 | }
97 |
[4/6] Emitting module SwiftRandom
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:18:5: warning: 'public' modifier is redundant for static method declared in a public extension
16 | public extension Bool {
17 | /// SwiftRandom extension
18 | public static func random() -> Bool {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
19 | return Int.random() % 2 == 0
20 | }
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:25:5: warning: 'public' modifier is redundant for static method declared in a public extension
23 | public extension Int {
24 | /// SwiftRandom extension
25 | public static func random(range: Range<Int>) -> Int {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
26 | return random(lower: range.lowerBound, range.upperBound)
27 | }
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:30:5: warning: 'public' modifier is redundant for static method declared in a public extension
28 |
29 | /// SwiftRandom extension
30 | public static func random(lower: Int = 0, _ upper: Int = 100) -> Int {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
31 | let rand = URandom()
32 | let val = abs(rand.int % Int(upper - lower + 1))
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:39:5: warning: 'public' modifier is redundant for static method declared in a public extension
37 | public extension Int32 {
38 | /// SwiftRandom extension
39 | public static func random(range: Range<Int>) -> Int32 {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
40 | return random(lower: range.lowerBound, range.upperBound)
41 | }
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:46:5: warning: 'public' modifier is redundant for static method declared in a public extension
44 | ///
45 | /// - note: Using `Int` as parameter type as we usually just want to write `Int32.random(13, 37)` and not `Int32.random(Int32(13), Int32(37))`
46 | public static func random(lower: Int = 0, _ upper: Int = 100) -> Int32 {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
47 | let rand = URandom()
48 | let val = abs(rand.int32 % Int32(upper - lower + 1))
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:55:5: warning: 'public' modifier is redundant for static method declared in a public extension
53 | public extension Double {
54 | /// SwiftRandom extension
55 | public static func random(lower: Double = 0, _ upper: Double = 100) -> Double {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
56 | let rand = URandom()
57 | return (Swift.abs(Double(rand.int32)) / 0xFFFFFFFF) * (upper - lower) + lower
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:63:5: warning: 'public' modifier is redundant for static method declared in a public extension
61 | public extension Float {
62 | /// SwiftRandom extension
63 | public static func random(lower: Float = 0, _ upper: Float = 100) -> Float {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
64 | let rand = URandom()
65 | return (Swift.abs(Float(rand.int32)) / 0xFFFFFFFF) * (upper - lower) + lower
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:71:5: warning: 'public' modifier is redundant for static method declared in a public extension
69 | public extension Date {
70 | /// SwiftRandom extension
71 | public static func randomWithinDaysBeforeToday(days: Int) -> Date {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
72 | let today = Date()
73 | let rand = URandom()
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:102:5: warning: 'public' modifier is redundant for static method declared in a public extension
100 |
101 | /// SwiftRandom extension
102 | public static func random() -> Date {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
103 | // let randomTime = TimeInterval(arc4random_uniform(UInt32.max))
104 | let rand = URandom()
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:114:5: warning: 'public' modifier is redundant for instance method declared in a public extension
112 | public extension Array {
113 | /// SwiftRandom extension
114 | public func randomItem() -> Element? {
| `- warning: 'public' modifier is redundant for instance method declared in a public extension
115 | guard self.count > 0 else {
116 | return nil
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:128:5: warning: 'public' modifier is redundant for instance method declared in a public extension
126 | public extension ArraySlice {
127 | /// SwiftRandom extension
128 | public func randomItem() -> Element? {
| `- warning: 'public' modifier is redundant for instance method declared in a public extension
129 | guard self.count > 0 else {
130 | return nil
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:140:5: warning: 'public' modifier is redundant for static method declared in a public extension
138 | public extension URL {
139 | /// SwiftRandom extension
140 | public static func random() -> URL {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
141 | let urlList = ["http://www.google.com", "http://leagueoflegends.com/", "https://github.com/", "http://stackoverflow.com/", "https://medium.com/", "http://9gag.com/", "http://imgur.com/", "https://www.youtube.com/"]
142 | return URL(string: urlList.randomItem()!)!
/host/spi-builder-workspace/Sources/SwiftRandom/URandom.swift:27:23: warning: static property 'sharedRandom' is not concurrency-safe because non-'Sendable' type 'any Random' may have shared mutable state; this is an error in the Swift 6 language mode
25 |
26 | /// Random singleton. Keep in mind that using this will leave the file connection open.
27 | public static let sharedRandom: Random = URandom()
| |- warning: static property 'sharedRandom' is not concurrency-safe because non-'Sendable' type 'any Random' may have shared mutable state; this is an error in the Swift 6 language mode
| |- note: annotate 'sharedRandom' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
28 |
29 | /// Initialize URandom
/host/spi-builder-workspace/Sources/SwiftRandom/Random.swift:13:17: note: protocol 'Random' does not conform to the 'Sendable' protocol
11 | Random is a pluggable random number generator that depends on the OS provided.
12 | */
13 | public protocol Random {
| `- note: protocol 'Random' does not conform to the 'Sendable' protocol
14 |
15 | /// Get a byte array of random UInt8s
[5/6] Compiling SwiftRandom Randoms.swift
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:18:5: warning: 'public' modifier is redundant for static method declared in a public extension
16 | public extension Bool {
17 | /// SwiftRandom extension
18 | public static func random() -> Bool {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
19 | return Int.random() % 2 == 0
20 | }
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:25:5: warning: 'public' modifier is redundant for static method declared in a public extension
23 | public extension Int {
24 | /// SwiftRandom extension
25 | public static func random(range: Range<Int>) -> Int {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
26 | return random(lower: range.lowerBound, range.upperBound)
27 | }
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:30:5: warning: 'public' modifier is redundant for static method declared in a public extension
28 |
29 | /// SwiftRandom extension
30 | public static func random(lower: Int = 0, _ upper: Int = 100) -> Int {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
31 | let rand = URandom()
32 | let val = abs(rand.int % Int(upper - lower + 1))
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:39:5: warning: 'public' modifier is redundant for static method declared in a public extension
37 | public extension Int32 {
38 | /// SwiftRandom extension
39 | public static func random(range: Range<Int>) -> Int32 {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
40 | return random(lower: range.lowerBound, range.upperBound)
41 | }
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:46:5: warning: 'public' modifier is redundant for static method declared in a public extension
44 | ///
45 | /// - note: Using `Int` as parameter type as we usually just want to write `Int32.random(13, 37)` and not `Int32.random(Int32(13), Int32(37))`
46 | public static func random(lower: Int = 0, _ upper: Int = 100) -> Int32 {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
47 | let rand = URandom()
48 | let val = abs(rand.int32 % Int32(upper - lower + 1))
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:55:5: warning: 'public' modifier is redundant for static method declared in a public extension
53 | public extension Double {
54 | /// SwiftRandom extension
55 | public static func random(lower: Double = 0, _ upper: Double = 100) -> Double {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
56 | let rand = URandom()
57 | return (Swift.abs(Double(rand.int32)) / 0xFFFFFFFF) * (upper - lower) + lower
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:63:5: warning: 'public' modifier is redundant for static method declared in a public extension
61 | public extension Float {
62 | /// SwiftRandom extension
63 | public static func random(lower: Float = 0, _ upper: Float = 100) -> Float {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
64 | let rand = URandom()
65 | return (Swift.abs(Float(rand.int32)) / 0xFFFFFFFF) * (upper - lower) + lower
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:71:5: warning: 'public' modifier is redundant for static method declared in a public extension
69 | public extension Date {
70 | /// SwiftRandom extension
71 | public static func randomWithinDaysBeforeToday(days: Int) -> Date {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
72 | let today = Date()
73 | let rand = URandom()
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:102:5: warning: 'public' modifier is redundant for static method declared in a public extension
100 |
101 | /// SwiftRandom extension
102 | public static func random() -> Date {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
103 | // let randomTime = TimeInterval(arc4random_uniform(UInt32.max))
104 | let rand = URandom()
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:114:5: warning: 'public' modifier is redundant for instance method declared in a public extension
112 | public extension Array {
113 | /// SwiftRandom extension
114 | public func randomItem() -> Element? {
| `- warning: 'public' modifier is redundant for instance method declared in a public extension
115 | guard self.count > 0 else {
116 | return nil
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:128:5: warning: 'public' modifier is redundant for instance method declared in a public extension
126 | public extension ArraySlice {
127 | /// SwiftRandom extension
128 | public func randomItem() -> Element? {
| `- warning: 'public' modifier is redundant for instance method declared in a public extension
129 | guard self.count > 0 else {
130 | return nil
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:140:5: warning: 'public' modifier is redundant for static method declared in a public extension
138 | public extension URL {
139 | /// SwiftRandom extension
140 | public static func random() -> URL {
| `- warning: 'public' modifier is redundant for static method declared in a public extension
141 | let urlList = ["http://www.google.com", "http://leagueoflegends.com/", "https://github.com/", "http://stackoverflow.com/", "https://medium.com/", "http://9gag.com/", "http://imgur.com/", "https://www.youtube.com/"]
142 | return URL(string: urlList.randomItem()!)!
/host/spi-builder-workspace/Sources/SwiftRandom/Randoms.swift:65:48: warning: '4294967295' is not exactly representable as 'Float'; it becomes '4294967296'
63 | public static func random(lower: Float = 0, _ upper: Float = 100) -> Float {
64 | let rand = URandom()
65 | return (Swift.abs(Float(rand.int32)) / 0xFFFFFFFF) * (upper - lower) + lower
| `- warning: '4294967295' is not exactly representable as 'Float'; it becomes '4294967296'
66 | }
67 | }
[6/6] Compiling SwiftRandom Random.swift
Build complete! (11.07s)
Build complete.
{
"dependencies" : [
],
"manifest_display_name" : "SwiftRandom",
"name" : "SwiftRandom",
"path" : "/host/spi-builder-workspace",
"platforms" : [
],
"products" : [
{
"name" : "SwiftRandom",
"targets" : [
"SwiftRandom"
],
"type" : {
"library" : [
"automatic"
]
}
}
],
"swift_languages_versions" : [
"4"
],
"targets" : [
{
"c99name" : "SwiftRandomTests",
"module_type" : "SwiftTarget",
"name" : "SwiftRandomTests",
"path" : "Tests/SwiftRandomTests",
"sources" : [
"SwiftRandomTests.swift"
],
"target_dependencies" : [
"SwiftRandom"
],
"type" : "test"
},
{
"c99name" : "SwiftRandom",
"module_type" : "SwiftTarget",
"name" : "SwiftRandom",
"path" : "Sources/SwiftRandom",
"product_memberships" : [
"SwiftRandom"
],
"sources" : [
"Random.swift",
"Randoms.swift",
"URandom.swift"
],
"type" : "library"
}
],
"tools_version" : "4.0"
}
Done.