You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first of all, thank you for phar-composer, I love it and I've been using it for years.
Now i updated it to 1.2.0 to support composer 2 and I have an issue I simply can not seem to solve. I tried it on different computers with different php versions (7.3 and 8.0):
I have a folder called create-project with a PHP project in it
I run ./phar-composer.phar build create-project
The phar file gets built and the temporary file create-project.phar.<numbers>.phar gets saved
phar-composer throws the following error:
PHP Warning: rename(create-project.phar.1982369873.phar,create-project.phar): Text file busy in phar:///home/vagrant/code/phar-composer.phar/src/Clue/PharComposer/Phar/PharComposer.php on line 226
Warning: rename(create-project.phar.1982369873.phar,create-project.phar): Text file busy in phar:///home/vagrant/code/phar-composer.phar/src/Clue/PharComposer/Phar/PharComposer.php on line 226
[UnexpectedValueException]
Unable to rename temporary phar archive to "create-project.phar"
build [project] [target]
After this, the temporary phar file works fine and I can also rename it manually. It looks like phar-composer doesn't close the handle to the file before trying to rename it.
Can you please help me with debugging?
The text was updated successfully, but these errors were encountered:
@nxu Thanks for reporting, this shouldn't have happened!
Unfortunately, I can not reproduce the problem you're seeing locally and it looks like you're the first to run into this issue. Can you provide instructions on how to reproduce this?
It looks like this might be related to using a shared folder in Vagrant? Can you try executing this in a different directory? Shared folders and slow network mounted drives could be a potential problem here if the writing is performed in the background and temporarily blocks the rename command. If this is the case, introducing some optional delays or fsync() calls might help. I'm happy to accept PRs to address this!
As much as I'd love to work on this myself, there are currently no immediate plans to build this from my end (no demand at the moment and more important outstanding issues currently). If you need this for a commercial project and you want to help sponsor this feature, feel free to reach out and I'm happy to take a look.
clue
changed the title
Unable to rename temporary phar archive
Unable to rename temporary phar archive when using Vagrant
Dec 29, 2021
Hey
first of all, thank you for phar-composer, I love it and I've been using it for years.
Now i updated it to 1.2.0 to support composer 2 and I have an issue I simply can not seem to solve. I tried it on different computers with different php versions (7.3 and 8.0):
create-project
with a PHP project in it./phar-composer.phar build create-project
create-project.phar.<numbers>.phar
gets savedAfter this, the temporary phar file works fine and I can also rename it manually. It looks like phar-composer doesn't close the handle to the file before trying to rename it.
Can you please help me with debugging?
The text was updated successfully, but these errors were encountered: