Closed ahoiroman closed 2 years ago
I've taken a look at this and it appears that it just needs a new build to be created against PHP 8.1 and released.
I've installed PHP 8.1 locally and run composer install
& ./vendor/bin/phpunit
, all seems to run well. I've created a new build with php ./takeout app:build
and the resulting build appears to work fine.
I have created #261 to add PHP 8.1 to the test suite in Actions
Merged #261; I'll test out the build process locally shortly.
Hm.. after upgrading to 8.1, I can't even build:
I'll dig into this a bit later
I've got the same error when using Takeout on PHP 8.1:
PHP Fatal error: During inheritance of IteratorAggregate: Uncaught ErrorException: Return type of Symfony\Component\Console\Helper\HelperSet::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///home/user/.config/composer/vendor/tightenco/takeout/builds/takeout/vendor/symfony/console/Helper/HelperSet.php:94
In case it's useful to anyone dealing with these errors, I thought I would mention what I've done as a workaround. Since I've got PHP 8.1 as my default CLI version (but I've got 7.3-8.0 also installed), I just created an alias in my .zshrc that forces Takeout to run under a specific PHP version, e.g.:
alias takeout="php8.0 ~/.config/composer/vendor/bin/takeout"
Not ideal but it lets me run Valet under 8.1 and still maintain a functioning Takeout install.
A very good hint.
Don't forget to source your .zshrc after that.
In my case I had to adopt this a little bit (expose has the same problem, and this can also be solved like that):
alias takeout="/opt/homebrew/Cellar/php@8.0/8.0.13/bin/php ~/.composer/vendor/bin/takeout"
alias expose="/opt/homebrew/Cellar/php@8.0/8.0.13/bin/php ~/.composer/vendor/bin/expose"
Sorry y'all, I've been pretty burned out the last few days. Looking at this again now.
https://github.com/laravel-zero/laravel-zero/issues/367
Looks like this is a known issue. Let me dig into Box but I don't know anything about it so we're probably just dependent on them.
@bakerkretzmar and I put in a PR to two of Laravel Zero's dependencies (PHP Scoper and Covers Validation, IIRC) to try to get PHP 8.1 support. Fingers crossed.
any update? Will go back to PHP 7 for awhile if this is going to take some time. Appreciate you jumping on it @mattstauffer
This is the PR I made to the dependency:
https://github.com/humbug/php-scoper/pull/543
It's still in draft form until the package author can take time to work with it:
@mattstauffer You can now migrate this tool to Laravel Zero 9, and on the process, you will get this issue fixed. Of course, keep in mind, that just like Laravel 9, Laravel Zero 9 drops PHP 7.4 and PHP 7.3.
Woooo thanks @nunomaduro!
@mattstauffer Now that the upstream issues have been fixed, what's left to do on this repo? This is my last PHP 8.1 blocker, so I'd love to help anyway I can!
@bandgeekndb Thanks! Looks like we need to upgrade it to Laravel Zero 9. I'd welcome that PR!
I also realize I didn't include any docs updates in my PR, do you want to make a note about dropping PHP7 support? Maybe tag the new release as 2.0 and tell anyone who still needs PHP7 support to stay on the 1.* builds?
Thanks for the v2.0.0 build Matt. I installed globally and am getting the attached errors (same as previous)
If i try to run any command within takeout like enable
then it fails with
I also tried running the version from repo and same issue. I tried the same build using php 8.0 directly and that appears to work so I tried building from main branch locally on 8.1 and appears to run fine.
Not sure if maybe is a local issue for me or not tho. Also wondering if maybe there's something funky going on where it needs to be built against php 8.1 in order to work properly or something else weird.
@railto Thanks for bringing this up, I believe I know what happened. I only committed the composer.json, and not the .lock file along with it, so I don't think the right dependencies were in place for the 2.0.0 build. I've submitted #278 to fix this and then v2.0.1 should be working.
Closed in #274 / #278.
Seems it still might need a new build published also because still seeing same errors that resolve with local "composer i && php ./takeout app:build"
@priithansen which version is that, 2.0.1 or 2.0.2? Thanks!
Ah jes impatient me tried 2.0.1. Seems 2.0.2 fixes the iterator return value problem but there appears to be some new problem with plain "takeout" command workig but every other command results in "The provided cwd "" does not exist." Yet again doing a local build resolves the problem 🤔
Interesting. I can't reproduce the cwd issue on my machine, but my machine is the one that built it. I'll dig in to see if I can figure out what's going on in Process.php line 344 and what's calling that particular spot, if I can.
It could always just be something funky with my setup although tried to delete global vendors folder and do composer global clearcache :) anyways Thanks for the fantastic package!
Hello,
using takeout, I am getting this error:
No problem, I will switch back to 8.0 - is there any ETA for 8.1? Unfortunately I can't contribute by myself at the moment, but I'd be happy to sponsor this package, but the sponsorship-option is disabled.