Skip to content

Deprecated brew tap-pin usage consistently fails CI if cache is not present #266

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

Closed
mbdevpl opened this issue Dec 7, 2019 · 4 comments · Fixed by #267
Closed

Deprecated brew tap-pin usage consistently fails CI if cache is not present #266

mbdevpl opened this issue Dec 7, 2019 · 4 comments · Fixed by #267

Comments

@mbdevpl
Copy link
Contributor

mbdevpl commented Dec 7, 2019

Expected behaviour

After forking, I expected the CI to work in the fork.

Actual behaviour

Builds are consistently failing due to usage of deprecated (see https://brew.sh/2019/04/04/homebrew-2.1.0/ and Homebrew/brew#5925) brew tap-pin functionality.

The problem is in line 101 of travis_config.sh:

brew tap --list-pinned | grep -qxF cartr/qt4 || brew tap-pin cartr/qt4

In the main repo, the first part brew tap --list-pinned | grep -qxF cartr/qt4 always succeeds, I assume because the cache always kicks in.

In the fork however, it always falls through to brew tap-pin cartr/qt4 because there is no cache, and then it always fails, so cache is never created. If only I could escape this catch 22 ;)

Steps to reproduce

  1. Fork the repo.
  2. Enable Travis CI builds for the fork.
  3. Trigger a build.
  4. See it crash and burn.

Bunch of examples: https://travis-ci.com/mbdevpl/opencv-python/builds

One specific log: https://travis-ci.com/mbdevpl/opencv-python/jobs/263773575 - in this build no changes have been made in the fork whatsoever, it's simply a build of current master branch.

Solution idea

I guess one quick solution to try would be to use:

brew tap-pin cartr/qt4/formula_name_here

But unfortunately as I am unfamiliar with the opencv-python CI setup, I have no idea about what should be in the formula_name_here. Would any one of maintainers be able to provide ideas to try?

@mbdevpl
Copy link
Contributor Author

mbdevpl commented Dec 7, 2019

And after I solve this in my fork, I'd like to submit a PR so that other new forks don't get stuck on this issue in the future.

mbdevpl added a commit to mbdevpl/opencv-python that referenced this issue Dec 7, 2019
instead refer to the full package name when installing

fixes opencv#266

context:
https://brew.sh/2019/04/04/homebrew-2.1.0/
Homebrew/brew#5925
skvark added a commit that referenced this issue Dec 7, 2019
Fix for #266 - don't use deprecated brew tap-pin, instead refer to the full package name when installing
@mbdevpl
Copy link
Contributor Author

mbdevpl commented Dec 9, 2019

@skvark Thanks for merging! You might wanna trigger a new build so that cache is fully re-generated because of:

https://travis-ci.org/skvark/opencv-python/jobs/622109414

Building dependencies took too long. Restart the build in Travis UI to continue from cache.

@mbdevpl
Copy link
Contributor Author

mbdevpl commented Dec 9, 2019

I had click there myself once as well to finish setting up the initial cache. I think somehow the pull request might have triggered a cache rebuild for the main repo...

@skvark
Copy link
Member

skvark commented Dec 9, 2019

Ah, yes. I cleared the Travis cache because if there's a long time between builds homebrew recipes fail to update sometimes which makes the cache build fail.

skvark pushed a commit that referenced this issue Jan 9, 2020
instead refer to the full package name when installing

fixes #266

context:
https://brew.sh/2019/04/04/homebrew-2.1.0/
Homebrew/brew#5925
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants