Error xcodebuild NSFileHandle couldn't write. Exception: *** -[_NSStdIOFileHandle writeData:]: Broken pipe while generate Apollo GraphQL API
Asked Answered
C

1

7

Helpppp ! I just want to get my pipeline run successfully T.T Anyone can help me here~

Situation: I am integrating Apollo client in my iOS project and following the instruction provided by official Apollo - https://www.apollographql.com/docs/ios/installation (using SPM way to setup). It works all fine for me in Xcode manual compile and testing. However, when I am using the command to run the unit test, I got stuck while generating Apollo GraphQL API. Below is the error I have received while running xcodebuild test -scheme ${CI_PROJECT_NAME} -project ${CI_PROJECT_NAME}.xcodeproj -destination "${XCODE_APPLICATION_PLATFORM}" -enableCodeCoverage YES| xcpretty -s

Error: xcodebuild[10347:2192409] NSFileHandle couldn't write. Exception: *** -[_NSStdIOFileHandle writeData:]: Broken pipe

Note: This error occurs while I am running unit test through command line in Gitlab pipeline. Using Xcode 13.2.1.

enter image description here

Converter answered 22/4, 2022 at 10:59 Comment(1)
hi @janice, do you have any updates?Verine
U
1

I found this article online: https://peterthomashorn.info/blog/broken-pipe-in-gitlab-with-xcpretty/

It suggests setting the LC_ALL environment variable in gitlab CI to en_US.UTF-8. I believe this is setting the character encoding to UTF-8 so that xcpretty doesn't choke on the bytes being piped into it.

Unison answered 21/6, 2023 at 18:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.