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

[2.0.0-beta2] patching fails with composer --no-cache #608

Closed
5 tasks done
temp opened this issue Dec 19, 2024 · 1 comment · Fixed by #609
Closed
5 tasks done

[2.0.0-beta2] patching fails with composer --no-cache #608

temp opened this issue Dec 19, 2024 · 1 comment · Fixed by #609
Labels
bug Inconsistencies or issues which will cause a problem for users or implementors.

Comments

@temp
Copy link

temp commented Dec 19, 2024

Verification

  • I have updated Composer to the most recent stable release (composer self-update)
  • I have updated Composer Patches to the most recent stable release (composer update cweagans/composer-patches)
  • I am using one of the supported PHP versions (8.0+)
  • I have searched existing issues and discussions for my problem.
  • My problem is not addressed in the troubleshooting guide.

What were you trying to do (and why)?

Build a frankenphp-based image. It calls composer install --no-cache ...

What happened? What did you expect to happen?

  - Patching tecnickcom/tcpdf

In Downloader.php line 31:

  mkdir(): Not a directory

Problem is in Downloader.php, I guess the cache-dir from the composer config is null:

        $this->cacheDir = $composer->getConfig()->get('cache-dir') . '/patches';
        if (!is_dir($this->cacheDir)) {
            mkdir($this->cacheDir);
        }

So I guess either the cache-dir should be set to something temporary, or it should throw an error that it doesn't work with --no-cache, or caching should be disabled on --no-cache (don't know if this is possible).

Full contents of composer.json

-

Full contents of patches.lock.json

-

Full output of composer patches-doctor

-

Full output of relevant Composer command with the -vvv flag added

composer update --no-cache -vvv
@temp temp added the bug Inconsistencies or issues which will cause a problem for users or implementors. label Dec 19, 2024
@cweagans
Copy link
Owner

Having the cache available is definitely something that this plugin expects at the moment. I'd expect that the Composer downloader would handle this case on its own. I'll investigate that at some point.

In the shorter term, I'm wondering if the behavior of using composer install --no-cache is unique to your project. It appears that Frankenphp itself does not do that: https://github.com/search?q=repo%3Adunglas%2Ffrankenphp+composer+--no-cache&type=code

Are you supplying that argument in one of your build scripts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Inconsistencies or issues which will cause a problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants