fastfetch-cli / fastfetch

Like neofetch, but much faster because written mostly in C.
MIT License
8.02k stars 347 forks source link

[BUG] archlinux package is built unoptimized #1064

Closed CarterLi closed 1 day ago

CarterLi commented 2 days ago

@Antiz96

-DCMAKE_BUILD_TYPE='None'

https://gitlab.archlinux.org/archlinux/packaging/packages/fastfetch/-/blob/main/PKGBUILD?ref_type=heads#L57

As far as I know, None is not a standard CMAKE_BUILD_TYPE option. I can't find the build log of arch packages. I tested the option locally and fastfetch was built without -Ox and -DNDEBUG specified, therefore, unoptimized.

Is there any reason for that? If not, I suggest using -DCMAKE_BUILD_TYPE=RelWithDebInfo (which is the default option if not specified), so core dump will be generated with debug info if fastfetch crashes.

Antiz96 commented 2 days ago

Hey,

-DCMAKE_BUILD_TYPE='None' is part of our CMake packaging guidelines, we have some explanations about why we use that here (according to it, None is actually the default CMake build type).

When it comes to -Ox, the current default on Arch side is -O2.
As for debug info, Arch provides separate -debug packages that one can install to generate core dump with debug info. The fastfetch one can be downloaded at https://geo.mirror.pkgbuild.com/extra-debug/os/x86_64/fastfetch-debug-2.17.1-1-x86_64.pkg.tar.zst.

You can check the build logs for fastfecth here (CTRL + F on "Starting build()" :wink:).

Let me know if that covers your concerns or not :slightly_smiling_face:

CarterLi commented 1 day ago

/usr/bin/fastfetch --version prints fastfetch 2.17.1-debug (x86_64)

Which suggests NDEBUG is not defined

You can check the build logs for fastfecth here (CTRL + F on "Starting build()" 😉).

Well you can only see Building C object CMakeFiles/libfastfetch.dir/* but no actual gcc arguments

Antiz96 commented 1 day ago

/usr/bin/fastfetch --version prints fastfetch 2.17.1-debug (x86_64)

Which suggests NDEBUG is not defined

Indeed, sorry that I missed that. I made the switch to -DCMAKE_BUILD_TYPE=RelWithDebInfo. I guess in fastfetch's specific case it makes sense diverging from our guidelines and using that over the None build type.

CarterLi commented 1 day ago

Thanks