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

Stalling out on CI with Xcode 10 #14

Closed
u2606 opened this issue Oct 10, 2018 · 11 comments
Closed

Stalling out on CI with Xcode 10 #14

u2606 opened this issue Oct 10, 2018 · 11 comments

Comments

@u2606
Copy link

u2606 commented Oct 10, 2018

After updating our app to Xcode 10 and Swift 4.2, danger-swiftlint stalls out on CircleCI. After linting some of our files, it eventually stops printing to STDOUT, and after 10 minutes of inactivity, CircleCI terminates it.

This behavior did not occur with Xcode 9 and Swift 4.1.

This is the relevant portion of our Dangerfile.swift:

import Danger
import DangerSwiftLint // package: https://github.com/ashfurrow/danger-swiftlint.git

SwiftLint.lint(inline: true, directory: "Clutter/Application”)

This is the (abridged) log from CircleCI:

#!/bin/bash --login -o pipefail
danger process danger-swift
Ran with: Dangerfile.swift /var/folders/gk/lkr9pm5x039fx6d3j9r52rv80000gn/T/danger-dsl.json /var/folders/gk/lkr9pm5x039fx6d3j9r52rv80000gn/T/danger-response.json
Executing pwd 
Working directory: /Users/distiller/project

Executing swiftlint lint --quiet --path "Clutter/Application/API/ClutterAPI.swift" --reporter json
<189 lines omitted>
Executing swiftlint lint --quiet --path "Clutter/Application/Protocols/TableViewController.swift" --reporter json
Executing swiftlint lint --quiet --path "Clutter/Application/StyleKits/ClutterStyleKit.swift" 
Too long with no output (exceeded 10m0s)

I notice that the final swiftlint lint line doesn’t end with -- reporter json. Additionally, ClutterStyleKit.swift is a 3005-line, PaintCode-generated file. Not sure if either of those is relevant.

@u2606
Copy link
Author

u2606 commented Oct 10, 2018

On a subsequent run, the CircleCI log ended one line earlier:

Executing swiftlint lint --quiet --path "Clutter/Application/Protocols/TableViewController.swift" --reporter jso

Note that this time, the final line ended mid-word.

@ashfurrow
Copy link
Owner

@erikstrottmann thanks for opening this issue – no solution comes to mind, so let's dig into this. Is there a way in Circle to get a raw log file? I've seen CI providers cut off text like this before but it does get written. If you could try running the commands locally to verify they work, that'd be great too 👍

@u2606
Copy link
Author

u2606 commented Oct 10, 2018

@ashfurrow, there’s no native support for raw log files on CircleCI. I tried using https://github.com/artemv/circleci-step-outputter to download the output of the Danger step, which consisted of the same log messages I pasted above, split into two .txt files.

I had the same result when running against my Swift 4.2 branch locally with DANGER_GITHUB_API_TOKEN="<...>" DANGER_FAKE_CI="YEP" DANGER_TEST_REPO="<...>" DANGER_TEST_PR="<...>" /usr/local/bin/danger process /usr/local/bin/danger-swift — it logs that it’s linting some files, then stalls indefinitely midway through a print statement.

However, I can successfully run Danger SwiftLint against a different PR that’s still using Swift 4.1, even when my local machine is using the Xcode 10 Command Line Tools to run Danger Swift.

That makes it look like the failure isn’t being caused by Xcode 10 itself, but by something I’ve changed in my Swift 4.2 branch. Is there any way to run Danger against a specific commit? That would help me narrow down which change breaks Danger SwiftLint.

@ashfurrow
Copy link
Owner

@erikstrottmann you should be able to run bundle exec danger pr with --head= and --base= options to specify which commit to use. Thanks for looking into this!

@u2606
Copy link
Author

u2606 commented Oct 11, 2018

@ashfurrow, does Danger JS’s danger process subcommand support --head= and --base=? Since I’m using Danger Swift, I’m unable to use Danger Ruby or Danger JS’s danger pr subcommand.

When I pass --head="<...>" and --base="<...>" to Danger JS’s danger process, it appears to ignore them. When I include the DANGER_TEST_REPO environment variable, it gets stuck midway through printing linting logs, even when I specify a head that has Danger SwiftLint disabled. When I omit DANGER_TEST_REPO, it appears to default to a different PR (the most recently created one?) and succeeds.

@ashfurrow
Copy link
Owner

Oh yikes, I'm not sure. Hmm, if I were diving into this, I'd focus on reproducing the issue locally. I'd probably use the Circle CI CLI tool to run the CI image locally and get it to stall so I could figure out what was going on.

I'd prefer to dive into this with you but I'm short on time – let me know what questions I can answer, and good luck.

@orta
Copy link
Contributor

orta commented Nov 20, 2018

Heyo folks, I'm monitoring this issue here: danger/swift#108

@orta
Copy link
Contributor

orta commented Dec 16, 2018

If someone is still seeing this, can you try add ~/.danger-swift to your build caching? I've got a pretty drastic solution: danger/swift#139 but it might take some time to figure out

@u2606
Copy link
Author

u2606 commented Jan 3, 2019

We’re no longer seeing this issue. We’ve updated to Danger Swift 1.0.0, changed the command to danger-swift ci, and removed the separate Danger SwiftLint import.

@ashfurrow
Copy link
Owner

Thanks for following up @erikstrottmann! This issue is safe to close then?

@u2606
Copy link
Author

u2606 commented Jan 3, 2019

Yep, should be safe to close!

@u2606 u2606 closed this as completed Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants