Repository: composer/composer

Issue #1998: ArchivableFilesFinder returns invalid files
Created: 2013-06-12T21:22:57Z
Problem
When I run satis build, the following error occurs
Could not create archive '/home/renan/test/result/dist/theseer-directoryscanner-1.1.0-1.1.0-528cf4.zip' from '/tmp/composer_archiver/theseer-directoryscanner-1.1.0-1.1.0-528cf4': Iterator Composer\Package\Archiver\ArchivableFilesFinder returned a file that could not be opened "/tmp/composer_archiver/theseer-directoryscanner-1.1.0-1.1.0-528cf4/tests/_data/empty"
Notes
In archive directory there is a symbolic link from linkdir to empty file
ls -l /tmp/composer_archiver/theseer-directoryscanner-1.1.0-1.1.0-528cf4/tests/_data/
total 16
-rw-rw-r-- 1 renan renan    2 Jun 12 17:37 1.txt
-rw-rw-r-- 1 renan renan   31 Jun 12 17:37 2.xml
lrwxrwxrwx 1 renan renan    5 Jun 12 17:37 3.xml -> 2.xml
lrwxrwxrwx 1 renan renan    5 Jun 12 17:37 linkdir -> empty
drwxrwxr-x 2 renan renan 4096 Jun 12 17:37 nested
drwxrwxr-x 2 renan renan 4096 Jun 12 17:37 phpfilter

It seems this symlink is scramble everything. Maybe we should use some \FilesystemIterator flags to configure Symfony\Finder to work as expected.
My environment
PHP 5.4.11 (cli)
Composer version 06dff68ce78cd6a2cef1da61ec749c47c73d5769
Composer Diagnose
Checking platform settings: OK
Checking http connectivity: OK
Checking HTTP proxy: OK
Checking HTTP proxy support for request_fulluri: OK
Checking HTTPS proxy support for request_fulluri: FAIL
It seems there is a problem with your proxy server, try setting the "HTTPS_PROXY_REQUEST_FULLURI" environment variable to "false"
Checking composer version: OK

Satis is fresh as well (today 12/Jun)
Reproducing...
create file satis.json
{
    "name": "teste",
    "homepage": "http://nowhere",
    "repositories": [
        {
            "type": "composer",
            "url": "https://packagist.org"
        }
    ],
    "require": {
        "theseer/directoryscanner" : ">=1.1.0"
    },
    "archive": {
        "directory": "dist"
    }
}

run satis build --no-interaction -vvv ./satis.json ./result
Scanning packages
Downloading https://packagist.org/packages.json
Writing /home/renan/.composer/cache/repo/https---packagist.org/packages.json into cache
Reading /home/renan/.composer/cache/repo/https---packagist.org/p-provider-active.json from cache
Reading /home/renan/.composer/cache/repo/https---packagist.org/p-provider-archived.json from cache
Downloading https://packagist.org/p/provider-latest$0572a0519cb7373a6da71b0661490ae9c7f4c1f4dd91adb6c51fcb03a35231e5.json
Writing /home/renan/.composer/cache/repo/https---packagist.org/p-provider-latest.json into cache
Reading /home/renan/.composer/cache/repo/https---packagist.org/p-provider-stale.json from cache
Reading /home/renan/.composer/cache/repo/https---packagist.org/provider-theseer$directoryscanner.json from cache
Selected theseer/directoryscanner (1.1.0)
Selected theseer/directoryscanner (dev-master)
Creating local downloads in './result/dist'
Dumping 'theseer/directoryscanner-1.1.0.0'.

[RuntimeException] Could not create archive '/home/renan/test/result/dist/theseer-directoryscanner-1.1.0-1.1.0-528cf4.zip'
from '/tmp/composer_archiver/theseer-directoryscanner-1.1.0-1.1.0-528cf4':
Iterator Composer\Package\Archiver\ArchivableFilesFinder returned a file that could not be opened
"/tmp/composer_archiver/theseer-directoryscanner-1.1.0-1.1.0-528cf4/tests/_data/empty"                                                                                   

Exception trace:
 () at phar:///usr/local/bin/satis/vendor/composer/composer/src/Composer/Package/Archiver/PharArchiver.php:54
 Composer\Package\Archiver\PharArchiver->archive() at phar:///usr/local/bin/satis/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php:145
 Composer\Package\Archiver\ArchiveManager->archive() at phar:///usr/local/bin/satis/src/Composer/Satis/Command/BuildCommand.php:289
 Composer\Satis\Command\BuildCommand->dumpDownloads() at phar:///usr/local/bin/satis/src/Composer/Satis/Command/BuildCommand.php:138
 Composer\Satis\Command\BuildCommand->execute() at phar:///usr/local/bin/satis/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:244
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/satis/vendor/symfony/console/Symfony/Component/Console/Application.php:892
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/satis/vendor/symfony/console/Symfony/Component/Console/Application.php:184
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/satis/src/Composer/Satis/Console/Application.php:46
 Composer\Satis\Console\Application->doRun() at phar:///usr/local/bin/satis/vendor/symfony/console/Symfony/Component/Console/Application.php:121
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/satis/bin/satis:8
 require() at /usr/local/bin/satis:15

[UnexpectedValueException] Iterator Composer\Package\Archiver\ArchivableFilesFinder
returned a file that could not be opened "/tmp/composer_archiver/theseer-directoryscanner-1.1.0-1.1.0-528cf4/tests/_data/empty"                                                                                                                  

Exception trace:
 () at phar:///usr/local/bin/satis/vendor/composer/composer/src/Composer/Package/Archiver/PharArchiver.php:45
 PharData->buildFromIterator() at phar:///usr/local/bin/satis/vendor/composer/composer/src/Composer/Package/Archiver/PharArchiver.php:45
 Composer\Package\Archiver\PharArchiver->archive() at phar:///usr/local/bin/satis/vendor/composer/composer/src/Composer/Package/Archiver/ArchiveManager.php:145
 Composer\Package\Archiver\ArchiveManager->archive() at phar:///usr/local/bin/satis/src/Composer/Satis/Command/BuildCommand.php:289
 Composer\Satis\Command\BuildCommand->dumpDownloads() at phar:///usr/local/bin/satis/src/Composer/Satis/Command/BuildCommand.php:138
 Composer\Satis\Command\BuildCommand->execute() at phar:///usr/local/bin/satis/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:244
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/satis/vendor/symfony/console/Symfony/Component/Console/Application.php:892
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/satis/vendor/symfony/console/Symfony/Component/Console/Application.php:184
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/satis/src/Composer/Satis/Console/Application.php:46
 Composer\Satis\Console\Application->doRun() at phar:///usr/local/bin/satis/vendor/symfony/console/Symfony/Component/Console/Application.php:121
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/satis/bin/satis:8
 require() at /usr/local/bin/satis:15

build [--no-html-output] [file] [output-dir]

Duplicate issue #2955: possible problem with archive command and unresolved links 
Created: 2014-05-02T00:39:58Z
I make use of the "theseer/autoload" package, which depends on "theseer/directoryscanner"
When I run the composer Archive command I get an error [UnexpectedValueException] Could not resolve file path in /Composer/Package/Archiver/PharArchiver.php:42
I Identified this two files as problem:
https://github.com/theseer/DirectoryScanner/blob/master/tests/_data/linkdir
https://github.com/theseer/DirectoryScanner/blob/master/tests/_data/nested/empty
This are links which point to a non existing file
As soon as I delete them, the archive commands works as expected.
Excluding them via composer.json does not prevent this error, or at least I was not able to.

Closing comment (2014-05-02T12:09:43Z): related to #1998, #2552 and composer/satis#126
have you tried after commit #2888?