[SRU] minifycss fails to run

Bug #2060848 reported by Sudip Mukherjee
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
matthiasmullie-minify (Debian)
Fix Released
Unknown
matthiasmullie-minify (Ubuntu)
Fix Released
Undecided
Unassigned
Mantic
Confirmed
Undecided
Unassigned
Noble
Confirmed
Undecided
Unassigned

Bug Description

[ Impact ]

minifycss and minifyjs is completely unusable and will fail immediately on execution with the error:

$ minifycss
PHP Warning: require_once(/usr/bin/../src/Minify.php): Failed to open stream: No such file or directory in /usr/bin/minifycss on line 10
PHP Fatal error: Uncaught Error: Failed opening required '/usr/bin/../src/Minify.php' (include_path='.:/usr/share/php') in /usr/bin/minifycss:10
Stack trace:
#0 {main}
  thrown in /usr/bin/minifycss on line 10

$ minifyjs
PHP Warning: require_once(/usr/bin/../src/Minify.php): Failed to open stream: No such file or directory in /usr/bin/minifyjs on line 10
PHP Fatal error: Uncaught Error: Failed opening required '/usr/bin/../src/Minify.php' (include_path='.:/usr/share/php') in /usr/bin/minifyjs:10
Stack trace:
#0 {main}
  thrown in /usr/bin/minifyjs on line 10

[ Test Plan ]

1. install php-matthiasmullie-minify
2. copy the sample test files from tests folder of the source

test minifycss:
minifycss tests/css/sample/bom/bom.css

test minifyjs:
minifyjs tests/js/sample/bugs/227/original.js

If the package is not fixed it will result in the above error.
With the fixed package it will display the minified versions.

[ Where problems could occur ]

The fix is including autoload.php which has been autogenerated as part of the build and is adding all the required paths. It is not changing any part of the code and there should not be any regression due to this change.

[ Other Info ]

Oracular, Noble and Mantic were affected. Oracular now has synced and the Debian fix is in it now.

[ Original Bug Description ]

minifycss fails to run with the error:

$ minifycss
PHP Warning: require_once(/usr/bin/../src/Minify.php): Failed to open stream: No such file or directory in /usr/bin/minifycss on line 10
PHP Fatal error: Uncaught Error: Failed opening required '/usr/bin/../src/Minify.php' (include_path='.:/usr/share/php') in /usr/bin/minifycss:10
Stack trace:
#0 {main}
  thrown in /usr/bin/minifycss on line 10

Tags: mantic noble
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

debdiff for Noble attached. Mantic is also affected, will add debdiff for Mantic after Noble is fixed,

tags: added: noble
tags: added: mantic
Changed in matthiasmullie-minify (Ubuntu):
status: New → Confirmed
Changed in matthiasmullie-minify (Debian):
status: Unknown → New
Revision history for this message
Andreas Hasenack (ahasenack) wrote :
Download full text (3.4 KiB)

diff -Nru matthiasmullie-minify-1.3.68/debian/patches/fix-path.patch matthiasmullie-minify-1.3.68/debian/patches/fix-path.patch
--- matthiasmullie-minify-1.3.68/debian/patches/fix-path.patch 1970-01-01 01:00:00.000000000 +0100
+++ matthiasmullie-minify-1.3.68/debian/patches/fix-path.patch 2024-04-10 18:48:17.000000000 +0100
@@ -0,0 +1,37 @@
+Description: Fix paths of the files minify required
+Author: Sudip Mukherjee <email address hidden>
+Bug-Ubuntu: https://launchpad.net/bugs/2060848
+Forwarded: not-needed
+Last-Update: 2024-04-10

You could also add the debian bug to this header:
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1068767

I wouldn't block the upload on this, though. But I have another question.

Are there more fixes needed? I just quickly tried to run it with a random css file that is in the same package, and it failed:

$ minifycss ./tests/css/sample/convert_relative_path/source/absolute.css
PHP Fatal error: Uncaught Error: Class "MatthiasMullie\PathConverter\Converter" not found in /usr/share/php/MatthiasMullie/Minify/CSS.php:788
Stack trace:
#0 /usr/share/php/MatthiasMullie/Minify/CSS.php(339): MatthiasMullie\Minify\CSS->getPathConverter()
#1 /usr/share/php/MatthiasMullie/Minify/Minify.php(149): MatthiasMullie\Minify\CSS->execute()
#2 /usr/bin/minifycss(41): MatthiasMullie\Minify\Minify->minify()
#3 {main}
  thrown in /usr/share/php/MatthiasMullie/Minify/CSS.php on line 788

The DEP8 tests also seems to be failing, at least locally:
$ AUTOPKGTEST_TMP=$(mktemp -d) sh debian/tests/upstream
phpab %development% - Copyright (C) 2009 - 2024 by Arne Blankerts and Contributors

Scanning directory ./tests

Autoload file ./vendor/autoload.php generated.

Proceeding without a composer.json file.PHPUnit 9.6.17 by Sebastian Bergmann and contributors.

Warning: Incorrect filter configuration, code coverage will not be processed

............................................................... 63 / 343 ( 18%)
............................................................... 126 / 343 ( 36%)
..............................F....E........................... 189 / 343 ( 55%)
............................................................... 252 / 343 ( 73%)
............................................................... 315 / 343 ( 91%)
............................ 343 / 343 (100%)

Time: 00:00.091, Memory: 12.00 MB

There was 1 error:

1) MatthiasMullie\Minify\Test\AbstractTest::testCache
Error: Class "MatthiasMullie\Scrapbook\Adapters\MemoryStore" not found

/tmp/tmp.w3M8gzyBuN/tests/js/AbstractTest.php:218

--

There was ...

Read more...

Changed in matthiasmullie-minify (Ubuntu Noble):
status: Confirmed → Incomplete
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

debdiff updated. the new error you noticed was caused as upstream has split "PathConverter" in a separate repo and is now a separate package.

Changed in matthiasmullie-minify (Ubuntu Noble):
status: Incomplete → Confirmed
Changed in matthiasmullie-minify (Debian):
status: New → Fix Released
Revision history for this message
Paride Legovini (paride) wrote :

Next steps:

- wait for Oracular to Open
- sync the fixed version from Debian
- evaluate a SRU of the Debian fix, which AIUI is [1].
  Note: that's different from the proposed debdiff.

[1] https://salsa.debian.org/php-team/pear/matthiasmullie-minify/-/commit/0fabfdfb710ccb12cc31eddbc7c541464fcb8a05

Changed in matthiasmullie-minify (Ubuntu Mantic):
assignee: nobody → Sudip Mukherjee (sudipmuk)
Changed in matthiasmullie-minify (Ubuntu Noble):
assignee: nobody → Sudip Mukherjee (sudipmuk)
Changed in matthiasmullie-minify (Ubuntu Mantic):
status: New → In Progress
Changed in matthiasmullie-minify (Ubuntu Noble):
status: Confirmed → In Progress
Changed in matthiasmullie-minify (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote (last edit ):

The Debian fix has synced with Oracular now.

Adding modified debdiff for Noble. And, just to reply about Paride's comment about difference between the Debian fix and the previous proposed SRU patch, the previopus proposed SRU debdiff for Noble was made before Noble was released and Debian fix was not done at that time.

The Noble and Mantic packages with the SRU fix are built in a PPA and are available at https://launchpad.net/~sudipmuk/+archive/ubuntu/test-ppa/+packages

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

Debdiff for Mantic attached.

Changed in matthiasmullie-minify (Ubuntu Mantic):
assignee: Sudip Mukherjee (sudipmuk) → nobody
Changed in matthiasmullie-minify (Ubuntu Noble):
assignee: Sudip Mukherjee (sudipmuk) → nobody
Changed in matthiasmullie-minify (Ubuntu Mantic):
status: In Progress → Confirmed
Changed in matthiasmullie-minify (Ubuntu Noble):
status: In Progress → Confirmed
description: updated
summary: - minifycss fails to run in Noble
+ [SRU] minifycss fails to run
Changed in matthiasmullie-minify (Ubuntu Mantic):
assignee: nobody → Sudip Mukherjee (sudipmuk)
Changed in matthiasmullie-minify (Ubuntu Noble):
assignee: nobody → Sudip Mukherjee (sudipmuk)
Changed in matthiasmullie-minify (Ubuntu Mantic):
status: Confirmed → In Progress
Changed in matthiasmullie-minify (Ubuntu Noble):
status: Confirmed → In Progress
Changed in matthiasmullie-minify (Ubuntu Mantic):
status: In Progress → Confirmed
Changed in matthiasmullie-minify (Ubuntu Noble):
status: In Progress → Confirmed
Changed in matthiasmullie-minify (Ubuntu Mantic):
assignee: Sudip Mukherjee (sudipmuk) → nobody
Changed in matthiasmullie-minify (Ubuntu Noble):
assignee: Sudip Mukherjee (sudipmuk) → nobody
Revision history for this message
Paride Legovini (paride) wrote :

This LGTM, I just have a nit. For noble you prepared this d/changelog entry:

matthiasmullie-minify (1.3.68-4ubuntu0.24.04.1) noble; urgency=medium

while for Mantic:

matthiasmullie-minify (1.3.68-4ubuntu0.1) mantic; urgency=medium

Can you please make them consistent (always ubuntu0.XX.YY.n)?

Thanks!

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

Updated debdiff for Mantic (though I do not see why that was required technically, apart from being consistent in versions).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.