Build Machine Cannot Open File

Build Machine Cannot Open File

Description of the issue

I’m encountering an issue in an iOS project of mine where a file necessary for a build phase is unable to be read by the Bitrise build machine.

The specific error is:

error: The file “.swiftlint.yml” couldn’t be opened because you don’t have permission to view it. (exit code: 1)

The current file permissions are -rw-r--r--@ 1 redacted staff 276B Jun 29 10:15 .swiftlint.yml, which should be readable. I’ve also never encountered this issue before, even with other projects running the same build phase.

My build phase script is as follows:

export PATH="$PATH:/opt/homebrew/bin"

if which swiftlint >/dev/null; then
    if [ "${CONFIGURATION}" == "Debug" ]; then
        swiftlint --path "./${TARGET_NAME}" --config "${SRCROOT}/.swiftlint.yml"
    fi
else
    echo "Warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

I’d prefer to not have to change the file permissions locally as I share my configurations and bitrise.yml files across multiple applications with multiple team members, and I don’t want to have to include updating file permissions as a step when setting up new projects.

Any assistance is appreciated.

Environment:

Xcode 14.3.x, on macOS 13.2 (Ventura)

Which build Step causes the issue and which version of the step?

Xcode Test for iOS

Reproducibility

  • Does a “Rebuild” help? : NO
  • Does a rebuild without caches help? : NO
  • Does the issue happen sporadically, or every time? : Every time
  • Does upgrading the build Step to the latest version help? : NO

Local reproduction

This issue cannot be replicated on my local machine.

Build log

Failed to execute Step:
  command failed with exit status 65 (xcodebuild "-project" "/Users/vagrant/git/redacted.xcodeproj" "-scheme" "redacted" "test" "-destination" "id=D7CA41A8-547E-4DC0-9C53-FF5A41928CA5" "-resultBundlePath" "/var/folders/69/qgnyrbkx23dbp0p6p_b6bc9m0000gn/T/XCUITestOutput3046677641/redacted.xcresult" "-retry-tests-on-failure" "-test-iterations" "3" "-xcconfig" "/var/folders/69/qgnyrbkx23dbp0p6p_b6bc9m0000gn/T/506952447/temp.xcconfig"):
    error: The file “.swiftlint.yml” couldn’t be opened because you don’t have permission to view it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.