Recently something changed on GitHub Actions and we're not sure what happened or how to resolve it. We are testing and building iOS apps and have SwiftLint in place for our automatic PR checks.
For months our job configuration worked like a charm but about a 1.5 weeks ago things started to get flaky. Sometimes it runs through, sometimes it doesn't.
We used to have this in our run-tests.yml file:
run-tests.yml
- name: Install SwiftLint run: brew install swiftlint
9 days ago tests suddenly started to fail at this step. Here are the logs from GitHub Actions:
==> Pouring swiftlint-0.42.0.catalina.bottle.tar.gz Error: The brew link step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/swiftlint Target /usr/local/bin/swiftlint already exists. You may want to remove it: rm '/usr/local/bin/swiftlint' To force the link and overwrite all conflicting files: brew link --overwrite swiftlint To list all files that would be deleted: brew link --overwrite --dry-run swiftlint Possible conflicting files are: /usr/local/bin/swiftlint ==> Summary ?? /usr/local/Cellar/swiftlint/0.42.0: 6 files, 12.2MB Error: Process completed with exit code 1.
==> Pouring swiftlint-0.42.0.catalina.bottle.tar.gz
Error: The brew link step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/swiftlint Target /usr/local/bin/swiftlint already exists. You may want to remove it: rm '/usr/local/bin/swiftlint'
brew link
To force the link and overwrite all conflicting files: brew link --overwrite swiftlint
To list all files that would be deleted: brew link --overwrite --dry-run swiftlint
Possible conflicting files are: /usr/local/bin/swiftlint
==> Summary ?? /usr/local/Cellar/swiftlint/0.42.0: 6 files, 12.2MB Error: Process completed with exit code 1.
After doing some research, looking at the error message and seeing that other jobs run through successfully (meaning SwiftLint could be installed properly) we decided to have a failsafe in place: try to link an existing SwiftLint and if that fails simply install it:
- name: Link SwiftLint or install it run: brew link --overwrite swiftlint || brew install swiftlint
This worked for a few days and yesterday this cropped up again. The error logs confuse us so we decided to ask here whether others are experiencing this as well and how to solve this. Error logs:
Run brew link --overwrite swiftlint || brew install swiftlint Error: No such keg: /usr/local/Cellar/swiftlint ==> Downloading https://homebrew.bintray.com/bottles/swiftlint-0.42.0.catalina.bottle.tar.gz ==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/e9023ed754eb8cb78a9f2b469a90875ca42a7afffd3e96f8142252e81d889793?response-content-disposition=attachment%3Bfilename%3D%22swiftlint-0.42.0.catalina.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHAqOi8vZDI5dnprNG93MDd3aTcuY2xvdWRmcm9udC5uZXQvZTkwMjNlZDc1NGViOGNiNzhhOWYyYjQ2OWE5MDg3NWNhNDJhN2FmZmZkM2U5NmY4MTQyMjUyZTgxZDg4OTc5Mz9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPWF0dGFjaG1lbnQlM0JmaWxlbmFtZSUzRCUyMnN3aWZ0bGludC0wLjQyLjAuY2F0YWxpbmEuYm90dGxlLnRhci5neiUyMiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTYxMTgzMjUzNH0sIklwQWRkcmVzcyI6eyJBV1M6U291cmNlSXAiOiIwLjAuMC4wLzAifX19XX0_&Signature=lH2~FMqNvi1jQxbtgvCFQoZPh3SFuZa3JCgsZ1h3cie4zpArrLUxmRU6OpNk0tgEJ9y3IWpYtBs6xz-NsyeYgZQkbwLGjPA42wBxzT2CfaOgCXlUEK6a7ve5ar7NwOOOUBmr1ypkraZkAP3OVEZ89TFj-ztS8rhGrUNQ3juJOKj11V-SSn07zZVuKwbNsLHqsjHSjqigrRHDng3lQPUE-al~coYbjTED2n87I4lbWSM2m9x30C-vrE5rrKHMyAqgTMiPxECz9ml8pMAuxisNNhLVsg2QySRsw5VtIjJi1h0WglzxHai37yV6fnzuuduDzlhPxtFx1jnvNEkpU5~mGg__&Key-Pair-Id=APKAIFKFWOMXM2UMTSFA ==> Pouring swiftlint-0.42.0.catalina.bottle.tar.gz Error: The brew link step did not complete successfully The formula built, but is not symlinked into /usr/local Could not symlink bin/swiftlint Target /usr/local/bin/swiftlint already exists. You may want to remove it: rm '/usr/local/bin/swiftlint' To force the link and overwrite all conflicting files: brew link --overwrite swiftlint To list all files that would be deleted: brew link --overwrite --dry-run swiftlint Possible conflicting files are: /usr/local/bin/swiftlint ==> Summary ?? /usr/local/Cellar/swiftlint/0.42.0: 6 files, 12.2MB Error: Process completed with exit code 1.
Run brew link --overwrite swiftlint || brew install swiftlint
Error: No such keg: /usr/local/Cellar/swiftlint
==> Downloading https://homebrew.bintray.com/bottles/swiftlint-0.42.0.catalina.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/e9023ed754eb8cb78a9f2b469a90875ca42a7afffd3e96f8142252e81d889793?response-content-disposition=attachment%3Bfilename%3D%22swiftlint-0.42.0.catalina.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6Imh0dHAqOi8vZDI5dnprNG93MDd3aTcuY2xvdWRmcm9udC5uZXQvZTkwMjNlZDc1NGViOGNiNzhhOWYyYjQ2OWE5MDg3NWNhNDJhN2FmZmZkM2U5NmY4MTQyMjUyZTgxZDg4OTc5Mz9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPWF0dGFjaG1lbnQlM0JmaWxlbmFtZSUzRCUyMnN3aWZ0bGludC0wLjQyLjAuY2F0YWxpbmEuYm90dGxlLnRhci5neiUyMiIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTYxMTgzMjUzNH0sIklwQWRkcmVzcyI6eyJBV1M6U291cmNlSXAiOiIwLjAuMC4wLzAifX19XX0_&Signature=lH2~FMqNvi1jQxbtgvCFQoZPh3SFuZa3JCgsZ1h3cie4zpArrLUxmRU6OpNk0tgEJ9y3IWpYtBs6xz-NsyeYgZQkbwLGjPA42wBxzT2CfaOgCXlUEK6a7ve5ar7NwOOOUBmr1ypkraZkAP3OVEZ89TFj-ztS8rhGrUNQ3juJOKj11V-SSn07zZVuKwbNsLHqsjHSjqigrRHDng3lQPUE-al~coYbjTED2n87I4lbWSM2m9x30C-vrE5rrKHMyAqgTMiPxECz9ml8pMAuxisNNhLVsg2QySRsw5VtIjJi1h0WglzxHai37yV6fnzuuduDzlhPxtFx1jnvNEkpU5~mGg__&Key-Pair-Id=APKAIFKFWOMXM2UMTSFA
Possible conflicting files are: /usr/local/bin/swiftlint ==> Summary ?? /usr/local/Cellar/swiftlint/0.42.0: 6 files, 12.2MB
Error: Process completed with exit code 1.
So first it says it can't link an existing SwiftLint. OK. Then it proceeds to download it.. and then it says it cannot link because it's already there?!
Sure we could go ahead and try the following:
- name: Link SwiftLint or install it run: brew link --overwrite swiftlint || brew install swiftlint || brew link --overwrite swiftlint
But this seems too hacky and there must be some better solution to this.
Ideas and solutions very much appreciated.
Actually it seems the solution is pretty simple and obvious. Looking at the latest virtual macOS environments of GitHub Actions I saw that SwiftLint now comes preinstalled.
It's just weird that on some VMs Homebrew was able to install SwiftLint and on others it couldn't. I would expect this step to either work on all machines or fail on all machines.
Anyway, just removing the link/install step solved this issue for now.
1.4m articles
1.4m replys
5 comments
57.0k users