-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Support Composer v2 #488
Comments
I think this has already been fixed on master #467. A new release might be needed |
@smoench oh, that's great! |
@theofidry regarding Composer 2 box is ready. We just need a new release. |
https://github.com/box-project/box/releases/tag/3.9.0 is out then! Thanks a lot again @villfa for all of this work 👏 |
@theofidry phar is missing from the release |
@jakzal, Yeah, it looks like Travis failed the deployment. 🤔 https://travis-ci.org/github/box-project/box/builds/739857907 |
The build passed before for the same commit: https://travis-ci.org/github/box-project/box/builds/731398066 |
Was there a reason not to commit the composer.lock-file? I'm just wondering as this is a project not library (IMHO). I mean it works so far for deptrac ;-) |
Here is the diff about dependencies changes: 3c3
< - Installing opis/closure (3.5.7)
---
> - Installing opis/closure (3.6.0)
13c13
< - Installing paragonie/random_compat (v9.99.99)
---
> - Installing paragonie/random_compat (v9.99.100)
18c18
< - Installing composer/semver (3.2.1)
---
> - Installing composer/semver (3.2.2)
20c20
< - Installing composer/xdebug-handler (1.4.3)
---
> - Installing composer/xdebug-handler (1.4.4)
34,36c34,36
< - Installing symfony/finder (v4.4.14)
< - Installing symfony/polyfill-ctype (v1.18.1)
< - Installing symfony/filesystem (v4.4.14)
---
> - Installing symfony/finder (v4.4.16)
> - Installing symfony/polyfill-ctype (v1.20.0)
> - Installing symfony/filesystem (v4.4.16)
39,42c39,42
< - Installing symfony/polyfill-php80 (v1.18.1)
< - Installing symfony/polyfill-php73 (v1.18.1)
< - Installing symfony/polyfill-mbstring (v1.18.1)
< - Installing symfony/console (v4.4.14)
---
> - Installing symfony/polyfill-php80 (v1.20.0)
> - Installing symfony/polyfill-php73 (v1.20.0)
> - Installing symfony/polyfill-mbstring (v1.20.0)
> - Installing symfony/console (v4.4.16)
45c45
< - Installing humbug/php-scoper (0.13.5)
---
> - Installing humbug/php-scoper (0.13.7)
49,51c49,51
< - Installing symfony/process (v4.4.14)
< - Installing symfony/polyfill-php72 (v1.18.1)
< - Installing symfony/var-dumper (v4.4.14)
---
> - Installing symfony/process (v4.4.16)
> - Installing symfony/polyfill-php72 (v1.20.0)
> - Installing symfony/var-dumper (v4.4.16)
82c82
< - Installing symfony/phpunit-bridge (v5.1.6)
---
> - Installing symfony/phpunit-bridge (v5.1.8) |
It is a library if you install it via Composer but for a PHAR this is an application deployed in a read-only environment. Otherwise you might end up with 2 PHARs with different dependencies depending on when you built it |
Hm actually the composer.lock was removed at some point I kinda missed that, it should be added back IMO |
I don't think it makes sense, I probably left it out by mistake and didn't realize the issue as I was editing the PR comment |
I think this is related to php-scoper. Compare the error below with this: https://github.com/humbug/php-scoper/pull/417/files#diff-6a469b93b8c29a7e5511acffc3aefee95a6c16a38b40de71564b6e562b9a23ab 1) KevinGH\Box\Composer\ComposerOrchestratorTest::test_it_can_dump_the_autoloader_with_an_empty_composer_json with data set #3 (Humbug\PhpScoper\Whitelist Object (...), '_Box', '<?php\n\n// @generated by Hum...der;\n')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
// Aliases for the whitelisted classes. For more information see:
// https://github.com/humbug/php-scoper/blob/master/README.md#class-whitelisting
-if (!class_exists('Acme\Foo', false)) {
- class_exists('_Box\Acme\Foo');
+if (!class_exists('Acme\Foo', false) && !interface_exists('Acme\Foo', false) && !trait_exists('Acme\Foo', false)) {
+ spl_autoload_call('_Box\Acme\Foo');
} |
It still doesn't work for me @villfa, @theofidry even on 3.9.0. (composer 2.0.6)
How can I help to debug this issue? |
This is right and related to #490: the phar manually uploaded with the 0.13.9 release doesn't contain php-scoper 0.13.5 as it should. |
A new release https://github.com/box-project/box/releases/tag/3.9.1 has been published with composer v2 support 🤞 |
I can confirm the problem is gone now 👍 Thanks everyone 🍻 |
Feature Request
Currently, phars created by box with Composer 2 are broken.
Example box configuration: https://github.com/jakzal/toolbox/blob/master/box.json.dist
Trying to execute the phar throws a fatal error:
There are some differences in Composer autoload files between v1 and v2.
Composer 1,
autoload_psr4.php
:Composer 2,
autoload_psr4.php
:Similar differences can be found in
autoload_static.php
.The text was updated successfully, but these errors were encountered: