svanderburg / composer2nix

Generate Nix expressions to build PHP composer packages
MIT License
88 stars 25 forks source link

No longer builds from Nix 21.11 onwards #25

Closed raboof closed 2 years ago

raboof commented 2 years ago

Since 21.11 updates the default php version to 8.x, composer2nix no longer builds with that nixpkgs.

I tried doing a 'composer update' on the root, which seemed fine. However, also doing 'composer update' in tests/dependencies yielded:

  Problem 1
    - phpunit/phpunit[9.0.0, ..., 9.0.2] require php ^7.3 -> your php version (8.0.13) does not satisfy that requirement.
    - Root composer.json requires phpunit/phpunit 9.0.x -> satisfiable by phpunit/phpunit[9.0.0, 9.0.1, 9.0.2].

Updating phpunit to 9.5.x in composer.json led to another problem:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install phpunit/phpunit 9.5.1 (conflict analysis result)
    - Conclusion: don't install phpunit/phpunit 9.5.2 (conflict analysis result)
    - Conclusion: don't install phpunit/phpunit 9.5.3 (conflict analysis result)
    - Conclusion: don't install phpunit/phpunit 9.5.4 (conflict analysis result)
    - Conclusion: don't install phpunit/phpunit 9.5.5 (conflict analysis result)
    - Conclusion: don't install phpunit/phpunit 9.5.6 (conflict analysis result)
    - Conclusion: don't install phpunit/phpunit 9.5.7 (conflict analysis result)
    - Conclusion: don't install phpunit/phpunit 9.5.8 (conflict analysis result)
    - Conclusion: don't install phpunit/phpunit 9.5.9 (conflict analysis result)
    - Conclusion: don't install phpunit/phpunit 9.5.10 (conflict analysis result)
    - Conclusion: don't install phpunit/phpunit 9.5.11 (conflict analysis result)
    - Root composer.json requires phpunit/phpunit 9.5.x -> satisfiable by phpunit/phpunit[9.5.0, ..., 9.5.11].
    - Conclusion: don't install phpdocumentor/reflection-docblock 5.3.0 (conflict analysis result)
    - Root composer.json requires phpdocumentor/phpdocumentor 2.9.1 -> satisfiable by phpdocumentor/phpdocumentor[v2.9.1].
    - Conclusion: don't install one of phpspec/prophecy[1.12.1], phpdocumentor/reflection-docblock[2.0.4] | install one of phpdocumentor/reflection-docblock[5.2.2, 5.3.0] (conflict analysis result)
    - phpunit/phpunit 9.5.0 requires phpspec/prophecy ^1.12.1 -> satisfiable by phpspec/prophecy[1.12.1, ..., v1.15.0].
    - Conclusion: don't install phpdocumentor/reflection-docblock[5.2.2] | install phpdocumentor/reflection-docblock[2.0.5] (conflict analysis result)
    - Conclusion: don't install phpspec/prophecy[v1.15.0] | install one of phpdocumentor/reflection-docblock[2.0.5, 5.3.0] (conflict analysis result)
    - Conclusion: don't install phpspec/prophecy[1.14.0] | install one of phpdocumentor/reflection-docblock[2.0.5, 5.3.0] (conflict analysis result)
    - Conclusion: don't install phpspec/prophecy[1.13.0] | install one of phpdocumentor/reflection-docblock[2.0.5, 5.3.0] (conflict analysis result)
    - Conclusion: don't install phpspec/prophecy[1.12.2] | install one of phpdocumentor/reflection-docblock[2.0.5, 5.3.0] (conflict analysis result)
    - Conclusion: don't install phpdocumentor/reflection-docblock 2.0.5 (conflict analysis result)
    - phpdocumentor/phpdocumentor v2.9.1 requires phpdocumentor/reflection-docblock ~2.0 -> satisfiable by phpdocumentor/reflection-docblock[2.0.0, ..., 2.0.5].
    - You can only install one version of a package, so only one of these can be installed: phpdocumentor/reflection-docblock[2.0.0, ..., 2.0.5, 5.2.0, 5.2.1, 5.2.2, 5.3.0].
    - phpspec/prophecy 1.12.1 requires phpdocumentor/reflection-docblock ^5.2 -> satisfiable by phpdocumentor/reflection-docblock[5.2.0, 5.2.1, 5.2.2, 5.3.0].
    - Conclusion: don't install phpdocumentor/reflection-docblock[5.2.1] | install one of phpdocumentor/reflection-docblock[2.0.4, 2.0.5] (conflict analysis result)

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

I'm not too familiar with php, so I'm not sure where to go from there :)

raboof commented 2 years ago

of course since Nix is awesome I could work around this by passing in the old nixpkgs, using the following shell.nix

{ pkgs ? import <nixpkgs> {} }:

let
  oldpkgs = /home/aengelen/nixpkgs-stable;
in
pkgs.mkShell {
  buildInputs = [
    pkgs.docker-compose
    pkgs.nodePackages.node2nix
    ((pkgs.callPackage ../composer2nix/release.nix { nixpkgs = oldpkgs; }).package.x86_64-linux)
  ];
}
svanderburg commented 2 years ago

I think this no longer a problem anymore. I've been using it on this version of Nixpkgs for a while and it seems to work fine.

I've also got rid of one of the problematic development/test dependencies: phpDocumentator. The latter no longer seems to support composer properly.

raboof commented 2 years ago

OK, I don't have a setup to test that right now, so let's close this - I'll reopen in case I ever revisit the topic and run into the problem again :)