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

Run script fails on Xcode 7.2 (7C68) #264

Closed
diogoguimaraes opened this issue Dec 13, 2015 · 10 comments
Closed

Run script fails on Xcode 7.2 (7C68) #264

diogoguimaraes opened this issue Dec 13, 2015 · 10 comments
Labels
bug Unexpected and reproducible misbehavior.

Comments

@diogoguimaraes
Copy link
Contributor

I've just updated swiftlint to version 0.5.0 and I can't build my project on Xcode 7.2 (7C68):

Loading configuration from '.swiftlint.yml'
No lintable files found at path ''
Command /bin/sh failed with exit code 1

Building the project through the terminal shows the same build fail message.
I've already tried cleaning the DerivedData folder but the issue remains.

However if I run swiftlint manually in the projects directory the lint works.

Any clues on what this issue might be?

@jpsim
Copy link
Collaborator

jpsim commented Dec 14, 2015

Ah, you're right. Sorry about that. I can reproduce this by building this project's own swiftlint scheme.

This will take some time to debug. If you find out more about why this is the case, please post here.

@jpsim jpsim added the bug Unexpected and reproducible misbehavior. label Dec 14, 2015
@diogoguimaraes
Copy link
Contributor Author

I couldn't really find anything wrong until now.
The build log seems to have everything in place:

PhaseScriptExecution Run\ Script <RUN_SCRIPT_PATH>/Script-BC62F2AE1BCE4EFA007E6FDB.sh
    cd <PROJECT_PATH>
    /bin/sh -c <RUN_SCRIPT_PATH>/Script-BC62F2AE1BCE4EFA007E6FDB.sh

And the lint works if I perform /bin/sh -c swiftlint in <PROJECT_PATH>
I'll let you know if I find something new.
Thanks!

@jpsim
Copy link
Collaborator

jpsim commented Dec 14, 2015

@diogoguimaraes does this issue affect SwiftLint 0.4.0 with Xcode 7.2 as well? How about SwiftLint 0.5.0 with Xcode < 7.2 (e.g. 7.1.1)? I think Xcode 7.2 may have changed some behavior of shell script build phases, but I'm still investigating that.

@diogoguimaraes
Copy link
Contributor Author

@jpsim SwiftLint 0.4.0 was working with Xcode 7.2. I haven't tried SwiftLint 0.5.0 with Xcode < 7.2 yet.

@jpsim
Copy link
Collaborator

jpsim commented Dec 14, 2015

Ok, I've found the issue. I mistakenly removed the --use-script-input-files option from the lint command, thinking I was clever and just checking for the presence of an SCRIPT_INPUT_FILE_COUNT env variable (here), because I thought that was a user-defined thing.

Apparently it's a standard Xcode env variable that's always present, which is why @norio-nomura had added that option when he introduced that functionality in #193. Needless to say he's a smart guy and was doing the right thing here.

Thankfully, re-introducing that flag should just take a few minutes, but I do have to cut another release for this.

I'll do all that now, and hopefully we can just forget this little accident 😉.

@diogoguimaraes
Copy link
Contributor Author

Thanks!

@FlorianBasso
Copy link

Hi,
I still have this issue with the release 0.6.0 and I am on Xcode 7.2 (7C68)
I also tried to use the plugin from @norio-nomura but it doesn't work neither. It just doesn't load SwiftLint I think.

@alyapozdnyakova
Copy link

Same issue with 0.7.0.

@jpsim
Copy link
Collaborator

jpsim commented Jan 26, 2016

@FlorianBasso & @ylibatsya can you please open new issues, hopefully sharing more information about your setup, such as:

  • where/how is SwiftLint installed?
  • what does your run script build phase look like?
  • what gets logged to the Xcode build log when you attempt to run the SwiftLint build phase?
  • did this work with previous versions of SwiftLint and stopped working in subsequent releases?

@alyapozdnyakova
Copy link

Updating OSX to 10.11.3 and SwiftLint to 0.7.1 actually fixed the issue for me.

My installation path and run script are the default ones, and I used pkg file from the release page to install SwiftLint.

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

4 participants