FS#67790 - [zsh-theme-powerlevel10k] internal libgit2 fork built with debug configuration

Attached to Project: Community Packages
Opened by Robert Cegliński (codicodi) - Tuesday, 01 September 2020, 11:19 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:01 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No


When compiling package, one encounters a wall of warnings like:

/usr/include/features.h:397:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
397 | # warning _FORTIFY_SOURCE requires compiling with optimization (-O)

This is because default configuration in CMakeLists.txt[1] is Debug and Arch's -O2 gets overriden with -O0. Attached patch fixes this issue by passing -DCMAKE_BUILD_TYPE=None to CMake invocation.

Package version: 1.12.0-3

[1] https://github.com/romkatv/libgit2/blob/master/CMakeLists.txt#L274-L276
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:01 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/zsh-theme-powerlevel10 k/issues/1
Comment by Christian Rebischke (Shibumi) - Friday, 02 July 2021, 13:48 GMT
Doesn't this interfere with FFY00's comment about using the correct CMAKE_BUILD_TYPE? See also: https://github.com/romkatv/powerlevel10k/pull/786#issuecomment-872708776
Comment by Robert Cegliński (codicodi) - Friday, 02 July 2021, 15:44 GMT
FFY00 is right that ideally CMakeLists.txt shouldn't touch that variable at all. However, since it does, that variable needs to be overridden in PKGBUILD. Note that currently (with Debug configuration) both optimizations and hardening options are disabled (as indicated in warning message in my report).

Wiki explains all the details pretty well: https://wiki.archlinux.org/title/CMake_package_guidelines#Fixing_the_automatic_optimization_flag_override
Comment by Filipe Laíns (FFY00) - Friday, 02 July 2021, 17:45 GMT
I think the best fix is as proposed in the bug, passing -DCMAKE_BUILD_TYPE=None.
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.