[MDEV-20053] galera_recovery: Wrong @sbindir@ Created: 2019-07-12  Updated: 2023-04-11

Status: Open
Project: MariaDB Server
Component/s: Galera, Packaging
Affects Version/s: 10.4.6
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Noel Kuntze Assignee: Julius Goryavsky
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Arch Linux
GCC 9.1.0


Issue Links:
Relates
relates to MDEV-12301 Use macro in scripts/galera_recovery.sh Closed

 Description   

The (c)make scripts generate a wrong sbindir path.
With
-DCMAKE_INSTALL_PREFIX=/usr
-DINSTALL_SCRIPTDIR=bin

It generates an sbindir in galera_recovery of "./bin", which breaks galera_recovery, because "./bin" is a relative path to the current working directory. If the wd of the calling process is not /, then the script breaks at that point.

Build files are available at https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/mariadb



 Comments   
Comment by Jan Lindström (Inactive) [ 2019-12-09 ]

I do not have Arch Linux easily available so can you explain why @sbindir@ is incorrect ?

Comment by Noel Kuntze [ 2019-12-09 ]

The problem is a general one, not specific to Arch.
The generated sbindir has to be "/usr/bin" (meaning the PREFIX has to be applied, too!) with the aforementioned parameters. Otherwise galera_recovery will fail if the current directory (working directory) is not the root directory, because the relative path "./bin" is not equal to "/bin".

Comment by Christian Hesse [ 2022-04-25 ]

The prefix is added only if `INSTALL_LAYOUT` matches "`STANDALONE`".
This comes from `scripts/CMakeLists.txt`, starting around line 189.

Comment by Noel Kuntze [ 2022-04-25 ]

New link to files used to build mariadb for Arch: https://github.com/archlinux/svntogit-packages/blob/master/mariadb/trunk/PKGBUILD

Generated at Thu Feb 08 08:56:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.