FTBFS: build time test error due to circular build dependency
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
php-parser (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
php-phar-io-manifest (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Due to a circular build dependency (phpunit dependency chain), php-parser is pulled during its own package build time.
Since php packages ship autoloaders that load the dependencies for a given package when a package is loaded, the installed version of php-parser is loaded when the system's phpunit is called.
This means that, when running the php-parser package test suite during build time, we are actually testing the installed version (or the previous version) of the package, and not the one being built.
This is mostly pointless and will trigger test errors when bug fixes include regression tests.
Below you will find a complete explanation of the issue as discussed in #debian-php in IRC.
For now, let's skip running the test suite for this package. Let's also keep this bug open since we should find an actual solution for the issue (and I also understand several other packages are affected by the same problem).
20:55 < athos> hey taffit ! I took some time to understand what was going on with
https:/
20:56 < athos> I suppose I get it now (correct me if I am wrong)! There are 3 reverse
20:56 < athos> they are all phpunit dependencies
20:57 < athos> SebastianBergma
20:58 < athos> although we are getting the local php-parser in the path in d/rules (ln -s
20:59 < athos> the debian installed autoloaders will end up pulling the installed version of
the package anyways
20:59 < athos> (the package being tested, in this case, php-parser)
21:02 < athos> This is the first occurence of the issue I have seen, but now I am wondering
if this is the case for anything in the phpunit dependency tree
21:05 < athos> if it is, so, for those packges, we are actually testing the previous version
of the package each time we upload them and sometimes tests will break (that
is the point of unit tests!) and that is why we (you) do the binary package
21:09 < athos> I wonder if it makes sense to run the tests during build time for these
21:19 < athos> But more importantly, I wonder how we could improve the situation so we can
04:10 < taffit> athos: I haven’t yet succedded to ensure the new package is being tested at
04:14 < taffit> Maybe by using “require_once __DIR__ . '/../<relative_
04:14 < taffit> (as is currently done for composer and symfony, at least partly)
php-phar- io-manifest is also affected (this is a phpunit dependency)