Open lcotonea opened 11 years ago
Hi (again ;) ),
After reading your code I saw that the problematic snippet's code is only added when the compression is active (that is the default behaviour):
PharPackager.java (l137):
String compression = "";
if (request.isCompressed()) {
if (request.isLargePhar()) {
compression =
"$phar->stopBuffering();\n" +
"$phar = new Phar('$:{pharfilepath}'.DIRECTORY_SEPARATOR.'" +
"$:{pharfilename}', 0, '$:{pharfilename}');\n" +
"$phar->startBuffering();\n" +
"foreach (new RecursiveIteratorIterator($phar) as $file) {" +
" if (!$file->isDir()) $file->compress(Phar::GZ); }\n";
} else {
compression = "$phar->compressFiles(Phar::GZ);\n";
}
}
Then the workaround is to disable the phar compression under cygwin/linux: in the project pom.xml file:
<plugin>
<groupId>org.phpmaven</groupId>
<artifactId>maven-php-phar</artifactId>
<configuration>
<pharConfig>
<compressed>false</compressed>
</pharConfig>
</configuration>
</plugin>
I've run into this issue on freebsd, but oddly enough, it works properly under OSX. Is this targeted to be fixed? Having to keep compression off indefinitely would be unfortunate.
Hi!
On linux and cygwin platforms, I've this issue during a "mvn clean install". On linux (centos 6), I've installed PHP 5.3.3. On cygwin (windows 7), I've installed PHP 5.3.13.
Here the stack trace:
This is the line 22 of the snippet.php that causes the build failure.
So, here the snippet.php file automatically generated by the php-maven plugin:
At line 22, It seems that the "new phar..." causes an access violation on the previous phar file (this is the same file). If I comment this line, everything is fine and I can launch a mvn install.
I think that the code generation of the snippet.php file must not create new phar if a a previous phar object has been instanciated and uses the same target phar file.
So, Is there a way to workaround this problem until the bug fix release?