Skip to content
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-9651] SPM swift run fails because of database lock #4881

Open
swift-ci opened this issue Jan 12, 2019 · 0 comments
Open

[SR-9651] SPM swift run fails because of database lock #4881

swift-ci opened this issue Jan 12, 2019 · 0 comments
Labels

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-9651
Radar None
Original Reporter SimonSeyer (JIRA User)
Type Bug
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
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?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants