Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

[BUG] Installing uwufetch on FreeBSD breaks system package manager #252

Open
kittybwained opened this issue Mar 1, 2024 · 8 comments
Open

Comments

@kittybwained
Copy link

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
Copy link
Author

It also seems to break freebsd-update too.

@kittybwained
Copy link
Author

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.

@ad-oliviero
Copy link
Owner

ad-oliviero commented Mar 2, 2024

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

@kittybwained
Copy link
Author

(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.

@evelinwillow
Copy link

the most wholesome bug report ever filed on github

@ad-oliviero
Copy link
Owner

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

@kittybwained
Copy link
Author

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.

@ad-oliviero
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants