hoaproject/Central

Error when installing hoa/ruler with the lowest dependancies

agallou opened this issue · 7 comments

Following this issue of atoum's extension ruler-extension : atoum/ruler-extension#22

Let's install hoa/ruler in the 1.15.11.09 version :

composer require hoa/ruler:1.15.11.09

So we get this composer.json :

{
    "require": {
        "hoa/ruler": "1.15.11.09"
    }
}

If we use this test file :

<?php

include __DIR__ . '/vendor/autoload.php';


$hoa = new \Hoa\Ruler\Ruler();
$hoa->assert("true");

We have no error when executing it php test.php.

But if we install it with the minimum version of the dependancies with this command :

composer update --prefer-lowest

We get this error :

PHP Fatal error:  Uncaught Hoa\File\File::_open(): (1) Failed to open stream hoa://Library/Ruler/Grammar.pp.
in /home/agallou/tests/test-hoa-deps/vendor/hoa/file/Hoa/File/File.php at line 234.
  thrown in /home/agallou/tests/test-hoa-deps/vendor/hoa/file/Hoa/File/File.php on line 234

Here is the dependancies versions, on stable (the removed), and lowest (the installed) :

   composer update --prefer-lowest
   Loading composer repositories with package information
   Updating dependencies (including require-dev)
     - Removing hoa/ustring (3.15.11.09)
     - Removing hoa/core (2.15.11.09)
     - Installing hoa/core (2.14.09.17)
       Loading from cache

     - Removing hoa/visitor (1.15.08.17)
     - Installing hoa/visitor (1.14.11.15)
       Loading from cache

     - Removing hoa/iterator (1.15.10.29)
     - Installing hoa/iterator (1.14.11.07)
       Loading from cache

     - Installing hoa/string (2.14.09.16)
       Loading from cache

     - Removing hoa/regex (0.15.08.13)
     - Installing hoa/regex (0.14.11.25)
       Loading from cache

     - Removing hoa/compiler (2.15.10.29)
     - Installing hoa/compiler (2.14.11.26)
       Loading from cache

     - Removing hoa/math (0.15.10.26)
     - Installing hoa/math (0.14.11.09)
       Loading from cache

     - Removing hoa/stream (0.15.08.28)
     - Installing hoa/stream (0.14.09.17)
       Loading from cache

     - Removing hoa/file (0.15.11.09)
     - Installing hoa/file (0.14.11.09)
       Loading from cache

For the ruler exxtension, that means we have to add minimim versions on the hoa/ruler dependancies in the composer.json : atoum/ruler-extension#22. That should not be needed.

To check if this work, a matrix could be configured in the travis.yml like this : https://github.com/atoum/ruler-extension/pull/25/files.

Hi,

@agallou I understand your problem but why did you need --prefer-lowest ?

Isn't it like install an OS without updates and say "I have my feature, no care about security/bug fix" ?

Yes with only one package it didn't have much use.

But you could be stuck with a specific version of a dependancy, and in that case the warning should be during the composer install instead of getting an error

Hywan commented

What to do with this issue? Can we close it?

@Hywan I don't know what to do with this "issue" since Hoa work with Rush Release.
The only way to fix it should be to updates the lowest dependencies and make anew release on each dependents libraries when we release a new fix/feature. And it's simply too many work…

Hywan commented

Exactly, it's simply a huge amount of work, and we do not have the force to do that so far. So I would be likely to close the issue and re-open it if someone encounter the same issue one day.

Thoughts?

Ok, go for it

@Hywan on the atoum ruler-ext, we fixed the problem using the conflict section in the composer.json (https://github.com/atoum/ruler-extension/blob/master/composer.json#L8-L14).

Anyone having the same issue can resolve it the same way: marking external dependency as conflicting will prevent composer installing them.

Dealing with this on your side might be a lot of work as it will require to go back to each release, fix the problem and issue new ones (corrective, z++ with semver). As Hoa does not use semver, this will be hard to release with a correct semantic.

For me it's a 👍 for closing this issue.