Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#69488 - PKGBUILD processing. CFLAGS, CXXFLAGS and LDFLAGS aren't exported during `prepare()`

Attached to Project: Pacman
Opened by Alex (hurufu) - Sunday, 31 January 2021, 16:10 GMT
Last edited by Eli Schwartz (eschwartz) - Sunday, 31 January 2021, 16:32 GMT
Task Type Bug Report
Category Packages: Core
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 0
Private No

Details

Build customization variables that are defined in /etc/makepkg.conf, like CXXFLAGS aren't exported during prepare() phase.

The problem is actually visible for most CMake projects. If you wish to use custom CXXFLAGS then this variable should be available during first run of cmake: https://cmake.org/cmake/help/latest/envvar/CXXFLAGS.html, but it's absent during prepare() - the most obvious place for cmake invocation.

So, imho in order to fix this either all cmake invocations for all projects should be moved to build() function or makepkg should export *FLAGS variables during prepare().

Steps to reproduce:
0. Make sure that CFLAGS and friends are defined in /etc/makepkg.conf
1. Download minimal PKGBUILD from the attachments
2. Run `makepkg`
3. Observe output: package() fails because *FLAGS variables are absent

Additional info:
* makepkg version v5.2.2
   PKGBUILD (0.2 KiB)
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Sunday, 31 January 2021, 16:32 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Intentional
Comment by Alex (hurufu) - Sunday, 31 January 2021, 16:12 GMT
Short correction: prepare() fails, not package().
Comment by Eli Schwartz (eschwartz) - Sunday, 31 January 2021, 16:30 GMT
  • Field changed: Attached to Project (Arch Linux → Pacman)
This is relevant to pacman, not Arch repos.
Comment by Eli Schwartz (eschwartz) - Sunday, 31 January 2021, 16:32 GMT
This is also intentional, e.g.  FS#69040 

prepare() is explicitly intended for post-auto-extraction setup of the source directory e.g. applying patches ONLY.

It MUST NOT be used for running ./configure or cmake or meson -- as, indeed, the official repo packages do not do.

Loading...