sypets / page_callouts

TYPO3 extension for adding messages to page module.
Other
1 stars 2 forks source link

install with runTests composerInstallMax via CI results in "Extension "page_callouts" not installed with Composer" #8

Open sypets opened 2 years ago

sypets commented 2 years ago

Build/Scripts/runTests.sh -p 7.4 -s composerInstallMax

see failed run: https://github.com/sypets/page_callouts/runs/4284833714?check_suite_focus=true

Error message

Generating autoload files
> TYPO3\TestingFramework\Composer\ExtensionTestEnvironment::prepare
67 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Generating autoload files
Extension "page_callouts" not installed with Composer. This is deprecated and will not work any more with TYPO3 12.

  [TYPO3\CMS\Core\Package\Exception\InvalidPackageStateException]  
  Package "page_callouts" is already registered.                   

dump-autoload [--no-scripts] [-o|--optimize] [-a|--classmap-authoritative] [--apcu] [--apcu-prefix APCU-PREFIX] [--dev] [--no-dev] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs]

Reproduce

This can be reproduced locally, if extension is not installed in a working TYPO3 installation but is cloned standalone and then Build/Scripts/runTests.sh -p 7.4 -s composerInstallMax is executed.

Resources

Maybe these resources can help:

 private function ‪amendWithLocallyAvailableExtensions(array $installedTypo3Packages): array
     {
         $installedThirdPartyExtensionKeys = array_map(
             static function (array $packageAndPathAndKey) {
                 [, , $extensionKey] = $packageAndPathAndKey;
                 return $extensionKey;
             },
             array_filter(
                 $installedTypo3Packages,
                 static function (array $packageAndPathAndKey) {
                     [, $packagePath,] = $packageAndPathAndKey;
                     return strpos($packagePath, self::LEGACY_EXTENSION_INSTALL_PATH) !== false;
                 }
             )
         );

         foreach ($this->‪scanForRootExtensions() as [$composerPackage, $path, $extensionKey]) {
             if (in_array($extensionKey, $installedThirdPartyExtensionKeys, true)) {
                 // Found the extension to be installed with Composer, so no need to register it again
                 continue;
             }
             $this->event->getIO()->warning(sprintf('Extension "%s" not installed with Composer. This is deprecated and will not work any more with TYPO3 12.', $extensionKey));
             $installedTypo3Packages[] = [$composerPackage, $path, $extensionKey];
         }

         return $installedTypo3Packages;
     }

changelog: https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/11.4/Feature-94996-ConsiderAllComposerInstalledExtensionsAsActive.html

sypets commented 2 years ago

Further findings when the problem occurs:

Reproduce:

Locally (or use GitHub actions with runTests.sh)

Execute this somewhere else, not in an existing site:

  1. git clone git@github.com:sypets/page_callouts.git
  2. cd page_callouts
  3. git checkout d1821ba7a8144f5ed812453f6b7d29c00d10f3e5
  4. composer install
  5. composer install

Error occurs.

Try again:

  1. composer install

Error still occurs.

Now try:

  1. mkdir -pResources/Public/Css
  2. touch Resources/Public/Css/dummy.css
  3. composer install

Error does not occur.

.Build/Web/typo3conf/ext/page_callouts is symlink in both cases.

The results I got were a bit inconsistent, sometimes I got the error only on the second time running composer install. With the CI however, it already failed on the first run: https://github.com/sypets/page_callouts/actions/runs/1492087582