realm / realm/SwiftLint

Command PhaseScriptExecution failed with a nonzero exit code

Open
#6,155 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help
Dominant language
Swift
Stars
19.7k
Forks
2.3k
Avg merge
1d 1h
Merged PRs (30d)
11

Description

New Issue Checklist
Bug Description

We've been using the following script in build phase for the past 3 years.

if [[ "$(uname -m)" == arm64 ]]
then
    export PATH="/opt/homebrew/bin:$PATH"
fi

if which swiftlint >/dev/null; then
  swiftlint --fix && swiftlint
else
  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
  exit 1
fi

Everything works until yesterday. The build failed at the script execution, and here is the error

Image

Then we have to put project folder and unit test folders explicitly under included: section in .swiftLint.yml to get the project build.

I am not sure this is the issue of swiftlint or datadog or both but it seems quit similar to this issue https://github.com/realm/SwiftLint/issues/4127, which was posted 3 years ago.

Environment
  • SwiftLint version: 0.59.1
  • Xcode version: Xcode 16.0, Build version 16A242d
  • Installation method used (Homebrew)
  • Configuration file:
disabled_rules:
  - statement_position # https://realm.github.io/SwiftLint/statement_position.html
  - colon
  - nesting
  - line_length
  - identifier_name
  - multiple_closures_with_trailing_closure
  - cyclomatic_complexity
  - function_body_length
  - type_name
  - file_length
  - type_body_length
  - function_parameter_count
  - large_tuple
  - redundant_discardable_let
  - for_where

included:
   - [PROJECT_FOLDER]
   - [UNIT_TEST_FOLDER]
   - [UI_TEST_FOLDER]
  
excluded:
  - Packages/[SOME_PACKAGE_FILE]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported build-phase script and the supplied .swiftLint.yml configuration, then reproduce the failure using SwiftLint 0.59.1 installed through Homebrew with Xcode 16. Compare behavior with and without the explicit included project and test folders, and determine whether the build completes without requiring those paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.