Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

dev-php/theseer-Autoload should be in RDEPEND instead of BDEPEND #5

Open
r7l opened this issue Feb 23, 2023 · 2 comments
Open

dev-php/theseer-Autoload should be in RDEPEND instead of BDEPEND #5

r7l opened this issue Feb 23, 2023 · 2 comments

Comments

@r7l
Copy link
Contributor

r7l commented Feb 23, 2023

The autoload.php file at /usr/share/composer/vendor/autoload.php for Composer will contain this code:

// Dependencies
\Fedora\Autoloader\Dependencies::required([
	'/usr/share/php/Composer/CaBundle/autoload.php',
	'/usr/share/php/Composer/ClassMapGenerator/autoload.php',
	'/usr/share/php/Composer/MetadataMinifier/autoload.php',
	'/usr/share/php/Composer/Pcre/autoload.php',
	'/usr/share/php/Composer/Semver/autoload.php',
	'/usr/share/php/Composer/XdebugHandler/autoload.php',
	'/usr/share/php/Composer/Spdx/autoload.php',
	'/usr/share/php/TheSeer/Autoload/autoload.php',
	'/usr/share/php/TheSeer/DirectoryScanner/autoload.php',
	'/usr/share/php/Psr/Log/autoload.php',
	'/usr/share/php/Seld/PharUtils/autoload.php',
	'/usr/share/php/Seld/JsonLint/autoload.php',
	'/usr/share/php/Seld/SignalHandler/autoload.php',
	'/usr/share/php/Fedora/Autoloader/autoload.php',
	'/usr/share/php/JsonSchema/autoload.php',
	'/usr/share/php/React/Promise/autoload.php',
	'/usr/share/php/Symfony/Component/PolyfillCtype/autoload.php',
	'/usr/share/php/Symfony/Component/DeprecationContracts/autoload.php',
	'/usr/share/php/Symfony/Component/ServiceContracts/autoload.php',
	'/usr/share/php/Symfony/Component/PolyfillIntlNormalizer/autoload.php',
	'/usr/share/php/Symfony/Component/Filesystem/autoload.php',
	'/usr/share/php/Symfony/Component/Finder/autoload.php',
	'/usr/share/php/Symfony/Component/Console/autoload.php',
	'/usr/share/php/Symfony/Component/PolyfillMbstring/autoload.php',
	'/usr/share/php/Symfony/Component/Process/autoload.php',
	'/usr/share/php/Symfony/Component/PolyfillIntlGrapheme/autoload.php',
	'/usr/share/php/Symfony/Component/Polyfill-php80/autoload.php',
	'/usr/share/php/Symfony/Component/Polyfill-php81/autoload.php',
	'/usr/share/php/Symfony/Component/String/autoload.php',
]);

As you can see, there there are dependencies listed for TheSeer/Autoload.

Installing Composer with your Ebuilds might create an environment without dev-php/theseer-Autoload in certain situations. For example when using ROOT variable during emerge. This way it won't install the dependency into the custom root and running any Composer command within this custom root environment will throw errors like this:

PHP Fatal error:  Uncaught RuntimeException: File not found: '/usr/share/php/TheSeer/Autoload/autoload.php' in /usr/share/php/Fedora/Autoloader/functions.php:58
Stack trace:
#0 /usr/share/php/Fedora/Autoloader/Dependencies.php(78): Fedora\Autoloader\requireFile()
#1 /usr/share/php/Fedora/Autoloader/Dependencies.php(100): Fedora\Autoloader\Dependencies::process()
#2 /usr/share/composer/vendor/autoload.php(292): Fedora\Autoloader\Dependencies::required()
#3 /usr/share/composer/src/bootstrap.php(17): include('...')
#4 /usr/share/composer/src/bootstrap.php(20): includeIfExists()
#5 /usr/share/composer/bin/composer(14): require('...')
#6 {main}
  thrown in /usr/share/php/Fedora/Autoloader/functions.php on line 58

Fatal error: Uncaught RuntimeException: File not found: '/usr/share/php/TheSeer/Autoload/autoload.php' in /usr/share/php/Fedora/Autoloader/functions.php:58
Stack trace:
#0 /usr/share/php/Fedora/Autoloader/Dependencies.php(78): Fedora\Autoloader\requireFile()
#1 /usr/share/php/Fedora/Autoloader/Dependencies.php(100): Fedora\Autoloader\Dependencies::process()
#2 /usr/share/composer/vendor/autoload.php(292): Fedora\Autoloader\Dependencies::required()
#3 /usr/share/composer/src/bootstrap.php(17): include('...')
#4 /usr/share/composer/src/bootstrap.php(20): includeIfExists()
#5 /usr/share/composer/bin/composer(14): require('...')
#6 {main}
  thrown in /usr/share/php/Fedora/Autoloader/functions.php on line 58

I'll provide a PR.

@r7l
Copy link
Contributor Author

r7l commented Feb 23, 2023

Oh wait, my mistake. I should have checked the Ebuild file. It's actually from your Ebuild that those dependencies are in the autoload. Question now is, if this dependency would be needed in the first place. I'll run some tests.

@fcool
Copy link
Member

fcool commented Feb 23, 2023

No, no. You are right... I included too much Autoload-Configuration...

There is no Runtime- or Autoload-Dependency. I craeted the include-list with supported by a script, which picked up basically "anything" - where I manually removed unneeded dependencies - obviously I missed at least this one.

I'll overwork the generated include.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants