Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#31389 - [nvidia-utils] Building fails in a directory with dots and numbers

Attached to Project: Arch Linux
Opened by Kristian Laakkonen (krisse7) - Sunday, 02 September 2012, 16:23 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Sunday, 29 June 2014, 15:06 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Ionut Biru (wonder)
Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:

Building nvidia-utils fails when trying to build the package in a directory whose path contains dots and numbers. This is because when version numbers are stripped from .so files when making symbolic links, everything after the first dot and number is removed (in this case part of the directory name). The line 30 in PKGBUILD is the culprit:
[[ -e "${_soname/.[0-9]*/}" ]] || ln -s "$(basename "${_soname}")" "${_soname/.[0-9]*/}"

Maybe something like this could be used instead to remove the numbers only from the end:
linkname="${_soname}"
# if the path component after last slash contains .so, remove everything after it
[[ "${linkname##*\/}" == *.so.* ]] && linkname="${_soname%.so.*}.so"
[[ -e "${linkname}" ]] || ln -s "$(basename "${_soname}")" "${linkname}"

Looks like the package lib32-nvidia-utils could also be affected by this.

Additional info:
* nvidia-utils 304.43-1


Steps to reproduce:
$ mkdir nvidia-utils-304.43 && cd nvidia-utils-304.43
$ wget "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/PKGBUILD?h=packages/nvidia-utils" -O PKGBUILD
$ makepkg -s
...
==> Starting package_nvidia-utils()...
ln: failed to create symbolic link '/home/user/temp/nvidia-utils-304': File exists
==> ERROR: A failure occurred in package_nvidia-utils().
Aborting...

This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Sunday, 29 June 2014, 15:06 GMT
Reason for closing:  Implemented
Additional comments about closing:  If there still is a problem, please reopen.
Comment by Daniel Wallace (gtmanfred) - Sunday, 02 September 2012, 16:30 GMT
use abs instead of wget and see if you still get the error
Comment by Dave Reisner (falconindy) - Sunday, 02 September 2012, 16:40 GMT
Of course he will.

mkdir this.dir.has.dots
cd !$
ABSROOT=. abs extra/nvidia-utils
cd !$
makepkg
Comment by Gerardo Exequiel Pozzi (djgera) - Saturday, 15 February 2014, 00:01 GMT
  • Field changed: Status (Assigned → Waiting on Response)
status?
Comment by (Det) - Sunday, 09 March 2014, 12:18 GMT
Same messy function as back when it was added.
Comment by Doug Newgard (Scimmia) - Wednesday, 02 April 2014, 14:44 GMT
Status? The package has changed drastically, the command in question is now gone.

Edit: Sorry, it's not gone, I just missed it.
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 09 June 2014, 00:00 GMT
If you give me a patch for all affected packages, I shall fuse it with the package!
Comment by Kristian Laakkonen (krisse7) - Friday, 13 June 2014, 19:38 GMT
Here are patches for the affected packages (nvidia-utils, nvidia-304xx-utils, lib32-nvidia-utils, lib32-nvidia-304xx-utils).
Comment by (Det) - Saturday, 14 June 2014, 08:53 GMT
I would go on about it as something like this (includes some other random consistency fixes as well):
Comment by Kristian Laakkonen (krisse7) - Saturday, 14 June 2014, 15:02 GMT
The above patch by Det fails if building is done in a directory with a name like nvidia-utils.so.337
Comment by (Det) - Saturday, 14 June 2014, 20:56 GMT
If that's somehow going to be an issue, then you should just give up the parameter expansion, and replace the _base with, e.g.: _base=$(echo ${_soname} | sed -r 's/.[0-9]+$//')
Comment by Sven-Hendrik Haase (Svenstaro) - Tuesday, 24 June 2014, 21:31 GMT
This does not produce the same results.

Without patch I get:

lrwxrwxrwx 1 root root 23 24. Jun 23:24 /usr/lib/libnvidia-tls.so -> libnvidia-tls.so.337.25
-rwxr-xr-x 1 root root 13K 24. Jun 23:24 /usr/lib/libnvidia-tls.so.337.25

with patch I get:

lrwxrwxrwx 1 root root 23 24. Jun 23:24 /usr/lib/libnvidia-tls.so.337 -> libnvidia-tls.so.337.25
-rwxr-xr-x 1 root root 13K 24. Jun 23:24 /usr/lib/libnvidia-tls.so.337.25
Comment by (Det) - Wednesday, 25 June 2014, 10:44 GMT
But we all know this set is the one that works:
Comment by Sven-Hendrik Haase (Svenstaro) - Wednesday, 25 June 2014, 15:14 GMT
But we will still need the base .so names there and point at something. Currently I'd be breaking compatibility. We have something.so.maj -> something.so.maj.min but we also need something.so -> something.so.maj.
Comment by (Det) - Wednesday, 25 June 2014, 15:30 GMT
Can you show me a case where that's happening?

The first line should create the soname link (e.g. libnvidia-cfg.so.1):

[[ -e "${_soname}" ]] || ln -s $(basename "${_lib}") "${_soname}"

And the latter one the base link (libnvidia-cfg.so):

[[ -e "${_base}" ]] || ln -s $(basename "${_soname}") "${_base}"

E: Oh, did you get that last description as if "but still, it works, so I refuse to change it"? I actually was just trying to be funny, because this was the second time I had to edit it.

Loading...