Brightify / Cuckoo

Boilerplate-free mocking framework for Swift!
MIT License
1.67k stars 172 forks source link

accessing build database database is locked Possibly there are two concurrent builds running in the same filesystem location. #503

Closed Brumanuel closed 2 months ago

Brumanuel commented 2 months ago

When I try to run the tests in Xcode Cloud, I get this error in the ‘Run Script’ part that I added for Cuckoo, only run on one iPhone 15, no multiple devices. Locally they work perfectly.

accessing build database "/Volumes/workspace/DerivedData/Build/Intermediates.noindex/XCBuildData/build.db": database is locked Possibly there are two concurrent builds running in the same filesystem location.

The entire Run Script trace

Showing All Messages
PhaseScriptExecution Run\ Script /Volumes/workspace/DerivedData/Build/Intermediates.noindex/sdk.build/Debug-iphonesimulator/sdkTests.build/Script-C24815DC2BB44A7A00593BAC.sh (in target 'sdkTests' from project 'sdk')
    cd /Volumes/workspace/repository/sdk
    /bin/sh -c /Volumes/workspace/DerivedData/Build/Intermediates.noindex/sdk.build/Debug-iphonesimulator/sdkTests.build/Script-C24815DC2BB44A7A00593BAC.sh

Generated Mocks File = /Volumes/workspace/repository/sdk/sdkTests/GeneratedMocks.swift
Mocks Input Directory = /Volumes/workspace/repository/sdk/sdk
Script path: /Volumes/workspace/DerivedData/SourcePackages/checkouts/Cuckoo
No Cuckoo Generator found.
/Volumes/workspace/DerivedData/SourcePackages/checkouts/Cuckoo /Volumes/workspace/repository/sdk
Building...
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build -project /Volumes/workspace/DerivedData/SourcePackages/checkouts/Cuckoo/Generator/Generator.xcodeproj -scheme Generator -configuration Release

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Resolve Package Graph

Fetching from https://github.com/kylef/PathKit.git

Fetching from https://github.com/kylef/Stencil.git

Fetching from https://github.com/kylef/Spectre.git

Fetching from https://github.com/nvzqz/FileKit.git

Fetching from https://github.com/antitypical/Result.git

Fetching from https://github.com/Carthage/Commandant.git

Fetching from https://github.com/Quick/Quick.git

Fetching from https://github.com/Quick/Nimble.git

Creating working copy of package ‘Stencil’

Checking out 0.14.2 of package ‘Stencil’

Creating working copy of package ‘Spectre’

Checking out 0.10.1 of package ‘Spectre’

Checking out 4.9.0 of package ‘SWXMLHash’

Creating working copy of package ‘Quick’

Checking out 1.3.4 of package ‘Quick’

Creating working copy of package ‘FileKit’

Checking out develop (9006d28) of package ‘FileKit’

Checking out 1.0.2 of package ‘Yams’

Creating working copy of package ‘Result’

Checking out 4.1.0 of package ‘Result’

Creating working copy of package ‘PathKit’

Checking out 1.0.1 of package ‘PathKit’

Creating working copy of package ‘Commandant’

Checking out 0.15.0 of package ‘Commandant’

Checking out 0.21.3 of package ‘SourceKitten’

Creating working copy of package ‘Nimble’

Checking out 7.3.4 of package ‘Nimble’

Resolved source packages:
  Spectre: https://github.com/kylef/Spectre.git @ 0.10.1
  SWXMLHash: https://github.com/drmohundro/SWXMLHash.git @ 4.9.0
  Stencil: https://github.com/kylef/Stencil.git @ 0.14.2
  PathKit: https://github.com/kylef/PathKit.git @ 1.0.1
  FileKit: https://github.com/nvzqz/FileKit.git @ develop (9006d28)
  Result: https://github.com/antitypical/Result.git @ 4.1.0
  Quick: https://github.com/Quick/Quick.git @ 1.3.4
  Yams: https://github.com/jpsim/Yams.git @ 1.0.2
  Commandant: https://github.com/Carthage/Commandant.git @ 0.15.0
  SourceKitten: https://github.com/jpsim/SourceKitten.git @ 0.21.3
  Nimble: https://github.com/Quick/Nimble.git @ 7.3.4

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:x86_64, id:B2ED60B6-9B51-4DED-90C6-5A298A308EDA, name:My Mac }
{ platform:macOS, name:Any Mac }
Prepare packages

ComputeTargetDependencyGraph
note: Building targets in dependency order
note: Target dependency graph (20 targets)
    Target 'CuckooGenerator' in project 'Generator'
        ➜ Explicit dependency on target 'FileKit' in project 'FileKit'
        ➜ Explicit dependency on target 'SourceKittenFramework' in project 'SourceKitten'
        ➜ Explicit dependency on target 'Stencil' in project 'Stencil'
        ➜ Explicit dependency on target 'Commandant' in project 'Commandant'
    Target 'Commandant' in project 'Commandant'
        ➜ Explicit dependency on target 'Commandant' in project 'Commandant'
        ➜ Explicit dependency on target 'Result' in project 'Result'
    Target 'Commandant' in project 'Commandant'
        ➜ Explicit dependency on target 'Result' in project 'Result'
    Target 'Result' in project 'Result'
        ➜ Explicit dependency on target 'Result' in project 'Result'
    Target 'Result' in project 'Result' (no dependencies)
    Target 'Stencil' in project 'Stencil'
        ➜ Explicit dependency on target 'Stencil' in project 'Stencil'
        ➜ Explicit dependency on target 'PathKit' in project 'PathKit'
    Target 'Stencil' in project 'Stencil'
        ➜ Explicit dependency on target 'PathKit' in project 'PathKit'
    Target 'PathKit' in project 'PathKit'
        ➜ Explicit dependency on target 'PathKit' in project 'PathKit'
    Target 'PathKit' in project 'PathKit' (no dependencies)
    Target 'SourceKittenFramework' in project 'SourceKitten'
        ➜ Explicit dependency on target 'SourceKittenFramework' in project 'SourceKitten'
        ➜ Explicit dependency on target 'Clang_C' in project 'SourceKitten'
        ➜ Explicit dependency on target 'SourceKit' in project 'SourceKitten'
        ➜ Explicit dependency on target 'SWXMLHash' in project 'SWXMLHash'
        ➜ Explicit dependency on target 'Yams' in project 'Yams'
    Target 'SourceKittenFramework' in project 'SourceKitten'
        ➜ Explicit dependency on target 'Clang_C' in project 'SourceKitten'
        ➜ Explicit dependency on target 'SourceKit' in project 'SourceKitten'
        ➜ Explicit dependency on target 'SWXMLHash' in project 'SWXMLHash'
        ➜ Explicit dependency on target 'Yams' in project 'Yams'
    Target 'Yams' in project 'Yams'
        ➜ Explicit dependency on target 'Yams' in project 'Yams'
        ➜ Explicit dependency on target 'CYaml' in project 'Yams'
    Target 'Yams' in project 'Yams'
        ➜ Explicit dependency on target 'CYaml' in project 'Yams'
    Target 'CYaml' in project 'Yams' (no dependencies)
    Target 'SWXMLHash' in project 'SWXMLHash'
        ➜ Explicit dependency on target 'SWXMLHash' in project 'SWXMLHash'
    Target 'SWXMLHash' in project 'SWXMLHash' (no dependencies)
    Target 'SourceKit' in project 'SourceKitten' (no dependencies)
    Target 'Clang_C' in project 'SourceKitten' (no dependencies)
    Target 'FileKit' in project 'FileKit'
        ➜ Explicit dependency on target 'FileKit' in project 'FileKit'
    Target 'FileKit' in project 'FileKit' (no dependencies)

GatherProvisioningInputs

CreateBuildDescription

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -x objective-c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -v

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -x c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -x c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -version_details

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -x objective-c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -x c -c /dev/null

Build description signature: eb197807fb081a996a0c3728fb789070
Build description path: /Volumes/workspace/DerivedData/Build/Intermediates.noindex/XCBuildData/eb197807fb081a996a0c3728fb789070.xcbuilddata
error: unable to attach DB: error: accessing build database "/Volumes/workspace/DerivedData/Build/Intermediates.noindex/XCBuildData/build.db": database is locked Possibly there are two concurrent builds running in the same filesystem location.
** BUILD FAILED **

Build seems to have failed for some reason. Please file an issue on GitHub.

Generated Mocks File = /Volumes/workspace/repository/sdk/sdkTests/GeneratedMocks.swift

Mocks Input Directory = /Volumes/workspace/repository/sdk/sdk

Script path: /Volumes/workspace/DerivedData/SourcePackages/checkouts/Cuckoo

No Cuckoo Generator found.

/Volumes/workspace/DerivedData/SourcePackages/checkouts/Cuckoo /Volumes/workspace/repository/sdk

Building...

Command line invocation:

    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build -project /Volumes/workspace/DerivedData/SourcePackages/checkouts/Cuckoo/Generator/Generator.xcodeproj -scheme Generator -configuration Release

User defaults from command line:

    IDEPackageSupportUseBuiltinSCM = YES

Resolve Package Graph

Fetching from https://github.com/kylef/PathKit.git

Fetching from https://github.com/kylef/Stencil.git

Fetching from https://github.com/kylef/Spectre.git

Fetching from https://github.com/nvzqz/FileKit.git

Fetching from https://github.com/antitypical/Result.git

Fetching from https://github.com/Carthage/Commandant.git

Fetching from https://github.com/Quick/Quick.git

Fetching from https://github.com/Quick/Nimble.git

Creating working copy of package ‘Stencil’

Checking out 0.14.2 of package ‘Stencil’

Creating working copy of package ‘Spectre’

Checking out 0.10.1 of package ‘Spectre’

Checking out 4.9.0 of package ‘SWXMLHash’

Creating working copy of package ‘Quick’

Checking out 1.3.4 of package ‘Quick’

Creating working copy of package ‘FileKit’

Checking out develop (9006d28) of package ‘FileKit’

Checking out 1.0.2 of package ‘Yams’

Creating working copy of package ‘Result’

Checking out 4.1.0 of package ‘Result’

Creating working copy of package ‘PathKit’

Checking out 1.0.1 of package ‘PathKit’

Creating working copy of package ‘Commandant’

Checking out 0.15.0 of package ‘Commandant’

Checking out 0.21.3 of package ‘SourceKitten’

Creating working copy of package ‘Nimble’

Checking out 7.3.4 of package ‘Nimble’

Resolved source packages:

  Spectre: https://github.com/kylef/Spectre.git @ 0.10.1

  SWXMLHash: https://github.com/drmohundro/SWXMLHash.git @ 4.9.0

  Stencil: https://github.com/kylef/Stencil.git @ 0.14.2

  PathKit: https://github.com/kylef/PathKit.git @ 1.0.1

  FileKit: https://github.com/nvzqz/FileKit.git @ develop (9006d28)

  Result: https://github.com/antitypical/Result.git @ 4.1.0

  Quick: https://github.com/Quick/Quick.git @ 1.3.4

  Yams: https://github.com/jpsim/Yams.git @ 1.0.2

  Commandant: https://github.com/Carthage/Commandant.git @ 0.15.0

  SourceKitten: https://github.com/jpsim/SourceKitten.git @ 0.21.3

  Nimble: https://github.com/Quick/Nimble.git @ 7.3.4

--- xcodebuild: WARNING: Using the first of multiple matching destinations:

{ platform:macOS, arch:x86_64, id:B2ED60B6-9B51-4DED-90C6-5A298A308EDA, name:My Mac }

{ platform:macOS, name:Any Mac }

Prepare packages

ComputeTargetDependencyGraph

Building targets in dependency order

    Target 'CuckooGenerator' in project 'Generator'

        ➜ Explicit dependency on target 'FileKit' in project 'FileKit'

        ➜ Explicit dependency on target 'SourceKittenFramework' in project 'SourceKitten'

        ➜ Explicit dependency on target 'Stencil' in project 'Stencil'

        ➜ Explicit dependency on target 'Commandant' in project 'Commandant'

    Target 'Commandant' in project 'Commandant'

        ➜ Explicit dependency on target 'Commandant' in project 'Commandant'

        ➜ Explicit dependency on target 'Result' in project 'Result'

    Target 'Commandant' in project 'Commandant'

        ➜ Explicit dependency on target 'Result' in project 'Result'

    Target 'Result' in project 'Result'

        ➜ Explicit dependency on target 'Result' in project 'Result'

    Target 'Result' in project 'Result' (no dependencies)

    Target 'Stencil' in project 'Stencil'

        ➜ Explicit dependency on target 'Stencil' in project 'Stencil'

        ➜ Explicit dependency on target 'PathKit' in project 'PathKit'

    Target 'Stencil' in project 'Stencil'

        ➜ Explicit dependency on target 'PathKit' in project 'PathKit'

    Target 'PathKit' in project 'PathKit'

        ➜ Explicit dependency on target 'PathKit' in project 'PathKit'

    Target 'PathKit' in project 'PathKit' (no dependencies)

    Target 'SourceKittenFramework' in project 'SourceKitten'

        ➜ Explicit dependency on target 'SourceKittenFramework' in project 'SourceKitten'

        ➜ Explicit dependency on target 'Clang_C' in project 'SourceKitten'

        ➜ Explicit dependency on target 'SourceKit' in project 'SourceKitten'

        ➜ Explicit dependency on target 'SWXMLHash' in project 'SWXMLHash'

        ➜ Explicit dependency on target 'Yams' in project 'Yams'

    Target 'SourceKittenFramework' in project 'SourceKitten'

        ➜ Explicit dependency on target 'Clang_C' in project 'SourceKitten'

        ➜ Explicit dependency on target 'SourceKit' in project 'SourceKitten'

        ➜ Explicit dependency on target 'SWXMLHash' in project 'SWXMLHash'

        ➜ Explicit dependency on target 'Yams' in project 'Yams'

    Target 'Yams' in project 'Yams'

        ➜ Explicit dependency on target 'Yams' in project 'Yams'

        ➜ Explicit dependency on target 'CYaml' in project 'Yams'

    Target 'Yams' in project 'Yams'

        ➜ Explicit dependency on target 'CYaml' in project 'Yams'

    Target 'CYaml' in project 'Yams' (no dependencies)

    Target 'SWXMLHash' in project 'SWXMLHash'

        ➜ Explicit dependency on target 'SWXMLHash' in project 'SWXMLHash'

    Target 'SWXMLHash' in project 'SWXMLHash' (no dependencies)

    Target 'SourceKit' in project 'SourceKitten' (no dependencies)

    Target 'Clang_C' in project 'SourceKitten' (no dependencies)

    Target 'FileKit' in project 'FileKit'

        ➜ Explicit dependency on target 'FileKit' in project 'FileKit'

    Target 'FileKit' in project 'FileKit' (no dependencies)

GatherProvisioningInputs

CreateBuildDescription

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -x objective-c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -v

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -x c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -x c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld -version_details

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -x objective-c -c /dev/null

ExecuteExternalTool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -v -E -dM -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -x c -c /dev/null

Build description signature: eb197807fb081a996a0c3728fb789070

Build description path: /Volumes/workspace/DerivedData/Build/Intermediates.noindex/XCBuildData/eb197807fb081a996a0c3728fb789070.xcbuilddata

Target dependency graph (20 targets)

** BUILD FAILED **

Build seems to have failed for some reason. Please file an issue on GitHub.

accessing build database "/Volumes/workspace/DerivedData/Build/Intermediates.noindex/XCBuildData/build.db": database is locked Possibly there are two concurrent builds running in the same filesystem location.

Thx

MatyasKriz commented 2 months ago

Try Cuckoo 2.x, 1.x isn't supported anymore.

Brumanuel commented 2 months ago

I have upgraded to Cuckoo V2 and Xcode Cloud is working, thx