badge icon indicating copy to clipboard operation
badge copied to clipboard

The badge is broken due to librsvg

Open changLiuUNSW opened this issue 5 years ago • 31 comments

I just installed badge in my new machine today and after run badge command the icon become broken, but it works fine on my old machine.

before Screen Shot 2019-08-09 at 10 30 48 pm

after Screen Shot 2019-08-09 at 10 29 12 pm

changLiuUNSW avatar Aug 09 '19 12:08 changLiuUNSW

After some research, the issue is caused by pango 1.44.3 which is one of the dependencies of librsvg, because It was working fine with pango 1.42.4. I cannot raise the issue on their github page https://github.com/GNOME/pango, because they disabled it.

changLiuUNSW avatar Aug 09 '19 13:08 changLiuUNSW

The workaround for now is to uninstall librsvg and use default graphicsmagick

changLiuUNSW avatar Aug 09 '19 13:08 changLiuUNSW

@changLiuUNSW same issue. do you find any solution with using librsvg ? I found this link https://gitlab.gnome.org/GNOME/pango/issues

techinpark avatar Aug 17 '19 16:08 techinpark

@techinpark no solution.

Can we raise the issue to that link?

changLiuUNSW avatar Aug 18 '19 01:08 changLiuUNSW

The workaround for now is to uninstall librsvg and use default graphicsmagick

Could you tell me how to use graphicsmagick? I uninstalled librsvg but I get this error:

INFO [2019-08-29 18:16:36.32]: Start adding badges...
DEBUG [2019-08-29 18:16:36.32]: Trying to load image from shields.io. Timeout: 10s
DEBUG [2019-08-29 18:16:36.32]: URL: https://img.shields.io/badge/1.7-40-blue.png
ERROR [2019-08-29 18:16:36.54]: Error validating image from shields.io. Use --verbose for more info
INFO [2019-08-29 18:16:36.54]: Waiting for 10s and retry to load image from shields.io tries remaining: 5
WARN [2019-08-29 18:16:46.55]: Install RSVG to get better results for shields on top of your icon
WARN [2019-08-29 18:16:46.55]: 
WARN [2019-08-29 18:16:46.55]: Install it using (RSVG):
INFO [2019-08-29 18:16:46.55]: $ brew install librsvg

julianch avatar Aug 29 '19 21:08 julianch

@julianch have you installed graphicsmagick? brew install graphicsmagick

PatrickDotStar avatar Aug 30 '19 08:08 PatrickDotStar

brew install graphicsmagick

@PatrickDotStar Yes, I have graphicsmagick installed and I'm still getting that error.

julianch avatar Aug 30 '19 13:08 julianch

I am experiencing the same error as @julianch . I have graphicsmagick 1.3.33 installed. Sadly this does not seem to be a workaround (or might need some more configuration I am not aware of).

Gremkow avatar Sep 04 '19 05:09 Gremkow

@julianch how to you run badge? fastlane plugin or standalone ?

techinpark avatar Sep 04 '19 05:09 techinpark

add_badge(
	dark: true,
	shield: "Version-#{options[:app_version]}-blue",
	glob: "/path/to/png"
)

I use badge inside the fastfile like this.

Gremkow avatar Sep 04 '19 06:09 Gremkow

@Gremkow (cc @julianch ) In my case, i have same problem like yours.

Solution

  1. Open Terminal and make badge icon
  • badge --shield Version-#{app_version}-blue -- dark
  1. remove add_badge line in fastfile

techinpark avatar Sep 04 '19 06:09 techinpark

@techinpark Thanks for your advice, when trying to run your command (with a removed whitespace between -- and dark) inside the folder containing the .png, badge does not find any icons. Anyway, we will probably need to get a solution using the fastfile, since running manual commands is not something we want to do in our automation process, if possible. If we find a solution to this which works for us I will update you.

Gremkow avatar Sep 04 '19 08:09 Gremkow

using librsvg solved but the badges look blury, any idea to make them less blury?

filipef101 avatar Sep 04 '19 09:09 filipef101

I got it working by

  • manually deleting /usr/local/Cellar/pango
  • manually deleting /usr/local/Cellar/librsvg

Copying /usr/local/Cellar/pango & /usr/local/Cellar/librsvg from a working machine (older formula versions: librsvg 2.44.14_1, pango 1.42.4_2) to a non working machine.

  • running brew link pango
  • running brew link librsvg

This might be a work around if you have access to the older version on another machine, but this is not recommend since I don't know what I'm doing with homebrew and you will probably break something and definetly wont be able to update these packages out-of-the-box later on. Simply posting this for people that maybe REALLY need it right now and have access to old files.

Gremkow avatar Sep 06 '19 09:09 Gremkow

Easiest solution if you're using homebrew: brew switch pango 1.42.4_1

wiedem avatar Sep 24 '19 11:09 wiedem

Easiest solution if you're using homebrew: brew switch pango 1.42.4_1

This only works if you had it previously installed (and did not get removed via some kind of cleanup), right?

Gremkow avatar Sep 24 '19 11:09 Gremkow

This only works if you had it previously installed (and did not get removed via some kind of cleanup), right?

Yes.

In case you've already cleaned up version 1.42.4_1, run the following command first: brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/7cf3b63be191cb2ce4cd86f4406915128ec97432/Formula/pango.rb

wiedem avatar Sep 24 '19 12:09 wiedem

@wiedem Thanks for solution!

Here is my solution. open the Terminal and type it commands.

Solution

brew install librsvg 
brew unlink pango  
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/7cf3b63be191cb2ce4cd86f4406915128ec97432/Formula/pango.rb
brew switch pango 1.42.4_1 
  • Enjoy it :tada:

techinpark avatar Sep 25 '19 05:09 techinpark

@techinpark The 'alpha' or 'beta' label no more generate.

adelmojunnior avatar Oct 04 '19 14:10 adelmojunnior

I've reported this:

And the underlying issue may be connected to the fact that in pango 1.44, they have replaced cairo by harfbuzz for getting glyph extents: https://github.com/harfbuzz/harfbuzz/issues/1892

aitor avatar Oct 16 '19 22:10 aitor

Solution brew uninstall librsvg brew uninstall pango

CMJunghoon avatar Feb 28 '20 07:02 CMJunghoon

Is anyone experiencing issues with brew install librsvg? We're using @techinpark and our CI started failing there out of the blue with no visible error.

marcosgriselli avatar Jul 14 '20 21:07 marcosgriselli

@marcosgriselli Happened to me a couple of days ago. I used the built in brew install step of Bitrise and some caching which I disabled and replaced everything related to librsvg with a shell script:

brew install librsvg
brew link librsvg

if [ -d "/usr/local/Cellar/pango/1.42.4_2" ]
then
   brew link pango
else
   brew unlink pango
   brew install --build-from-source https://raw.githubusercontent.com/Homebrew/homebrew-core/a8ac7ea5/Formula/pango.rb
fi

I don't know if it helps (I think it's been posted before)

fruitcoder avatar Jul 14 '20 22:07 fruitcoder

@fruitcoder thanks! You pushed me in the right direction. I was using the script step but left the set -e line which was probably reporting a false error and failed the step with no reason. Removed it and the installation is working again and the badge looks perfect.

marcosgriselli avatar Jul 15 '20 02:07 marcosgriselli

I can confirm that, although the reported issues are still open, pango 1.46.1 fixed the font tracking problem for us and we are using off-the-shelf dependencies configuration again for badge. If the correct behavior is reproduced for more people maybe this issue can be closed.

aitor avatar Sep 15 '20 08:09 aitor

I came across the issue today and i resolved it with:

brew upgrade librsvg

Thanks @aitor for the effort here

leonardarnold avatar Sep 16 '20 09:09 leonardarnold

I can confirm that the stable version of pango is working and the issue could be closed

fruitcoder avatar Sep 17 '20 11:09 fruitcoder

I can also confirm this is no longer an issue with the latest version of librsvg on homebrew. I think this can be closed

benkane avatar Sep 17 '20 14:09 benkane

I can confirm this issue has been fixed on my side as well!

hahtml avatar Sep 18 '20 03:09 hahtml

brew install --build-from-source https://raw.githubusercontent.com/Homebrew/homebrew-core/a8ac7ea5/Formula/pango.rb ==> Error: Calling Installation of pango from a GitHub commit URL is disabled! Use 'brew extract pango' to stable tap on GitHub instead.

phisakel avatar Nov 11 '20 13:11 phisakel

@phisakel straight up brew install librsvg works now and will give you a working version of pango. No need to manually install a different version of pango after

benkane avatar Nov 11 '20 13:11 benkane