Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 918933 - dev-php/theseer-Autoload-1.26.3-r1: Failure in src_prepare due to symlinks into real root directory
Summary: dev-php/theseer-Autoload-1.26.3-r1: Failure in src_prepare due to symlinks in...
Status: CONFIRMED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-01 08:55 UTC by Moritz Brunner
Modified: 2023-12-07 08:14 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to add $EPREFIX to symlink destination (dev-php-theseer-Autoload-Do-not-symlink-outside-of-EPREFIX.patch,1.87 KB, patch)
2023-12-06 18:51 UTC, Moritz Brunner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Brunner 2023-12-01 08:55:56 UTC
In the ebuild's src_prepare function, in order to bootstrap phpab, three symlinks to various third-party PHP modules are created. However, the symlinks do not take $EPREFIX into account, and instead link directly to /usr/share/xyz outside of Prefix:

> ln -s /usr/share/php/TheSeer/DirectoryScanner	vendor/theseer/directoryscanner/src || die
> ln -s /usr/share/php/ezc/Base			vendor/zetacomponents/base/src || die
> ln -s /usr/share/php/ezc/ConsoleTools		vendor/zetacomponents/console-tools/src  || die


Subsequently, the remaining actions in the prepare step fail because the directories referenced by the symlinks do not exist:

> PHP Fatal error:  Uncaught Error: Failed opening required '/srv/moritz/gentoo/var/tmp/portage/dev-php/theseer-Autoload-1.26.3-r1/work/Autoload-1.26.3/src/../vendor/zetacomponents/console-tools/src/input
.php' (include_path='.:/srv/moritz/gentoo/usr/share/php8:/srv/moritz/gentoo/usr/share/php') in /srv/moritz/gentoo/var/tmp/portage/dev-php/theseer-Autoload-1.26.3-r1/work/Autoload-1.26.3/src/autoload.php
:147

Reproducible: Always

Steps to Reproduce:
The error only happens in a Prefix installation.

1. emerge -av1 dev-php/theseer-Autoload 
Actual Results:  
The ebuild's src_prepare step fails due to invalid symlinks in the working directory.

Expected Results:  
The package is emerged successfully.

Prefixing the created symlinks in the ebuild's src_prepare function with ${EPREFIX} results in successful merging.
Comment 1 Moritz Brunner 2023-12-06 18:51:41 UTC
Created attachment 877949 [details, diff]
Patch to add $EPREFIX to symlink destination

I've attached a patch to the ebuild in question which should fix this bug.
Comment 2 Fabian Groffen gentoo-dev 2023-12-07 08:14:08 UTC
@php-bugs, does this look ok to you?