uwufetch icon indicating copy to clipboard operation
uwufetch copied to clipboard

[BUG] Installing uwufetch on FreeBSD breaks system package manager

Open kittybwained opened this issue 2 years ago • 8 comments

Describe the bug If you build and install uwufetch on FreeBSD, it overwrites the system libfetch (which is for a program called fetch, it's used for grabbing files over HTTP and FTP) with uwufetch's libfetch. This breaks the system package manager (pkg) and fetch.

To Reproduce Make and make install uwufetch on FreeBSD

Expected behavior For the system package manager to not break, and uwufetch to install stuff in /usr/local.

Desktop (please complete the following information): OS: FreeBSD Version: 14.0-RELEASE-p5

Additional context I compared the strings on the broken system libfetch with the one uwufetch built and they matched, so I'm pretty sure it's what's happening. I also ran it through ghidra and it has functions like get_ram, get_sys, get_model and such.

Are you already working on this bug? No

kittybwained avatar Mar 01 '24 09:03 kittybwained

It also seems to break freebsd-update too.

kittybwained avatar Mar 01 '24 09:03 kittybwained

I'd suggest changing the Makefile to install binaries in /usr/local/bin, libraries in /usr/local/lib, and config files to /usr/local/etc. All the /usr versions of these directories are for the base system, and not third party applications.

kittybwained avatar Mar 01 '24 23:03 kittybwained

it overwrites the system libfetch (which is for a program called fetch, it's used for grabbing files over HTTP and FTP) with uwufetch's libfetch. This breaks the system package manager (pkg) and fetch.

Well, fuck (I'm sorry if I broke your system)

I compared the strings on the broken system libfetch with the one uwufetch built and they matched, so I'm pretty sure it's what's happening. I also ran it through ghidra and it has functions like get_ram, get_sys, get_model and such.

Yes, that's for sure what's happening

I'd suggest changing the Makefile to install binaries in /usr/local/bin, libraries in /usr/local/lib, and config files to /usr/local/etc. All the /usr versions of these directories are for the base system, and not third party applications.

Sounds like a good solution, I will implement it as soon as I can, and it will be available in the next release (or in the developer branch). Do you recommend using this directories for other systems too? Is there something like a standard for installing non-system libraries?

Also, sorry for my late response, I'm preparing a couple exams

ad-oliviero avatar Mar 02 '24 19:03 ad-oliviero

(I'm sorry if I broke your system)

It's all good, I managed to recover it without needing to reinstall. Plus it was kinda fun to diagnose what the issue was.

Is there something like a standard for installing non-system libraries?

Usually third party applications install stuff in the /usr/local prefix, I'd suggest reading the hier(7) manpage for the platforms you support building on.

kittybwained avatar Mar 02 '24 20:03 kittybwained

the most wholesome bug report ever filed on github

evelinwillow avatar Mar 02 '24 21:03 evelinwillow

It's all good, I managed to recover it without needing to reinstall. Plus it was kinda fun to diagnose what the issue was.

I'm glad to know

Usually third party applications install stuff in the /usr/local prefix, I'd suggest reading the hier(7) manpage for the platforms you support building on.

That's exactly what I was hoping for, I'll look into it

ad-oliviero avatar Mar 03 '24 20:03 ad-oliviero

Just discovered another file that got replaced, /usr/include/fetch.h got replaced by UwUFetch's own fetch.h too. Are there any other files uwufetch installs in /usr? I don't really want to run make uninstall cause it might just delete system files.

kittybwained avatar Mar 03 '24 21:03 kittybwained

Are there any other files uwufetch installs in /usr?

Yes:

  • uwufetch in /usr/bin
  • libfetch.so and libfetch.a in /usr/lib
  • fetch.h in /usr/include
  • res/* in /usr/lib/uwufetch
  • ./uwufetch.1.gz in /usr/share/man/man1

ad-oliviero avatar Mar 03 '24 21:03 ad-oliviero