Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure #200

Closed
mmorier opened this issue Nov 15, 2015 · 2 comments
Labels
bug Unexpected and reproducible misbehavior.

Comments

@mmorier
Copy link
Contributor

mmorier commented Nov 15, 2015

I'm experiencing an issue with SwiftLint. It breaks the build even if I have lint warning but no lint errors. I run the following script in Xcode build phases:

if which swiftlint >/dev/null; then
    swiftlint
else
    echo "SwiftLint does not exist, download from https://github.com/realm/SwiftLint"
fi

In terminal, logs seems good when SwiftLint is launched only but it emitted errors when I build my project with xctool in Terminal. I suspect issue comes from a file which have 77 lint warning but don't know why it emitted shell error. Any idea?

Here a subset of Xcode messages which shows strange logs waLinting and 169 files. rning: Control:

[...]/InfiniLog.swift:20:7: warning: Control Statement Violation: if statements shouldn't wrap their conditionals in parentheses. (control_statement)
[...]/InfiniLog.swift:28:7: waLinting 'InfiniUtil.swift' (120/169)
Linting 'QuizzCategoriesButton.swift' (121/169)
[...]
Linting 'PlayerControlsViewTests.swift' (169/169)
Done linting! Found 191 violations, 0 serious in 169 files.
rning: Control Statement Violation: if statements shouldn't wrap their conditionals in parentheses. (control_statement)
[...]
[...]/PlayerControls/PlayerControlsView.swift:352:8: warning: Todo Violation: TODOs and FIXMEs should be avoided (todo)
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure
@jpsim jpsim added the bug Unexpected and reproducible misbehavior. label Nov 18, 2015
@jpsim
Copy link
Collaborator

jpsim commented Nov 18, 2015

I think I know what's happening here. waLinting is probably being printed because print isn't being called synchronously, causing some prints (Linting ...) to be called while others are still in progress warning: ....

Carthage addressed this issue by moving all printing calls to a serial queue and I think we should do the same: https://github.com/Carthage/Carthage/blob/741a1e0553c770088518edadbcf1c5c40a919344/Source/carthage/Extensions.swift#L19-L49

@BluMist
Copy link

BluMist commented Jan 28, 2016

Seems like this bug is again showing up in 0.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

No branches or pull requests

3 participants