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

Support tools: none #446

Closed
szepeviktor opened this issue Apr 21, 2021 · 11 comments
Closed

Support tools: none #446

szepeviktor opened this issue Apr 21, 2021 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@szepeviktor
Copy link
Contributor

szepeviktor commented Apr 21, 2021

Describe the feature

Please consider supporting tools: none when not even Composer is installed.

Currently there is a message with "unknown tool".
https://github.com/shivammathur/setup-php/blob/master/src/tools.ts#L536

Thank you.

@szepeviktor szepeviktor added the enhancement New feature or request label Apr 21, 2021
@shivammathur
Copy link
Owner

@szepeviktor
I can add tools: none.

Although, updating composer phar takes only around 100ms... so I kept it as a default, since that is what most workflows did before installing packages.

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Apr 21, 2021

I do some weird run of Composer scripts on PHP 7.3 then revert to PHP 7.0 and a Composer plugin fails hard.

kép

@shivammathur
Copy link
Owner

shivammathur commented Apr 21, 2021

This is because TypistTech/imposter was installed with PHP 7.3. It has a php requirement php: ^7.3 || ^8.0.

and reverting to PHP 7.0 gives error, as line 14 of the package is
protected const DEFAULT_EXCLUDES = ['typisttech/imposter'];
and class constant visibility modifiers are only supported on PHP 7.1 and above.

So remove TypistTech/imposter before running setup-php again with PHP 7.0, and if you need it again with PHP 7.0 - after switching version try installing the 0.3.0 version of the package which supports PHP 7.0.

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Apr 21, 2021

I need the fruit of modern TypistTech/imposter on PHP 7.0.
Of course I never run Composer on PHP 7.0 again.

Could you help?

@shivammathur
Copy link
Owner

shivammathur commented Apr 21, 2021

Removing composer won't help here as when you use TypistTech/imposter with PHP 7.0, you will get the error.

Downgrading the package using rector might help
Test workflow: https://github.com/shivammathur/test-setup-php/actions/runs/770373521/workflow
rector.php: https://github.com/shivammathur/test-setup-php/blob/e8bcbf5c101bf97629cdeb7047c65c0e9964e708/rector.php

@szepeviktor
Copy link
Contributor Author

Removing composer won't help here as when you use TypistTech/imposter with PHP 7.0, you will get the error.

I've stated that I will not start Composer again after the PHP downgrade.
And the application does not call imposter.

@szepeviktor
Copy link
Contributor Author

And we could spare 100 ms! 😄

@shivammathur
Copy link
Owner

Added in develop, please test and let me know.

- name: Setup PHP
  uses: shivammathur/setup-php@develop
  with:
    php-version: '7.0'
    tools: none

@szepeviktor
Copy link
Contributor Author

szepeviktor commented Apr 21, 2021

It works.
Thank you.

kép

@shivammathur shivammathur added the awaiting-release Added/Fixed and tested, awaiting release label Apr 21, 2021
@shivammathur
Copy link
Owner

Added in 2.11.0.

@shivammathur shivammathur removed the awaiting-release Added/Fixed and tested, awaiting release label Apr 27, 2021
@szepeviktor
Copy link
Contributor Author

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants