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

Error running phive install on 0.14.0 #257

Closed
jwdunne opened this issue May 17, 2020 · 8 comments
Closed

Error running phive install on 0.14.0 #257

jwdunne opened this issue May 17, 2020 · 8 comments
Assignees
Labels

Comments

@jwdunne
Copy link

jwdunne commented May 17, 2020

Phive sounds like a great tool that solves the problems I have installing tools via composer :)

I'm trying to set this up and I'm not sure if I've misunderstood or if I'm doing it wrong but I get this error running phive install phpunit for the first time:

➜  fn git:(master) ✗ phive install phpunit
Phive 0.14.0 - Copyright (C) 2015-2020 by Arne Blankerts, Sebastian Heuer and Contributors
Fetching repository list
Downloading https://phar.io/data/repositories.xml
Downloading https://phar.phpunit.de/phive.xml
Downloading https://phar.phpunit.de/phpunit-9.1.4.phar
Downloading https://phar.phpunit.de/phpunit-9.1.4.phar.asc
Downloading key 4AA394086372C20A
Trying to connect to keys.openpgp.org (37.218.245.50)
Downloading https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x4AA394086372C20A
Successfully downloaded key.

	Fingerprint: D840 6D0D 8294 7747 2937 7831 4AA3 9408 6372 C20A

	Sebastian Bergmann <sb@sebastian-bergmann.de>
	Sebastian Bergmann <sebastian.bergmann@thephp.cc>
	Sebastian Bergmann <sebastian@php.net>
	Sebastian Bergmann <sebastian@phpunit.de>
	Sebastian Bergmann <sebastian@thephp.cc>

	Created: 2014-07-19

Import this key? [y|N] y
Linking /Users/JamesPersonal/.phive/phars/phpunit-9.1.4.phar to tools/phpunit
[ERROR]   An error occurred while processing your request:

          DOMDocument::save(/Users/JamesPersonal/projects/fn/.phive/phars.xml): failed to open stream: No such file or directory

          #0 src/shared/XmlFile.php(52)
          #1 unknown file(0): PharIo\Phive\Cli\Runner->errorHandler()
          #2 src/shared/XmlFile.php(52): DOMDocument->save()
          #3 src/shared/config/PhiveXmlConfig.php(47): PharIo\Phive\XmlFile->save()
          #4 src/services/phar/InstallService.php(64): PharIo\Phive\PhiveXmlConfig->addPhar()
          #5 src/commands/install/InstallCommand.php(45): PharIo\Phive\InstallService->execute()
          #6 src/commands/install/InstallCommand.php(37): PharIo\Phive\InstallCommand->installRequestedPhar()
          #7 src/shared/cli/Runner.php(214): PharIo\Phive\InstallCommand->execute()
          #8 src/shared/cli/Runner.php(69): PharIo\Phive\Cli\Runner->execute()
          #9 (348): PharIo\Phive\Cli\Runner->run()
          #10 {main}

          Environment: PHP 7.4.4
          Phive Version: 0.14.0

          This should not have happened and is most likely a bug.
          Please report it at https://github.com/phar-io/phive/issues, make sure you include
          the full output of this error message. Thank you!

I also tried running phive skel but I get a similar error:

➜  fn git:(master) ✗ phive skel
Phive 0.14.0 - Copyright (C) 2015-2020 by Arne Blankerts, Sebastian Heuer and Contributors
[ERROR]   An error occurred while processing your request:

          file_put_contents(/Users/JamesPersonal/projects/fn/.phive/phars.xml): failed to open stream: No such file or directory

          #0 src/commands/skel/SkelCommand.php(47)
          #1 unknown file(0): PharIo\Phive\Cli\Runner->errorHandler()
          #2 src/commands/skel/SkelCommand.php(47): file_put_contents()
          #3 src/commands/skel/SkelCommand.php(29): PharIo\Phive\SkelCommand->writeSkeletonFile()
          #4 src/shared/cli/Runner.php(214): PharIo\Phive\SkelCommand->execute()
          #5 src/shared/cli/Runner.php(69): PharIo\Phive\Cli\Runner->execute()
          #6 (348): PharIo\Phive\Cli\Runner->run()
          #7 {main}

          Environment: PHP 7.4.4
          Phive Version: 0.14.0

          This should not have happened and is most likely a bug.
          Please report it at https://github.com/phar-io/phive/issues, make sure you include
          the full output of this error message. Thank you!

I'm not sure what .phive/phars.xml is. Do I need to create this first? Is this different from the project-root level phive.xml? If I run rm -fr ~/.phive and effectively start over, I still get this error.

In terms of my environment, I'm running macOS Mojave, using PHP 7.4.4 installed via MacPorts.

I've downloaded 0.13.2 and this seems to be working fine - great in fact. So looks like an issue with 0.14.0 in particular? 🙂

@theseer
Copy link
Member

theseer commented May 17, 2020

Looks like I broke it by missing a test case for first runs ;)

Further more, it looks like it's a regression from fixing #179.

Hold tight, 0.14.1 incoming :)

@theseer theseer self-assigned this May 17, 2020
@theseer theseer added the bug label May 17, 2020
@theseer
Copy link
Member

theseer commented May 17, 2020

Problem is btw: Now that you had 0.13.2 working, you won't see the issue with 0.14.0 anymore ;) Or at least shouldn't...

@theseer
Copy link
Member

theseer commented May 17, 2020

Fixed with Release 0.14.1.

@theseer theseer closed this as completed May 17, 2020
@theseer
Copy link
Member

theseer commented May 17, 2020

Regarding .phive/phars.xml ./. phive.xml: As we're adding support for various additional things that require individual config files (auth, local registries, ..) and we do not want to clutter the project root directory, phive is moving its configuration into the directory .phive - pretty much like github does with .github.

When running phive for the first time, this is now the default (unless people dislike that as a default...) but if you already have or only want the traditional phive.xml, that will still work and won't go away.

@jwdunne
Copy link
Author

jwdunne commented May 18, 2020

Thank you :) yeah, that makes a lot of sense, that's a great idea. On professional and personal projects, my project root gets cluttered to no end with config files. It's nice Phive recognises that problem and is doing something to help.

I did try upgrading to 0.14.0 after getting 0.13.2 working but I got a NoRateLimit error. I'll try upgrading to 0.14.1 tonight, see if that fixes the problem :)

It's working wonderfully anyway - fighting with composer's SAT solver is not what you want to do when working on side-projects after working at a full-time job. In fact, I'm going to introduce this to the team I lead too :)

Thanks for the awesome project!

@theseer
Copy link
Member

theseer commented May 18, 2020

Glad you like it. If you run into any other issues, do not hesitate to open new tickets :)

@jwdunne
Copy link
Author

jwdunne commented May 18, 2020

Will do :) are you open to bugfix PRs too? Some of us are happy enough to fork, fix bugs and open PRs if we encounter them.

If PRs are welcome, what are the development environment requirements? e.g build tools, etc.

@theseer
Copy link
Member

theseer commented May 18, 2020

Of course PRs are welcome, we're an open source project for a reason :)

That question shows I should probably come around and add more documentation on our website ;)

We use traditional ant for build automation, which should wrap pretty much everything you'd need to do: Install tooling, generating/updating the autoloader (since Phive is not PSR-X compliant by choice) as well as phar release, run tests, ...

Phive should run on PHP 7.2+ and on linux, macos and sigh windows ;)

Other than that, I don't think we have any special needs.

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

No branches or pull requests

2 participants