Ocramius / PackageVersions

:package: Composer addon to efficiently get installed packages' version numbers
MIT License
3.22k stars 67 forks source link

Can't build ocramius/package-versions in nixpkgs #166

Closed wmertens closed 3 years ago

wmertens commented 3 years ago

I'm trying to package uvdesk, which is based on doctrine, which seems to use this package. I used composer2nix to generate expressions, and when I try to build I get this error:

ocramius/package-versions:  Generating version class...

  [ErrorException]                                                                                                                                                                                                              
  file_put_contents(/nix/store/1mfv03a3p0ygxrdjkdybvdj1n797w75j-composer-uvdesk-1.0.12/vendor/ocramius/package-versions/src/PackageVersions/Versions.php_tmp600ef2e81b43b0.91011646): failed to open stream: Permission denied

Any thoughts on how I could generate the package cache outside of the build sandbox? I saw that you're using NixOS :)

Ocramius commented 3 years ago

@wmertens ocramius/package-versions:^2 removed the file_put_contents() behavior overall, as it was indeed a known problem: see https://github.com/Ocramius/PackageVersions/issues/106

I warmly endorse an upgrade, which should lift the problem overall.

wmertens commented 3 years ago

Thank you for your swift response!

I'm a total php noob though, is there a way to force v2 use when it's not even in composer.json

Ocramius commented 3 years ago

I would endorse adding a "conflict": {"ocramius/package-versions": "<2"} there, then run a composer update --dry-run to see what it will change, and if there's any dependency still requiring the old version.

wmertens commented 3 years ago

I see that the latest version of doctrine/migrations still uses v1.8 :-(

https://github.com/doctrine/migrations/blob/5415b4102e25c8ad00015ed0aa816cfe4b2c2827/composer.json#L28

Ocramius commented 3 years ago

@wmertens before reporting an issue there only, do a composer why-not ocramius/package-versions:2 to get a full report of everything that is not compatible.

Since PackageVersions almost didn't change over the years, I suggest sending an upstream patch to doctrine/migrations to be "require": {"ocramius/package-versions": "^1.8 || ^2"}.

Ocramius commented 3 years ago

Also not sure why they would require composer/package-versions-deprecated :shrug: