-
-
Notifications
You must be signed in to change notification settings - Fork 403
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When running composer-unused I'm getting the following error:
PHP Fatal error: Uncaught Error: Class "Symfony\Component\PropertyAccess\PropertyAccess" not found in /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c15c55f0ee9/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php:328
Stack trace:
#0 /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c15c55f0ee9/vendor/symfony/serializer/Serializer.php(227): Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer->denormalize()
#1 /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c15c55f0ee9/vendor/symfony/serializer/Serializer.php(145): Symfony\Component\Serializer\Serializer->denormalize()
#2 /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c15c55f0ee9/vendor/icanhazstring/composer-unused/src/Composer/ConfigFactory.php(36): Symfony\Component\Serializer\Serializer->deserialize()
#3 /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c15c55f0ee9/vendor/icanhazstring/composer-unused/src/Console/Command/UnusedCommand.php(136): ComposerUnused\ComposerUnused\Composer\ConfigFactory->fromPath()
#4 /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c15c55f0ee9/vendor/symfony/console/Command/Command.php(312): ComposerUnused\ComposerUnused\Console\Command\UnusedCommand->execute()
#5 /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c15c55f0ee9/vendor/symfony/console/Application.php([10](https://github.com/AffilyAds/lead-magnet/actions/runs/3587516347/jobs/6037950478#step:12:11)20): Symfony\Component\Console\Command\Command->run()
#6 /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c15c55f0ee9/vendor/symfony/console/Application.php(312): Symfony\Component\Console\Application->doRunCommand()
#7 /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c15c55f0ee9/vendor/symfony/console/Application.php(168): Symfony\Component\Console\Application->doRun()
#8 /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c15c55f0ee9/vendor/icanhazstring/composer-unused/bin/composer-unused(45): Symfony\Component\Console\Application->run()
#9 /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c15c55f0ee9/vendor/icanhazstring/composer-unused/bin/composer-unused(46): {closure}()
#10 /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c15c55f0ee9/vendor/bin/composer-unused(120): include('...')
#[11](https://github.com/AffilyAds/lead-magnet/actions/runs/3587516347/jobs/6037950478#step:12:12) {main}
thrown in /home/runner/.composer/vendor/bin/_tools/composer-unused-8242d0c9b008ccec92acbc44d7fb8322623222f88964aae2fbff2c[15](https://github.com/AffilyAds/lead-magnet/actions/runs/3587516347/jobs/6037950478#step:12:16)c55f0ee9/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php on line 328
The error only happens on my GH action (code from the yaml bellow), running the composer-unsed.phar standalone locally works fine.
I've tried to use the same version as the one I'm using locally in my project by doing a tools: composer:v2, composer-normalize, composer-require-checker, composer-unused:0.8.4 but no success so far.
I belive the action is pulling an outdated/buggy version from composer-unused or cached version.
Version
- I have checked releases, and the bug exists in the latest patch version of
v1orv2. -
v2 -
v1
Runners
- GitHub Hosted
- Self Hosted
Operating systems
ubuntu-latest
PHP versions
8.1
To Reproduce
name: "Lint composer.json"
on:
push:
jobs:
coding-standards:
name: "Lint composer.json"
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
dependencies:
- "highest"
php-version:
- "8.1"
operating-system:
- "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
tools: composer:v2, composer-normalize, composer-require-checker, composer-unused
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Cache dependencies"
uses: "actions/cache@v3.0.11"
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"
- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"
- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress"
- name: "Validate composer.json"
run: "composer validate --strict"
- name: "Normalize composer.json"
run: "composer-normalize --dry-run"
- name: "Check composer.json explicit dependencies"
run: "composer-require-checker check"
- name: "Check composer.json unused dependencies"
run: "composer-unused"Expected behavior
- composer-unused should run
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
