Open Indolia opened 4 years ago
Hmm, seems to be failing on this line:
mkdir -p
'/Users/rishi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/danger-swiftlint-0.24.2/ext/swiftlint/bin'
Can you try running that command manually and seeing what it says?
HI @ashfurrow , I have run "gem install danger-swiftlint -v '0.24.2' --source 'https://rubygems.org/' " Manually but got the same error.
I have also run these command "mkdir -p '/Users/rishi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/danger-swiftlint-0.24.2/ext/swiftlint/bin' && curl -s -L https://github.com/realm/SwiftLint/releases/download/0.39.1/portable_swiftlint.zip -o portable_swiftlint.zip && unzip -q portable_swiftlint.zip -d '/Users/rishi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/danger-swiftlint-0.24.2/ext/swiftlint/bin' && rm portable_swiftlint.zip"
If you need any information about the system please let me know
Hmm, not sure. That command is actually a series of commands:
mkdir -p '/Users/rishi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/danger-swiftlint-0.24.2/ext/swiftlint/bin'
curl -s -L https://github.com/realm/SwiftLint/releases/download/0.39.1/portable_swiftlint.zip -o portable_swiftlint.zip
unzip -q portable_swiftlint.zip -d '/Users/rishi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/danger-swiftlint-0.24.2/ext/swiftlint/bin'
rm portable_swiftlint.zip
Could you run each one and tell me which one is failing and what the error message is?
Hi @ashfurrow , I have run each command one by one
mkdir -p '/Users/rishi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/danger-swiftlint-0.24.2/ext/swiftlint/bin' (Success)
curl -s -L https://github.com/realm/SwiftLint/releases/download/0.39.1/portable_swiftlint.zip -o portable_swiftlint.zip (failed) because when I run this command
_unzip -q portable_swiftlint.zip -d '/Users/rishi/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/danger-swiftlint-0.24.2/ext/swiftlint/bin'_
it show me this error [portable_swiftlint.zip] End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of portable_swiftlint.zip or portable_swiftlint.zip.zip, and cannot find portable_swiftlint.zip.ZIP, period.
and I go manually at the path I did not find any portable_swiftlint.zip file there I think I am not able to download the portable_swiftlint.zip file
please share if you have suggestion on it
That's so weird, I'm not really sure what to tell you. Can you try following the SwiftLint instructions for installing and let me know if they succeed? I really don't know what we could do...
I just started seeing this same issue, seemingly out of nowhere. One moment bundle install
was working on our CI, and then 5 minutes later I was getting hit by this same error message about portable_swift.zip. I tried rerunning a couple times, but it constantly failed.
I even tried running bundle install
, bundle update
, and gem install danger-swiftlint -v '0.24.2' --source 'https://rubygems.org/'
on my local machine but kept seeing this error.
Fetching danger-swiftlint 0.24.2
Installing danger-swiftlint 0.24.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/duncanmacdonald/.rvm/gems/ruby-2.6.3/gems/danger-swiftlint-0.24.2/ext/swiftlint
/Users/duncanmacdonald/.rvm/rubies/ruby-2.6.3/bin/ruby -rrubygems /Users/duncanmacdonald/.rvm/gems/ruby-2.6.3/gems/rake-13.0.1/exe/rake
RUBYARCHDIR\=/Users/duncanmacdonald/.rvm/gems/ruby-2.6.3/extensions/x86_64-darwin-19/2.6.0/danger-swiftlint-0.24.2
RUBYLIBDIR\=/Users/duncanmacdonald/.rvm/gems/ruby-2.6.3/extensions/x86_64-darwin-19/2.6.0/danger-swiftlint-0.24.2
mkdir -p '/Users/duncanmacdonald/.rvm/gems/ruby-2.6.3/gems/danger-swiftlint-0.24.2/ext/swiftlint/bin' && curl -s -L
https://github.com/realm/SwiftLint/releases/download/0.39.1/portable_swiftlint.zip -o portable_swiftlint.zip && unzip -q portable_swiftlint.zip -d
'/Users/duncanmacdonald/.rvm/gems/ruby-2.6.3/gems/danger-swiftlint-0.24.2/ext/swiftlint/bin' && rm portable_swiftlint.zip
Downloading swiftlint@0.39.1
[portable_swiftlint.zip]
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of portable_swiftlint.zip or
portable_swiftlint.zip.zip, and cannot find portable_swiftlint.zip.ZIP, period.
rake aborted!
Command failed with status (9): [mkdir -p '/Users/duncanmacdonald/.rvm/gems...]
/Users/duncanmacdonald/.rvm/gems/ruby-2.6.3/gems/danger-swiftlint-0.24.2/ext/swiftlint/Rakefile:17:in `block (2 levels) in <top (required)>'
/Users/duncanmacdonald/.rvm/gems/ruby-2.6.3/gems/rake-13.0.1/exe/rake:27:in `<main>'
Tasks: TOP => default => swiftlint:install
(See full trace by running task with --trace)
rake failed, exit code 1
Gem files will remain installed in /Users/duncanmacdonald/.rvm/gems/ruby-2.6.3/gems/danger-swiftlint-0.24.2 for inspection.
Results logged to /Users/duncanmacdonald/.rvm/gems/ruby-2.6.3/extensions/x86_64-darwin-19/2.6.0/danger-swiftlint-0.24.2/gem_make.out
An error occurred while installing danger-swiftlint (0.24.2), and Bundler cannot continue.
Make sure that `gem install danger-swiftlint -v '0.24.2' --source 'https://rubygems.org/'` succeeds before bundling.
Update
As I was writing this issue, I kept trying bundle install
every couple minutes to see if anything would change, and sure enough it was able to install successfully. It's working now both on our CI and on my local machine. Not sure if someone fixed the issue right after it happened or if it was some random issue with downloading that zip from github, but waiting a couple minutes was all I needed. 🤦 I'll leave this comment up in case anyone else runs into this issue.
Update to the update Around half an hour later it started failing again with the same issue 😭
Gosh! That looks super weird 😞 .
Could it be possible that there was some error on the binary on the SwiftLint or GitHub side? The error seems to suggest some kind of corruption in the .zip
file...
This turned out to be a problem with bundler. Deleting folders like ~/.gem
and ~/.bundle
worked for me.
Although this problem comes back pretty quickly. I'm running into this in my CI environment, which can run multiple jobs in parallel. My suspicion right now are:
bundle install
at the same time would either corrupt shared files at the locations mentioned abovebundle install
fail because some shared files are lockedI have no proof though :/
@allen-zeng thanks for the info.
Can you share the config for your CI? It might be that this race condition of sort can be avoided by rearranging some of the steps.
@mokagio I'm using Jenkins pipeline to run scripts in CI. Each agent could be executing 2 jobs concurrently, so that might be where the source of the race condition, if it's a race condition.
Weirdly, this doesn't happen much any more, although it was happening consistently last week, which led me here 🤷
Hello, I'm also seeing exactly the same issue. I tried to force to the 0.24.2 version in the gemfile, and it worked.
Getting this issue when hile installing danger-swiftlint