Открытие файла импорта для модуля ‹framework›: Отказано в доступе

Я установил удаленный репозиторий Git и сервер Xcode на другом компьютере, а затем создал бота в Xcode. Каждый раз, когда я пытаюсь выполнить новую интеграцию, происходит сбой с такой ошибкой:

Assertion: Opening import file for module 'Accelerate': Permission denied
     File: <filename>.swift:9

Если я прокомментирую все в этом файле, бот начнет показывать ту же ошибку для другого фреймворка (и другого файла .swift). Это может быть фреймворк Swift или Objective-C.

Search Paths для этого проекта: $(PROJECT_DIR), а Always Search User Paths установлено на Yes

Я использую Xcode 7.2 beta 2, но столкнулся с той же проблемой в Xcode 7.1 из App Store. Я попытался перезапустить Xcode, а также сервер и Mac для разработки, это не помогает. Проект компилируется и успешно работает на моем компьютере для разработки.

Журналы сервера: (xcsbuildd.log)

[BuildService] Previous integration is needed but not loaded yet, fetching.
[BuildService] Previous integration loaded successfully.
[BuildService] Completed integration step XCSCheckoutIntegrationStep without error
[BuildService, Info] Asset packs will be hosted at <server url here>
[BuildService] Current server devices are needed but not loaded yet, fetching.
[BuildService] Devices loaded successfully.
[BuildService, Info] Current server platforms are needed but not loaded yet, fetching.
[BuildService, Info] Platforms loaded successfully.
[BuildService] Creating arguments list for integrate
[BuildService] Integration will not perform analyze action
[BuildService] Integration will perform test action
[BuildService] Integration use scheme-level code coverage enabled setting
[BuildService] Additional build arguments are "(
)"
[BuildService, Info] Creating test device destination arguments for device testing
[BuildService, Info] Create test device destination arguments from device specification
[BuildService, Info] Including device iPhone 6 Plus (A3E8ED2D-4D13-420E-8CE1-6D484E65CD03)
[BuildService, Info] Destination arguments are (
    "-skipUnsupportedDestinations",
    "-destination-timeout",
    30,
    "-DVTDeviceLogLevel=3",
    "-DVTDeviceSearchLogLevel=3",
    "-iPhoneSimulatorLogLevel=3",
    "-iPhoneConnectLogLevel=3",
    "-destination",
    "id=A3E8ED2D-4D13-420E-8CE1-6D484E65CD03"
)
[BuildService] Integrate arguments list is (
    "/usr/bin/xcrun",
    xcodebuild,
    test,
    "-IDETestOperationsObserverDebugLogLevel=3",
    "-IDEBuildOperationMaxPercentageOfConcurrentCompileTasks=80",
    "-IDEBuildOperationQueueSetResourceManagementLogLevel=2",
    "-DTDKSupportWirelessDevices=NO",
    "-IDEPostProgressNotifications=YES",
    "-DVTAllowServerCertificates=YES",
    "-DVTSigningCertificateSourceLogLevel=3",
    "-DVTSigningCertificateManagerLogLevel=3",
    "-DTDKProvisioningProfileExtraSearchPaths=/Library/Developer/XcodeServer/ProvisioningProfiles",
    "-DTDKDisableSymbolCopying=YES",
    "-scheme",
    Newsfeeder,
    "-skipUnavailableActions",
    "-project",
    "/Library/Developer/XcodeServer/Integrations/Caches/1770e1afb8f775d8c92855beba002640/Source/Newsfeeder/Newsfeeder.xcodeproj",
    "-derivedDataPath",
    "/Library/Developer/XcodeServer/Integrations/Caches/1770e1afb8f775d8c92855beba002640/DerivedData",
    "-skipUnsupportedDestinations",
    "-destination-timeout",
    30,
    "-DVTDeviceLogLevel=3",
    "-DVTDeviceSearchLogLevel=3",
    "-iPhoneSimulatorLogLevel=3",
    "-iPhoneConnectLogLevel=3",
    "-destination",
    "id=A3E8ED2D-4D13-420E-8CE1-6D484E65CD03",
    "-DVTSuppressExternalDeviceLocation=NO",
    "-resultBundlePath",
    "/Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/xcodebuild_result.bundle"
)

[BuildService] NSTask environment: {
    "DEVELOPER_DIR" = "/Library/Developer/XcodeServer/CurrentXcodeSymlink/Contents/Developer";
    PATH = "/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin";
    XCS = 1;
    "XCS_BOT_ID" = 1770e1afb8f775d8c92855beba002640;
    "XCS_BOT_NAME" = "Newsfeeder Bot";
    "XCS_BOT_TINY_ID" = 8466E19;
    "XCS_DERIVED_DATA_DIR" = "/Library/Developer/XcodeServer/Integrations/Caches/1770e1afb8f775d8c92855beba002640/DerivedData";
    "XCS_INTEGRATION_ID" = 1770e1afb8f775d8c92855beba008e0d;
    "XCS_INTEGRATION_NUMBER" = 2;
    "XCS_INTEGRATION_RESULT" = unknown;
    "XCS_INTEGRATION_TINY_ID" = B989BD8;
    "XCS_OUTPUT_DIR" = "/Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d";
    "XCS_SOURCE_DIR" = "/Library/Developer/XcodeServer/Integrations/Caches/1770e1afb8f775d8c92855beba002640/Source";
    "XCS_XCODEBUILD_LOG" = "/Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/xcodebuild.log";
}

[BuildService] Running task /usr/bin/nice /usr/bin/xcrun xcodebuild test -IDETestOperationsObserverDebugLogLevel=3 -IDEBuildOperationMaxPercentageOfConcurrentCompileTasks=80 -IDEBuildOperationQueueSetResourceManagementLogLevel=2 -DTDKSupportWirelessDevices=NO -IDEPostProgressNotifications=YES -DVTAllowServerCertificates=YES -DVTSigningCertificateSourceLogLevel=3 -DVTSigningCertificateManagerLogLevel=3 -DTDKProvisioningProfileExtraSearchPaths=/Library/Developer/XcodeServer/ProvisioningProfiles -DTDKDisableSymbolCopying=YES -scheme Newsfeeder -skipUnavailableActions -project /Library/Developer/XcodeServer/Integrations/Caches/1770e1afb8f775d8c92855beba002640/Source/Newsfeeder/Newsfeeder.xcodeproj -derivedDataPath /Library/Developer/XcodeServer/Integrations/Caches/1770e1afb8f775d8c92855beba002640/DerivedData -skipUnsupportedDestinations -destination-timeout 30 -DVTDeviceLogLevel=3 -DVTDeviceSearchLogLevel=3 -iPhoneSimulatorLogLevel=3 -iPhoneConnectLogLevel=3 -destination id=A3E8ED2D-4D13-420E-8CE1-6D484E65CD03 -DVTSuppressExternalDeviceLocation=NO -resultBundlePath /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/xcodebuild_result.bundle

[BuildService, Info] Monitoring /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/xcodebuild.log for activity.

[BuildService, Info] Done monitoring xcodebuild.log for activity.
[BuildService] Scheme actions record is needed but not loaded yet, fetching.
[BuildService] Scheme actions record loaded successfully.
[BuildService] Completed integration step XCSBuildIntegrationStep without error
[BuildService] Last integration with build results is needed but not loaded yet, fetching.
[BuildService] Last integration with build results loaded successfully.
[BuildService] Build results summary: {
    analyzerWarningChange = 0;
    analyzerWarningCount = 0;
    codeCoveragePercentage = 0;
    codeCoveragePercentageDelta = 0;
    errorChange = 0;
    errorCount = 1;
    improvedPerfTestCount = 0;
    regressedPerfTestCount = 0;
    testFailureChange = 0;
    testFailureCount = 0;
    testsChange = 0;
    testsCount = 0;
    warningChange = 0;
    warningCount = 0;
}

[BuildService] Integration commit history are needed but not loaded yet, fetching.
[BuildService] Integration commits loaded successfully.
[BuildService] Completed integration step XCSProcessBuildResultsIntegrationStep without error
[BuildService] Matched device <XCSDevice 0x7fc77e82eaf0>
{"modelUTI":"com.apple.iphone-6-plus-b4b5b9","connected":"YES","modelCode":"iPhone7,1","simulator":"YES","osVersion":"9.2","modelName":"iPhone 6 Plus","supported":"YES","deviceUDID":"A3E8ED2D-4D13-420E-8CE1-6D484E65CD03","identifier":"A3E8ED2D-4D13-420E-8CE1-6D484E65CD03","enabledForDevelopment":"YES","architecture":"x86_64","isServer":"NO","tinyID":"A3E8ED2","doc_type":"device","trusted":"YES","platformIdentifier":"com.apple.platform.iphonesimulator","name":"iPhone 6 Plus","retina":"YES"} to server device <XCSDevice 0x7fc77e398d70>
{"osVersion":"9.2","connected":"YES","simulator":"YES","modelCode":"iPhone7,1","deviceType":"com.apple.iphone-simulator","modelName":"iPhone 6 Plus","revision":"6-71966f4a54eb01b83604036d5b31c53c","modelUTI":"com.apple.iphone-6-plus-b4b5b9","doc_type":"device","trusted":"YES","name":"iPhone 6 Plus","supported":"YES","identifier":"A3E8ED2D-4D13-420E-8CE1-6D484E65CD03","enabledForDevelopment":"YES","platformIdentifier":"com.apple.platform.iphonesimulator","ID":"11f2b4085b58a3769cd320245b004ab9","architecture":"x86_64","retina":"NO","isServer":"NO","tinyID":"37889F2"}

[BuildService] Processing device: <XCSDevice 0x7fc77e398d70>
{"osVersion":"9.2","connected":"YES","simulator":"YES","modelCode":"iPhone7,1","deviceType":"com.apple.iphone-simulator","modelName":"iPhone 6 Plus","revision":"6-71966f4a54eb01b83604036d5b31c53c","modelUTI":"com.apple.iphone-6-plus-b4b5b9","doc_type":"device","trusted":"YES","name":"iPhone 6 Plus","supported":"YES","identifier":"A3E8ED2D-4D13-420E-8CE1-6D484E65CD03","enabledForDevelopment":"YES","platformIdentifier":"com.apple.platform.iphonesimulator","ID":"11f2b4085b58a3769cd320245b004ab9","architecture":"x86_64","retina":"NO","isServer":"NO","tinyID":"37889F2"}
[BuildService] Completed integration step XCSProcessTestResultsIntegrationStep without error
  adding: xcodebuild_result.bundle/ (stored 0%)
  adding: xcodebuild_result.bundle/1_Test/ (stored 0%)
  adding: xcodebuild_result.bundle/1_Test/action.xcactivitylog (stored 0%)
  adding: xcodebuild_result.bundle/1_Test/build.xcactivitylog (deflated 1%)
  adding: xcodebuild_result.bundle/Info.plist (deflated 79%)
[BuildService] Uploading file /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/xcodebuild_result.bundle.zip
[BuildService] Uploading file /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/buildService.log
[BuildService] Uploading file /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/xcodebuild.log
[BuildService] Uploading file /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/sourceControl.log
[BuildService] Uploading file /Library/Developer/XcodeServer/Integrations/Integration-1770e1afb8f775d8c92855beba008e0d/Session-2015-11-04_16:54:03-zpFYIF.log to relative path (null)
[BuildService] Completed integration step XCSUploadFilesIntegrationStep without error
[BuildService] Integration executor is finished. Exiting.
[BuildService] Registering build service socket listeners
[BuildService] Done registering build service socket listeners

person egor.zhdan    schedule 03.11.2015    source источник
comment
Мне то же самое. Вы используете Carthage или Cocoapods?   -  person beseder    schedule 03.11.2015
comment
@beseder нет, я не использую никакого менеджера зависимостей.   -  person egor.zhdan    schedule 03.11.2015
comment
если вы зайдете в папку сервера Xcode в библиотеке/разработчике/сервере Xcode, там будет папка журналов, и вы можете открыть журнал сборки и увидеть более подробную информацию о проблеме, с которой он столкнулся.   -  person bolnad    schedule 04.11.2015
comment
@bolnad Кажется, я не понимаю, почему возникает проблема. Обновлен мой вопрос с журналами от Library/Developer/XcodeServer/Logs/xcsbuildd.log   -  person egor.zhdan    schedule 04.11.2015
comment
@egor.zhdan Я не вижу нигде в этом журнале, где он с чем-то борется. вы используете бета-версию сервера Xcode 7.2, а также свою машину для разработчиков? это не несоответствие версий?   -  person bolnad    schedule 04.11.2015
comment
@bolnad Я использую одинаковые версии Xcode (7.2 бета 2) на обеих машинах.   -  person egor.zhdan    schedule 04.11.2015
comment
@beseder, если вам все еще интересно: я нашел обходной путь — вместо импорта предварительно скомпилированных библиотек я добавил их в качестве целей и настроил зависимости. Теперь сервер работает как положено.   -  person egor.zhdan    schedule 05.11.2015
comment
@egor.zhdan Еще интересно! Просто пока не было возможности что-то изменить - постараюсь сделать комментарий.   -  person beseder    schedule 05.11.2015


Ответы (1)


У меня была такая же ошибка, когда я пытался создать и запустить тесты для своей собственной структуры на сервере непрерывной интеграции (боты службы Xcode). Впервые проблема возникла после обновления моего серверного приложения до версии 5.1 (15S5127) и Xcode до версии 7.3 (7D175).

В моем случае решение оказалось весьма неожиданным. Мне потребовалось много времени, чтобы понять, что проблема проявляется только тогда, когда я использую Nimble framework. Когда я удаляю import Nimble из своего теста и использую стандартные утверждения XCTest, проблема исчезает.

В моем случае помогло убедиться, что перед интеграцией инфраструктура Nimble перестроена. Я использую Nimble with Carthage , поэтому мне нужно было всего лишь добавить следующую команду в Триггер перед интеграцией:

cd NimbleCarthageProblem && /usr/local/bin/carthage bootstrap --platform iOS

Смотрите также скриншот:

Перед триггером

После этого он успешно собирается и тестируется.

Из ваших журналов я не могу понять, используете ли вы Nimble - если нет, то это означает, что проблема где-то в другом месте, и я только что испытал еще одно ее открытие.

Я до сих пор не понимаю, почему проблема возникает только на сервере сборки во время интеграции. Даже если я зайду на сборочную машину, проверю исходный код и тут же соберу его с помощью Xcode - все в порядке. Сбой происходит только на боте во время интеграции. Решение не идеально по другой причине: Nimble нужно пересобирать перед каждой интеграцией, и его нельзя просто включить в исходный код (если кто-то посчитает это лучшим подходом).

Если я надеюсь, что кто-то другой найдет фактическое решение. Я не виню Nimble - это, скорее всего, комбинация вещей.

Я создал пример проекта, где проблема и решение описаны более подробно. Его можно найти здесь: https://github.com/marcinczenko/NimbleCarthageProblem.

person everyday productive    schedule 09.04.2016