Hi, I have an issue with the build-wrapper command:
Our codebase contains Swift & Obj-C code and we use Xcode 12.
build-wrapper version: 6.13 (macosx-x86)
...
xcodebuild: error: Could not resolve package dependencies:
build-wrapper: connect to /tmp/build-wrapper-socket.27NmvM: Operation not permitted
build-wrapper: connect to /tmp/build-wrapper-socket.27NmvM: Operation not permitted
build-wrapper: connect to /tmp/build-wrapper-socket.27NmvM: Operation not permitted
build-wrapper: connect to /tmp/build-wrapper-socket.27NmvM: Operation not permitted
...
I think the error is related to Xcode resolving Swift packages. When I run the same xcodebuild command without the build-wrapper package resolution works fine.
The build-wrapper.log ends with these lines:
...
Thu Oct 15 09:56:37 2020: finalizing json file
Thu Oct 15 09:56:37 2020: returned with code: 74
I couldn’t find any information on the returned code.
Hi @mpaladin, I created a Hello World project (Swift + Obj-C) with only one public Swift Package dependency.
When I run xcodebuild without the build-wrapper Swift Package dependencies are resolved and fetched without an error.
No, it works locally. We had previously issues with Xcode resolving Swift Packages but it is working now, expect if we use the build-wrapper so there has to be something we have to configure differently when using the build-wrapper. FYI: It worked with the build-wrapper while we used Xcode 11
Yes, but something has to be different when using the buil-wrapper. Maybe you can help me with the error code. How can I get more information on the error code? Is it a error from the build-wrapper or does the build wrapper forward error codes from xcode?
the build-wrapper forward error codes of the processes.
For your information I tried the project you provided and it works both locally and on Azure DevOps without any issue. On both tests I used macOS 10.15 and Xcode 12.
I wonder whether in CircleCI there is something which may interfer with build-wrapper and the build. Could you check if the environment contain a variable named DYLD_INSERT_LIBRARIES before launching the build-wrapper?
Thanks I will check that, but in the mean time I found a similar issue https://github.com/samuelmeuli/tmignore/issues/9 I think the cause of the issue could be the same as I experience. It looks like it is a permission/sandboxing issue when running Xcode build from a subprocess or something similar.
A successful run looks like this:
Resolve Package Graph
Fetching https://github.com/ReactiveX/RxSwift.git
Cloning https://github.com/ReactiveX/RxSwift.git
Checking out https://github.com/ReactiveX/RxSwift.git at 6.0.0-rc.1
Resolved source packages:
RxSwift: https://github.com/ReactiveX/RxSwift.git @ 6.0.0-rc.1
A failed run like this:
Resolve Package Graph
Fetching https://github.com/ReactiveX/RxSwift.git
xcodebuild: error: Could not resolve package dependencies:
build-wrapper: connect to /tmp/build-wrapper-socket.YiKkHY: Operation not permitted
The fetching takes also a while to complete so my hypothesis is that fetching works but it fails at the cloning step when writing to disk and it fails to access the directory or something.
@mpaladin Hello, I saw that a similar issue was solved by removing the com.apple.quarantine attribute.
I tried to remove the attribute from the build-wrapper but no success…
xattr -d com.apple.quarantine ../command-line-tools/sonar-obj-c-build-wrapper/build-wrapper-macosx-x86
xattr: ../command-line-tools/sonar-obj-c-build-wrapper/build-wrapper-macosx-x86: No such xattr: com.apple.quarantine
Do you think this can help us in anyway, maybe we have to disable sandboxing somewhere else?