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

Cannot scope PHPUnit 8.5 #420

Closed
sebastianbergmann opened this issue Oct 25, 2020 · 10 comments · Fixed by #425
Closed

Cannot scope PHPUnit 8.5 #420

sebastianbergmann opened this issue Oct 25, 2020 · 10 comments · Fixed by #425

Comments

@sebastianbergmann
Copy link
Contributor

I wanted to release PHPUnit 8.5.9 from PHPUnit's 8.5 branch just now but ran into the following issue:

    ____  __  ______     _____
   / __ \/ / / / __ \   / ___/_________  ____  ___  _____
  / /_/ / /_/ / /_/ /   \__ \/ ___/ __ \/ __ \/ _ \/ ___/
 / ____/ __  / ____/   ___/ / /__/ /_/ / /_/ /  __/ /
/_/   /_/ /_/_/       /____/\___/\____/ .___/\___/_/
                                     /_/

PHP Scoper version 0.13.5 2020-09-16 13:19:21 UTC

   0/683 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
  69/683 [▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░]  10%
 137/683 [▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░]  20%
 205/683 [▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░]  30%
 274/683 [▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░]  40%
 342/683 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░]  50%


 // Memory usage: 9.42MB (peak: 20.29MB), time: 1.79s                           

 410/683 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░]  60%
 683/683 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
In AddPrefixCommand.php line 103:
                                                                               
  Could not parse the file "/usr/local/src/phpunit/build/tmp/phar/phpunit/Fra  
  mework/MockObject/Builder/ParametersMatch.php".                              
                                                                               

In ParserAbstract.php line 158:
                                               
  Syntax error, unexpected T_MATCH on line 15  
                                               

add-prefix [-d|--working-dir WORKING-DIR] [-p|--prefix PREFIX] [-o|--output-dir OUTPUT-DIR] [-f|--force] [-s|--stop-on-failure] [-c|--config CONFIG] [--no-config] [--] [<paths>...]

Result: 1

This is line 15 of ParametersMatch.php:

interface ParametersMatch extends Match

match is a reserved word in PHP 8. PHPUnit 8.5 is not supported on PHP 8. I am not using PHP 8 to run PHP-Scoper. I expect to be able to package code that contains syntax that is valid for PHP 7 but not for PHP 8.

@theofidry
Copy link
Member

Urg I think #418 broke that... This reflector extension point kind of ignores the current PHP version used which makes it really confusing...

@sebastianbergmann
Copy link
Contributor Author

Are you sure #418 is in 0.13.5? That is the version I use due to #419.

@theofidry
Copy link
Member

Hm I see then it's something else; I'll try to have a look tonight

@sebastianbergmann
Copy link
Contributor Author

Thank you!

@sebastianbergmann
Copy link
Contributor Author

The first version that is not able to scope the current state of PHPUnit's 8.5 branch is PHP-Scoper 0.13.3.

@theofidry
Copy link
Member

Thanks for the info @sebastianbergmann; I'm still looking into this

@smoench
Copy link
Contributor

smoench commented Oct 30, 2020

Hi @sebastianbergmann, a new release (0.13.8) has been released yesterday. #418 is included and #419 has been fixed. Can you prove it is working for you?

@sebastianbergmann
Copy link
Contributor Author

I run into the same match related error with 0.13.8, sorry.

@smoench
Copy link
Contributor

smoench commented Nov 2, 2020

With #425 it should be fixed. The CI has produced a phar-file artifact for testing https://github.com/humbug/php-scoper/actions/runs/341252821. Can you prove it is working for. Thanks in advance :-)

@sebastianbergmann
Copy link
Contributor Author

That seems to have fixed it:

 phpunit   8.5 ✘ ✹  ant signed-phar 
Buildfile: /usr/local/src/phpunit/build.xml

clean:
   [delete] Deleting directory /usr/local/src/phpunit/build/artifacts
   [delete] Deleting directory /usr/local/src/phpunit/vendor
   [delete] Deleting: /usr/local/src/phpunit/composer.lock

-dependencies-installed:

validate-composer-json:
 [composer] /usr/local/src/phpunit/composer.json is valid

install-dependencies:
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp
 [composer] ./composer.json has been updated
 [composer] Loading composer repositories with package information
 [composer] Updating dependencies
 [composer] Lock file operations: 29 installs, 0 updates, 0 removals
 [composer]   - Locking doctrine/instantiator (1.3.1)
 [composer]   - Locking myclabs/deep-copy (1.10.1)
 [composer]   - Locking phar-io/manifest (1.0.3)
 [composer]   - Locking phar-io/version (2.0.1)
 [composer]   - Locking phpdocumentor/reflection-common (2.2.0)
 [composer]   - Locking phpdocumentor/reflection-docblock (5.2.2)
 [composer]   - Locking phpdocumentor/type-resolver (1.4.0)
 [composer]   - Locking phpspec/prophecy (1.12.1)
 [composer]   - Locking phpunit/php-code-coverage (7.0.10)
 [composer]   - Locking phpunit/php-file-iterator (2.0.2)
 [composer]   - Locking phpunit/php-invoker (2.0.0)
 [composer]   - Locking phpunit/php-text-template (1.2.1)
 [composer]   - Locking phpunit/php-timer (2.1.2)
 [composer]   - Locking phpunit/php-token-stream (3.1.1)
 [composer]   - Locking sebastian/code-unit-reverse-lookup (1.0.1)
 [composer]   - Locking sebastian/comparator (3.0.2)
 [composer]   - Locking sebastian/diff (3.0.2)
 [composer]   - Locking sebastian/environment (4.2.3)
 [composer]   - Locking sebastian/exporter (3.1.2)
 [composer]   - Locking sebastian/global-state (3.0.0)
 [composer]   - Locking sebastian/object-enumerator (3.0.3)
 [composer]   - Locking sebastian/object-reflector (1.1.1)
 [composer]   - Locking sebastian/recursion-context (3.0.0)
 [composer]   - Locking sebastian/resource-operations (2.0.1)
 [composer]   - Locking sebastian/type (1.1.3)
 [composer]   - Locking sebastian/version (2.0.1)
 [composer]   - Locking symfony/polyfill-ctype (v1.20.0)
 [composer]   - Locking theseer/tokenizer (1.2.0)
 [composer]   - Locking webmozart/assert (1.9.1)
 [composer] Writing lock file
 [composer] Installing dependencies from lock file (including require-dev)
 [composer] Package operations: 29 installs, 0 updates, 0 removals
 [composer]   - Installing myclabs/deep-copy (1.10.1): Extracting archive
 [composer]   - Installing phar-io/version (2.0.1): Extracting archive
 [composer]   - Installing phar-io/manifest (1.0.3): Extracting archive
 [composer]   - Installing phpdocumentor/reflection-common (2.2.0): Extracting archive
 [composer]   - Installing phpdocumentor/type-resolver (1.4.0): Extracting archive
 [composer]   - Installing sebastian/recursion-context (3.0.0): Extracting archive
 [composer]   - Installing sebastian/exporter (3.1.2): Extracting archive
 [composer]   - Installing sebastian/diff (3.0.2): Extracting archive
 [composer]   - Installing sebastian/comparator (3.0.2): Extracting archive
 [composer]   - Installing symfony/polyfill-ctype (v1.20.0): Extracting archive
 [composer]   - Installing webmozart/assert (1.9.1): Extracting archive
 [composer]   - Installing phpdocumentor/reflection-docblock (5.2.2): Extracting archive
 [composer]   - Installing doctrine/instantiator (1.3.1): Extracting archive
 [composer]   - Installing phpspec/prophecy (1.12.1): Extracting archive
 [composer]   - Installing theseer/tokenizer (1.2.0): Extracting archive
 [composer]   - Installing sebastian/version (2.0.1): Extracting archive
 [composer]   - Installing sebastian/environment (4.2.3): Extracting archive
 [composer]   - Installing sebastian/code-unit-reverse-lookup (1.0.1): Extracting archive
 [composer]   - Installing phpunit/php-token-stream (3.1.1): Extracting archive
 [composer]   - Installing phpunit/php-text-template (1.2.1): Extracting archive
 [composer]   - Installing phpunit/php-file-iterator (2.0.2): Extracting archive
 [composer]   - Installing phpunit/php-code-coverage (7.0.10): Extracting archive
 [composer]   - Installing phpunit/php-invoker (2.0.0): Extracting archive
 [composer]   - Installing phpunit/php-timer (2.1.2): Extracting archive
 [composer]   - Installing sebastian/object-reflector (1.1.1): Extracting archive
 [composer]   - Installing sebastian/global-state (3.0.0): Extracting archive
 [composer]   - Installing sebastian/object-enumerator (3.0.3): Extracting archive
 [composer]   - Installing sebastian/resource-operations (2.0.1): Extracting archive
 [composer]   - Installing sebastian/type (1.1.3): Extracting archive
 [composer] 3 package suggestions were added by new dependencies, use `composer suggest` to see details.
 [composer] Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
 [composer] Generating optimized autoload files
 [composer] 4 packages you are using are looking for funding.
 [composer] Use the `composer fund` command to find out more!
     [move] Moving 1 file to /usr/local/src/phpunit

-phar-prepare:
    [mkdir] Created dir: /usr/local/src/phpunit/build/artifacts
    [mkdir] Created dir: /usr/local/src/phpunit/build/tmp/phar
    [mkdir] Created dir: /usr/local/src/phpunit/build/tmp/phar-scoped
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/php-code-coverage
     [copy] Copying 61 files to /usr/local/src/phpunit/build/tmp/phar/php-code-coverage
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/php-file-iterator
     [copy] Copying 3 files to /usr/local/src/phpunit/build/tmp/phar/php-file-iterator
     [copy] Copying 3 files to /usr/local/src/phpunit/build/tmp/phar/php-invoker
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/php-text-template
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/php-text-template
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/php-timer
     [copy] Copying 3 files to /usr/local/src/phpunit/build/tmp/phar/php-timer
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/php-token-stream
     [copy] Copying 4 files to /usr/local/src/phpunit/build/tmp/phar/php-token-stream
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-code-unit-reverse-lookup
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-code-unit-reverse-lookup
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-comparator
     [copy] Copying 15 files to /usr/local/src/phpunit/build/tmp/phar/sebastian-comparator
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-diff
     [copy] Copying 16 files to /usr/local/src/phpunit/build/tmp/phar/sebastian-diff
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-environment
     [copy] Copying 3 files to /usr/local/src/phpunit/build/tmp/phar/sebastian-environment
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-exporter
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-exporter
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-global-state
     [copy] Copying 6 files to /usr/local/src/phpunit/build/tmp/phar/sebastian-global-state
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/object-enumerator
     [copy] Copying 3 files to /usr/local/src/phpunit/build/tmp/phar/sebastian-object-enumerator
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/object-reflector
     [copy] Copying 3 files to /usr/local/src/phpunit/build/tmp/phar/sebastian-object-reflector
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-recursion-context
     [copy] Copying 3 files to /usr/local/src/phpunit/build/tmp/phar/sebastian-recursion-context
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-resource-operations
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-resource-operations
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-type
     [copy] Copying 12 files to /usr/local/src/phpunit/build/tmp/phar/sebastian-type
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-version
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/sebastian-version
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/doctrine-instantiator
     [copy] Copying 5 files to /usr/local/src/phpunit/build/tmp/phar/doctrine-instantiator
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/myclabs-deep-copy
     [copy] Copying 25 files to /usr/local/src/phpunit/build/tmp/phar/myclabs-deep-copy
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/phar-io-manifest
     [copy] Copying 49 files to /usr/local/src/phpunit/build/tmp/phar/phar-io-manifest
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/phar-io-version
     [copy] Copying 18 files to /usr/local/src/phpunit/build/tmp/phar/phar-io-version
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/phpdocumentor-reflection-common
     [copy] Copying 6 files to /usr/local/src/phpunit/build/tmp/phar/phpdocumentor-reflection-common
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/phpdocumentor-reflection-docblock
     [copy] Copying 41 files to /usr/local/src/phpunit/build/tmp/phar/phpdocumentor-reflection-docblock
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/phpdocumentor-type-resolver
     [copy] Copying 33 files to /usr/local/src/phpunit/build/tmp/phar/phpdocumentor-type-resolver
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/phpspec-prophecy
     [copy] Copying 94 files to /usr/local/src/phpunit/build/tmp/phar/phpspec-prophecy
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/symfony-polyfill-ctype
     [copy] Copying 2 files to /usr/local/src/phpunit/build/tmp/phar/symfony-polyfill-ctype
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/theseer-tokenizer
     [copy] Copying 8 files to /usr/local/src/phpunit/build/tmp/phar/theseer-tokenizer
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar/webmozart-assert
     [copy] Copying 2 files to /usr/local/src/phpunit/build/tmp/phar/webmozart-assert

-phar-determine-version:

phar:

-phar-determine-version:

-phar-build:
     [copy] Copying 230 files to /usr/local/src/phpunit/build/tmp/phar/phpunit

-phar-scope:
[php-scoper] 
[php-scoper] 
[php-scoper]     ____  __  ______     _____
[php-scoper]    / __ \/ / / / __ \   / ___/_________  ____  ___  _____
[php-scoper]   / /_/ / /_/ / /_/ /   \__ \/ ___/ __ \/ __ \/ _ \/ ___/
[php-scoper]  / ____/ __  / ____/   ___/ / /__/ /_/ / /_/ /  __/ /
[php-scoper] /_/   /_/ /_/_/       /____/\___/\____/ .___/\___/_/
[php-scoper]                                      /_/
[php-scoper] 
[php-scoper] PHP Scoper version 0.13.8@0ba0a80 2020-11-02 07:49:09 UTC
[php-scoper] 
[php-scoper]    0/683 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
[php-scoper]  137/683 [▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░]  20%
[php-scoper]  205/683 [▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░]  30%
[php-scoper]  274/683 [▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░]  40%
[php-scoper]  342/683 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░]  50%
[php-scoper]  410/683 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░]  60%
[php-scoper]  479/683 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░░]  70%
[php-scoper]  547/683 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░]  80%
[php-scoper] 
[php-scoper] 
[php-scoper]  [OK] Successfully prefixed 683 files.                                          
[php-scoper] 
[php-scoper]  // Memory usage: 12.61MB (peak: 20.34MB), time: 2.08s                          
[php-scoper] 
[php-scoper]  615/683 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░]  90%
[php-scoper]  683/683 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp/phar-scoped
    [phpab] phpab 1.26.0 - Copyright (C) 2009 - 2020 by Arne Blankerts and Contributors
    [phpab] 
    [phpab] Scanning directory /usr/local/src/phpunit/build/tmp/phar-scoped
    [phpab] 
    [phpab] phar archive '/usr/local/src/phpunit/build/artifacts/phpunit-library-8.5.8-95-g45e0286a0.phar' generated.
    [phpab] 
     [copy] Copying 1 file to /usr/local/src/phpunit/build/tmp
    [phpab] phpab 1.26.0 - Copyright (C) 2009 - 2020 by Arne Blankerts and Contributors
    [phpab] 
    [phpab] Scanning directory /usr/local/src/phpunit/build/tmp/phar-scoped
    [phpab] 
    [phpab] phar archive '/usr/local/src/phpunit/build/artifacts/phpunit-8.5.8-95-g45e0286a0.phar' generated.
    [phpab] 
   [delete] Deleting directory /usr/local/src/phpunit/build/tmp

signed-phar:

BUILD SUCCESSFUL
Total time: 6 seconds

 phpunit   8.5 ✘ ✹  ./build/artifacts/phpunit-8.5.8-95-g45e0286a0.phar --version
PHPUnit 8.5.8 by Sebastian Bergmann and contributors.

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

Successfully merging a pull request may close this issue.

3 participants