You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
Target: x86_64-apple-darwin18.2.0
macOS 10.14.2 (18C54)
Xcode 10.1 (10B61)
Additional Detail from JIRA
Votes
0
Component/s
Package Manager
Labels
Bug
Assignee
None
Priority
Medium
md5: e13a4e7293bbc98a8c5971676421c5c7
Issue Description:
I tried running Swift tools in Xcode build phases using swift run. Unfortunately, this fails because of concurrency issues. The database seems to get locked by the first processes and subsequent ones fail.
<unknown>:0: error: unable to attach DB: error: accessing build database ".../.build/build.db": database is locked Possibly there are two concurrent builds running in the same filesystem location.
error: terminated(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /.../.build/debug.yaml swiftgen.exe output:
Some thoughts on that:
The tools are already resolved and compiled so it is just a matter of executing them which should be possible in parallel
I wouldn't expect SPM to check for updates in case the binary already exists when executing swift run or at least have an option to turn that off — not sure if it does that right now but that might be the reason that database access is required (this option would also speed up execution I guess)
Even when the Package.swift file is not yet resolved, it would be nice if SPM would execute the calls sequentially — this would avoid the database lock issue as well as duplicate builds
What do you think?
The text was updated successfully, but these errors were encountered:
Environment
Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
Target: x86_64-apple-darwin18.2.0
macOS 10.14.2 (18C54)
Xcode 10.1 (10B61)
Additional Detail from JIRA
md5: e13a4e7293bbc98a8c5971676421c5c7
Issue Description:
I tried running Swift tools in Xcode build phases using
swift run
. Unfortunately, this fails because of concurrency issues. The database seems to get locked by the first processes and subsequent ones fail.Some thoughts on that:
The tools are already resolved and compiled so it is just a matter of executing them which should be possible in parallel
I wouldn't expect SPM to check for updates in case the binary already exists when executing
swift run
or at least have an option to turn that off — not sure if it does that right now but that might be the reason that database access is required (this option would also speed up execution I guess)Even when the
Package.swift
file is not yet resolved, it would be nice if SPM would execute the calls sequentially — this would avoid the database lock issue as well as duplicate buildsWhat do you think?
The text was updated successfully, but these errors were encountered: