8000 Composer\Package\Archiver\ArchiveManager bug generating ZIP file · Issue #10126 · composer/composer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Composer\Package\Archiver\ArchiveManager bug generating ZIP file #10126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
lfontana-schema31 opened this issue Sep 29, 2021 · 6 comments
Closed
Labels
Milestone

Comments

@lfontana-schema31
Copy link

I'm running SATIS, on MACOS.
All the files in the zip created have "private" prefix (private.gitignore, privatecomposer.json, privatesrc).
I found inside Composer\Package\Archiver

// $filepath = "/private/var/folders/ss/ttbpjpg91pq1853r74cv740c0000gp/T/composer_archive61541dcb55728/.php_cs";
// $sources = "/var/folders/ss/ttbpjpg91pq1853r74cv740c0000gp/T/composer_archive61541dcb55728";

$localname = str_replace($sources.'/', '', $filepath);

So $localname will have "private" prefix

$sources is valued in Composer\Package\Archiver\ArchiveManager so I changed like this

// Directory used to download the sources
            $filepath = sys_get_temp_dir().'/composer_archive'.uniqid();
            $filesystem->ensureDirectoryExists($filepath);
            $splInfo= new \SplFileInfo($filepath);
            $sourcePath = strtr($splInfo->getPath()."/".$splInfo->getFilename(), '\\', '/');

I don't know if this a problem of sys_get_temp_dir or SplFileInfo

Sorry for my very bad english

@Seldaek
Copy link
Member
Seldaek commented Oct 2, 2021

Seems related to #10099 - could you try to see if changing ZipArchiver line 33 from

$sources = $fs->normalizePath($sources);
to

$sources = $fs->normalizePath(realpath($sources));

fixes it? Just adding the realpath there.

@rnbronstein
Copy link

I also have this issue with Satis and I tried the fix above, to no avail -- still getting every file prefixed with "private."

@Seldaek Seldaek modified the milestones: 2.1, 2.2 Dec 8, 2021
@Seldaek
Copy link
Member
Seldaek commented Mar 29, 2022

Closing as no feedback..

@Seldaek Seldaek closed this as completed Mar 29, 2022
@jasonmccreary
Copy link
Contributor

@Seldaek, I can confirm this fixes the issue for me on MacOS. The underlying culprit is sys_get_temp_dir() as it returns /var/folders/..., however, /var/ is a symlink to /private/var/.

I would open a PR, but my guess is this needs to be fixed in more places than the ZipArchiver.

@Seldaek
Copy link
Member
Seldaek commented Sep 11, 2023

@jasonmccreary feel free to PR this fix, but tbh I have no interest in debugging this further given satis has been replaced by https://packagist.com as far as I'm concerned (including your use case which if I understood correctly is selling packages? https://packagist.com/vendors), and running it on MacOS is anyway kinda fringe..

@jasonmccreary
Copy link
Contributor

@Seldaek, I understand. I did look at paid Packagist, but this is kind of a new venture for me and it doesn't generate revenue yet. If it does, I'm glad to consider switching. Just need to understand pricing better (as sliders don't change anything for me)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants
0