New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-7957] SPM errors with time limit only on Linux #5355
Comments
Comment by Guido Marucci Blas (JIRA) Could it be that the SPM hangs here for some reason only on Linux? |
Comment by Guido Marucci Blas (JIRA) Also Why SPM uses its own Process implementation instead of the one from Foundation? |
Comment by Guido Marucci Blas (JIRA) This is super weird. I've just commented out some dependencies an run the build script again and it worked. I assume that because I didn't delete the Package.resolved file and because I'm building the project not updating dependencies that is why all the dependencies are being built, even the ones I commented out. Here is the Package.swift file from the attached project with commented out dependencies // swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "Foo",
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "Foo",
targets: ["Foo"]),
],
dependencies: [
// Dependencies
.package(url: "https://github.com/ReactiveCocoa/ReactiveSwift", from: "3.1.0"),
// .package(url: "https://github.com/vapor/http.git", from: "3.0.0"),
.package(url: "https://github.com/SlackKit/SKCore", .upToNextMinor(from: "4.1.0")),
.package(url: "https://github.com/SlackKit/SKClient", .upToNextMinor(from: "4.1.0")),
.package(url: "https://github.com/SlackKit/SKRTMAPI", .upToNextMinor(from: "4.1.0")),
// .package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "0.8.0"),
// .package(url: "https://github.com/attaswift/BigInt", from: "3.0.0"),
// .package(url: "https://github.com/timburks/SwiftyBase64", from: "1.2.0"),
// Test dependencies
.package(url: "https://github.com/typelift/SwiftCheck.git", from: "0.8.1")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "Foo",
dependencies: [
"ReactiveSwift",
"SKCore",
"SKClient",
"SKRTMAPI",
// "HTTP",
// "CryptoSwift",
// "BigInt",
// "SwiftyBase64"
]),
.testTarget(
name: "FooTests",
dependencies: ["Foo", "SwiftCheck"]),
]
) When I run the docker-build-latest.sh script I've got the following output Swift version: Swift version 4.2-dev (LLVM a38ff55b31, Clang 5272858825, Swift 1a8b66e5fc)
Target: x86_64-unknown-linux-gnu
Build path: ./.build-ubuntu/x86_64-unknown-linux/release
Build flags: --build-path ./.build-ubuntu -c release
Updating https://github.com/apple/swift-nio.git
Updating https://github.com/antitypical/Result.git
Updating https://github.com/SlackKit/SKCore
Updating https://github.com/SlackKit/SKWebAPI
Updating https://github.com/apple/swift-nio-ssl.git
Updating https://github.com/daltoniam/zlib-spm.git
Updating https://github.com/SlackKit/SKRTMAPI
Updating https://github.com/apple/swift-nio-ssl-support.git
Updating https://github.com/krzyzanowskim/CryptoSwift.git
Updating https://github.com/daltoniam/Starscream
Updating https://github.com/attaswift/BigInt
Updating https://github.com/ReactiveCocoa/ReactiveSwift
Updating https://github.com/llvm-swift/FileCheck.git
Updating https://github.com/Quick/Nimble.git
Updating https://github.com/attaswift/SipHash
Updating https://github.com/daltoniam/common-crypto-spm
Updating https://github.com/vapor/core.git
Updating https://github.com/SlackKit/SKClient
Updating https://github.com/vapor/http.git
Updating https://github.com/typelift/SwiftCheck.git
Updating https://github.com/Quick/Quick.git
Updating https://github.com/timburks/SwiftyBase64
Updating https://github.com/apple/swift-nio-zlib-support.git
Updating https://github.com/vapor/engine
Updating https://github.com/vapor/crypto.git
Updating https://github.com/vapor/tls.git
Updating https://github.com/vapor/random.git
Updating https://github.com/vapor/sockets.git
Fetching https://github.com/vapor/ctls.git
Fetching https://github.com/vapor/bits.git
Fetching https://github.com/vapor/debugging.git
Fetching https://github.com/vapor/async.git
Fetching https://github.com/vapor/cepoll.git
Completed resolution in 39.72s
Cloning https://github.com/vapor/crypto.git
Resolving https://github.com/vapor/crypto.git at 2.1.3
Cloning https://github.com/vapor/bits.git
Resolving https://github.com/vapor/bits.git at 1.1.1
Cloning https://github.com/vapor/engine
Resolving https://github.com/vapor/engine at 2.2.5
Cloning https://github.com/SlackKit/SKClient
Resolving https://github.com/SlackKit/SKClient at 4.1.0
Cloning https://github.com/SlackKit/SKCore
Resolving https://github.com/SlackKit/SKCore at 4.1.1
Cloning https://github.com/typelift/SwiftCheck.git
Resolving https://github.com/typelift/SwiftCheck.git at 0.10.0
Cloning https://github.com/vapor/core.git
Resolving https://github.com/vapor/core.git at 2.2.1
Cloning https://github.com/vapor/debugging.git
Resolving https://github.com/vapor/debugging.git at 1.1.1
Cloning https://github.com/antitypical/Result.git
Resolving https://github.com/antitypical/Result.git at 3.2.4
Cloning https://github.com/vapor/tls.git
Resolving https://github.com/vapor/tls.git at 2.1.3
Cloning https://github.com/vapor/ctls.git
Resolving https://github.com/vapor/ctls.git at 1.1.3
Cloning https://github.com/SlackKit/SKWebAPI
Resolving https://github.com/SlackKit/SKWebAPI at 4.1.3
Cloning https://github.com/vapor/random.git
Resolving https://github.com/vapor/random.git at 1.2.0
Cloning https://github.com/vapor/sockets.git
Resolving https://github.com/vapor/sockets.git at 2.2.3
Cloning https://github.com/ReactiveCocoa/ReactiveSwift
Resolving https://github.com/ReactiveCocoa/ReactiveSwift at 3.1.0
Cloning https://github.com/SlackKit/SKRTMAPI
Resolving https://github.com/SlackKit/SKRTMAPI at 4.1.2
Cloning https://github.com/Quick/Nimble.git
Resolving https://github.com/Quick/Nimble.git at 7.1.2
Cloning https://github.com/Quick/Quick.git
Resolving https://github.com/Quick/Quick.git at 1.3.0
Cloning https://github.com/llvm-swift/FileCheck.git
Resolving https://github.com/llvm-swift/FileCheck.git at 0.0.7
'CTLS' /spmbug/.build-ubuntu/checkouts/ctls.git-7442398044840813812: warning: Ignoring declared target(s) 'CTLS' in the system package
Compile Swift Module 'libc' (1 sources)
Compile Swift Module 'Result' (2 sources)
Compile Swift Module 'SKCore' (27 sources)
Compile Swift Module 'SwiftCheck' (15 sources)
Compile Swift Module 'Debugging' (1 sources)
Compile Swift Module 'Bits' (19 sources)
Compile Swift Module 'ReactiveSwift' (21 sources)
Compile CHTTP http_parser.c
Compile Swift Module 'Core' (23 sources)
Compile Swift Module 'Transport' (10 sources)
Compile Swift Module 'Random' (6 sources)
/spmbug/.build-ubuntu/checkouts/SKCore-7598271438740777133/Sources/Attachment.swift:64:86: warning: 'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value
markdownEnabledFields = (attachment?["mrkdwn_in"] as? [String]).map { Set($0.flatMap(AttachmentTextField.init)) }
^
/spmbug/.build-ubuntu/checkouts/SKCore-7598271438740777133/Sources/Attachment.swift:64:86: note: use 'compactMap(_:)' instead
markdownEnabledFields = (attachment?["mrkdwn_in"] as? [String]).map { Set($0.flatMap(AttachmentTextField.init)) }
^~~~~~~
compactMap
Compile Swift Module 'URI' (6 sources)
Compile Swift Module 'Sockets' (22 sources)
Compile Swift Module 'SKWebAPI' (3 sources)
/spmbug/.build-ubuntu/checkouts/ReactiveSwift-4578952365406083894/Sources/UnidirectionalBinding.swift:25:17: warning: redeclaration of associated type 'Error' from protocol 'SignalProducerConvertible' is better expressed as a 'where' clause on the protocol
associatedtype Error: Swift.Error
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/spmbug/.build-ubuntu/checkouts/ReactiveSwift-4578952365406083894/Sources/SignalProducer.swift:510:17: note: 'Error' declared here
associatedtype Error: Swift.Error
^
/spmbug/.build-ubuntu/checkouts/ReactiveSwift-4578952365406083894/Sources/UnidirectionalBinding.swift:25:24: warning: redundant conformance constraint 'Self.Error': 'Error'
associatedtype Error: Swift.Error
^
/spmbug/.build-ubuntu/checkouts/ReactiveSwift-4578952365406083894/Sources/UnidirectionalBinding.swift:20:32: note: conformance constraint 'Self.Error': 'Error' implied here
public protocol BindingSource: SignalProducerConvertible {
^
/spmbug/.build-ubuntu/checkouts/ReactiveSwift-4578952365406083894/Sources/Atomic.swift:199:10: warning: 'deinitialize()' is deprecated: the default argument to deinitialize(count:) has been removed, please specify the count explicitly
_lock.deinitialize()
^
/spmbug/.build-ubuntu/checkouts/ReactiveSwift-4578952365406083894/Sources/Atomic.swift:200:10: warning: 'deallocate(capacity:)' is deprecated: Swift currently only supports freeing entire heap blocks, use deallocate() instead
_lock.deallocate(capacity: 1)
^
/spmbug/.build-ubuntu/checkouts/ReactiveSwift-4578952365406083894/Sources/Atomic.swift:154:10: warning: 'deinitialize()' is deprecated: the default argument to deinitialize(count:) has been removed, please specify the count explicitly
attr.deinitialize()
^
/spmbug/.build-ubuntu/checkouts/ReactiveSwift-4578952365406083894/Sources/Atomic.swift:155:10: warning: 'deallocate(capacity:)' is deprecated: Swift currently only supports freeing entire heap blocks, use deallocate() instead
attr.deallocate(capacity: 1)
^
/spmbug/.build-ubuntu/checkouts/ReactiveSwift-4578952365406083894/Sources/Disposable.swift:162:25: warning: 'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value
self.init(disposables.flatMap { $0 })
^
/spmbug/.build-ubuntu/checkouts/ReactiveSwift-4578952365406083894/Sources/Disposable.swift:162:25: note: use 'compactMap(_:)' instead
self.init(disposables.flatMap { $0 })
^~~~~~~
compactMap
/spmbug/.build-ubuntu/checkouts/ReactiveSwift-4578952365406083894/Sources/ValidatingProperty.swift:193:21: warning: all paths through this function will call itself
public convenience init<U, E>(
^
Compile Swift Module 'SKClient' (1 sources)
/spmbug/.build-ubuntu/checkouts/sockets.git--6103919066002726700/Sources/Sockets/Address/Address.swift:124:17: warning: 'deallocate(capacity:)' is deprecated: Swift currently only supports freeing entire heap blocks, use deallocate() instead
strData.deallocate(capacity: Int(maxLen))
^
/spmbug/.build-ubuntu/checkouts/sockets.git--6103919066002726700/Sources/Sockets/Address/Address.swift:142:19: warning: 'deallocate(capacity:)' is deprecated: Swift currently only supports freeing entire heap blocks, use deallocate() instead
self._raw.deallocate(capacity: 1)
^
/spmbug/.build-ubuntu/checkouts/sockets.git--6103919066002726700/Sources/Sockets/Address/Address.swift:171:18: warning: 'deallocate(capacity:)' is deprecated: Swift currently only supports freeing entire heap blocks, use deallocate() instead
addr.deallocate(capacity: 1)
^
/spmbug/.build-ubuntu/checkouts/sockets.git--6103919066002726700/Sources/Sockets/Address/Address.swift:184:18: warning: 'deallocate(capacity:)' is deprecated: Swift currently only supports freeing entire heap blocks, use deallocate() instead
addr.deallocate(capacity: 1)
^
/spmbug/.build-ubuntu/checkouts/sockets.git--6103919066002726700/Sources/Sockets/Socket/Descriptor.swift:95:17: warning: 'deinitialize()' is deprecated: the default argument to deinitialize(count:) has been removed, please specify the count explicitly
val.deinitialize()
^
/spmbug/.build-ubuntu/checkouts/sockets.git--6103919066002726700/Sources/Sockets/Socket/Descriptor.swift:96:17: warning: 'deallocate(capacity:)' is deprecated: Swift currently only supports freeing entire heap blocks, use deallocate() instead
val.deallocate(capacity: 1)
^
/spmbug/.build-ubuntu/checkouts/sockets.git--6103919066002726700/Sources/Sockets/TCP/TCPInternetSocket.swift:106:18: warning: 'deallocate(capacity:)' is deprecated: Swift currently only supports freeing entire heap blocks, use deallocate() instead
addr.deallocate(capacity: 1)
^
/spmbug/.build-ubuntu/checkouts/sockets.git--6103919066002726700/Sources/Sockets/UDP/UDPSocket.swift:50:18: warning: 'deallocate(capacity:)' is deprecated: Swift currently only supports freeing entire heap blocks, use deallocate() instead
addr.deallocate(capacity: 1)
^
Compile Swift Module 'Crypto' (13 sources)
/spmbug/.build-ubuntu/checkouts/SwiftCheck.git--337719491866004998/Sources/SwiftCheck/WitnessedArbitrary.swift:127:22: warning: use of 'min' as reference to global function in module 'Swift' will change in future versions of Swift to reference instance method in generic struct 'Range' which comes via a conditional conformance
return Gen.pure((min(l, r) ..< max(l, r)))
^
/spmbug/.build-ubuntu/checkouts/SwiftCheck.git--337719491866004998/Sources/SwiftCheck/WitnessedArbitrary.swift:127:22: note: use 'Swift.' to continue to reference the global function
return Gen.pure((min(l, r) ..< max(l, r)))
^
Swift.
/spmbug/.build-ubuntu/checkouts/SwiftCheck.git--337719491866004998/Sources/SwiftCheck/WitnessedArbitrary.swift:127:36: warning: use of 'max' as reference to global function in module 'Swift' will change in future versions of Swift to reference instance method in generic struct 'Range' which comes via a conditional conformance
return Gen.pure((min(l, r) ..< max(l, r)))
^
/spmbug/.build-ubuntu/checkouts/SwiftCheck.git--337719491866004998/Sources/SwiftCheck/WitnessedArbitrary.swift:127:36: note: use 'Swift.' to continue to reference the global function
return Gen.pure((min(l, r) ..< max(l, r)))
^
Swift.
/spmbug/.build-ubuntu/checkouts/SwiftCheck.git--337719491866004998/Sources/SwiftCheck/WitnessedArbitrary.swift:147:56: warning: all paths through this function will call itself
public static var arbitrary : Gen<LazySequence<Base>> {
^
/spmbug/.build-ubuntu/checkouts/SwiftCheck.git--337719491866004998/Sources/SwiftCheck/WitnessedArbitrary.swift:140:58: warning: all paths through this function will call itself
public static var arbitrary : Gen<LazyCollection<Base>> {
^
Compile Swift Module 'TLS' (12 sources)
Compile Swift Module 'HTTP' (45 sources)
Compile Swift Module 'WebSockets' (14 sources)
Compile Swift Module 'SKRTMAPI' (3 sources)
Compile Swift Module 'Foo' (1 sources)
./.build-ubuntu/x86_64-unknown-linux/release/Foo Uncommenting back and running the script produces the same error. |
Comment by Guido Marucci Blas (JIRA) OK doing some binary search I found that the offender is .package(url: "https://github.com/vapor/http.git", from: "3.0.0"). Commenting out that line and building project fixes the issue (if a Package.resolved exists).
|
Comment by Guido Marucci Blas (JIRA) Another update. Commenting all dependencies out except for vapor also works. So I guess there is some conflict with all this dependencies put together. I think both vapor and other packages depend on BigInt, CryptoSwift or SwiftyBase64 and maybe there is an issue there. |
Comment by Guido Marucci Blas (JIRA) OK I think I found the real issue. One of my dependencies, SKRTMAPI also depends on Vapor but on a previous mayor version. SPM seems to fail to detect the version issue and fails. https://github.com/SlackKit/SKRTMAPI/blob/master/Package.swift#L23 |
Comment by Guido Marucci Blas (JIRA) I'm pretty sure this is not a Linux only issue. I could only reproduce it on linux because SKRTMAPI is including that dependency only on Linux. var dependency: Package.Dependency var target: Target
#if os(macOS) || os(iOS) || os(tvOS)
target = .target(name: "SKRTMAPI", dependencies: ["SKCore", "SKWebAPI", "Starscream"]) dependency = .package(url: "https://github.com/daltoniam/Starscream", .upToNextMajor(from: "3.0.0"))
#else
target = .target(name: "SKRTMAPI", dependencies: ["SKCore", "SKWebAPI", "WebSockets", "HTTP", "URI"])
dependency = .package(url: "https://github.com/vapor/engine", .upToNextMajor(from: "2.2.2"))
#endif |
There you go 🙂. Awesome job of debugging the problem! We need to improve the dependency resolver diagnostics. |
Comment by Gábor Sebestyén (JIRA) Hi, Just ran into this issue while trying to build a basic Kitura app on Arch Linux with a decent trunk version Swift Version
Issue
|
Attachment: Download
Environment
Swift version 4.1 (swift-4.1-RELEASE) on Linux
Swift version 4.2-dev (LLVM a38ff55b31, Clang 5272858825, Swift 1a8b66e5fc)
Additional Detail from JIRA
md5: 1a862aa428f1b262210da3f5b1791e38
Issue Description:
When building my project on Linux I get the following error
If I run with verbose option
I've attached a project that reproduces the issue. This project includes a docker setup to test with Swift 4.1 and Swift 4.2 on Linux. Just run the docker-build.sh or docker-build-latest.sh scripts.
The text was updated successfully, but these errors were encountered: