Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include of autogenerating files are not idempotent #30

Open
websi opened this issue Aug 26, 2024 · 1 comment
Open

Include of autogenerating files are not idempotent #30

websi opened this issue Aug 26, 2024 · 1 comment

Comments

@websi
Copy link

websi commented Aug 26, 2024

The path to file typo3/alias-loader-include.php is an absolute path.
Composer use an hash to the file for the include.
So the hash changes for different paths. This is very common in the CI system.
This prevents effective caching of the generated files.

Similar use cases from composer: composer/composer#7049 and composer/composer#11226

Diff Image:

image

Patch:

Index: src/IncludeFile.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/IncludeFile.php b/src/IncludeFile.php
--- a/src/IncludeFile.php
+++ b/src/IncludeFile.php    (date 1724418719532)
@@ -67,7 +67,7 @@
         // Register the file in the root package
         $rootPackage = $this->composer->getPackage();
         $autoloadDefinition = $rootPackage->getAutoload();
-        $autoloadDefinition['files'][] = $includeFile;
+        $autoloadDefinition['files'][] = $this->composer->getConfig()->get('vendor-dir', \Composer\Config::RELATIVE_PATHS) . self::INCLUDE_FILE;
         $rootPackage->setAutoload($autoloadDefinition);
     }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@websi and others