-
Notifications
You must be signed in to change notification settings - Fork 16
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
VendorExposeCommand execute is missing a return type. #82
Comments
I'll create a PR soon |
Our CI is working fine for vendor-plugin - https://github.com/silverstripe/vendor-plugin/actions/runs/11432614774 CMS 6 uses symfony 7 and vendor-plugin 2, we're not seeing any issues with the method signature used in vendor-plugin - https://github.com/silverstripe/silverstripe-framework/blob/6/composer.json#L43 That CI build linked installed symfony 6.4 - is your CI doing the same or is it installing something more recent? Based on silverstripe/recipe-plugin#46 I'm going to assume that you're installing symfony 7 |
The ci is installing Symfony console 6, however I think the conflict is actually with composer greater than 2.6.6 according to support. I admit it is strange, cause I see symfony console 7 being installed as a prebuild step for composer dependencies, then composer installs my dependencies which include symfony console 6. The site then won't build due to missing signatures. |
Seems like there's probably an issue with the composer dependencies in your project/ci then? As mentioned we are not seeing any issues with method signatures in the CI builds for either CMS 5 or CMS 6, both of which are using silverstripe/vendor-plugin:^2 As there doesn't appear to be an issue at this end I'll close this issue |
See silverstripe/recipe-plugin#46 (comment) for why I think we should make this change |
Closing as a duplicate of silverstripe/.github#325 |
@nlighteneddesign Just in case this helps, I am also running into this issue, also on Platform.sh, for what it's worth, and I managed to solve the issue. This is doing an upgrade from CMS 4 to CMS 5. On Platform.sh, I can see that it's installing Both versions of composer are the same (2.8.5, on php8.2.27). Forcing Platform.sh to install build:
flavor: none
dependencies:
php:
require:
symfony/console: "^6"
hooks:
build: |
composer install --no-interaction --no-dev --prefer-dist --no-progress --optimize-autoloader
composer vendor-expose You can confirm the installed version during the |
Oh, so it's not the composer version that matters? Is that |
It's not Platform.sh installs Composer for you automatically during the build phase of the project. You can decide if you want Composer v1 or v2, we have explicitly requested v2. During a Using Silverstripe CMS v4 and PHP 8.1, Platform.sh will install Composer, but with Upgrading to CMS 5 and PHP 8.2, the initial install of composer looks like this: Output from `git push platform test` without dependency fix
After making the above YML change, I get the following install plan for composer (and the vendor-expose command works): Output from `git push platform test` after dependency fix
One other thing to note: During the investigation of this, I noticed that running However this is being called, it doesn't appear to actually fully expose everything. In particular, the root-level resources aren't exposed properly, despite being listed as being exposed in the console output. I'll try to debug that one later, as it might be a Platform.sh specific issue (it uses a read-only filesystem to install the app to, which may impact the symlinking in odd ways). |
With the yml fix I noticed it's installing quite a lot less dependencies, for example |
It's as fresh as I can make it, although I don't know what it's doing internally. I also noticed the different dependencies as well and couldn't make heads nor tail of it. v6 does require an additional module It's possible that Platform.sh has some kind of cache that only applies for the latest version or something and as soon as you break the cache key by forcing a specific version, it installs it all from scratch or something similar. At that point we're getting into platform-specific nuances that I don't think are useful to Silverstripe. At this point I don't know what the solution is - this seems to at least be a way to resolve the specific issue with Silverstripe CMS 5, PHP 8.2 (haven't tried 8.3 yet, that's my next step) Composer v2 and Platform.sh. Obviously updating this check will be required in future, so I think just planning to upgrade with CMS v6 to target symfony/console v7 makes sense. I don't think we can do much about composer itself... the only other thing I can suggest is to make the change to add the |
Module version(s) affected
2.0.3
Description
When the build is running in CI I get this error:
Fatal error: Declaration of SilverStripe\VendorPlugin\Console\VendorExposeCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Symfony\Component\Console\Command\Command::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in /app/vendor/silverstripe/vendor-plugin/src/Console/VendorExposeCommand.php on line 36
How to reproduce
Build in platform.sh
I'm not sure why this isn't the same as running it locally.
Possible Solution
Add missing return type int
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)Related issue
PR
The text was updated successfully, but these errors were encountered: