Skip to content

Unable to rename temporary phar archive when using Vagrant #116

@nxu

Description

@nxu

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):

  • 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?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions