Skip to content

[Finder] regression with excluding symlinks #51314

@dbu

Description

@dbu

Symfony version(s) affected

5.4.26

Description

While upgrading from Symfony 5.4.21 to 5.4.26, we noticed that the assets:install command no longer installs any assets. We use the --symlink and --relative flags. With some debugging, i traced it to the cleanup step of assets:install removing all the symlinks it just created.

For now we use the workaround to pass --no-cleanup to assets:install.

How to reproduce

{
    "require": {
        "symfony/finder": "5.4.26",
        "symfony/filesystem": "5.4.21"
    }
}
<?php
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Finder\Finder;

require ('vendor/autoload.php');

$filesystem = new Filesystem;

$filesystem->remove('public/bundles/mybundle');
$filesystem->mkdir('src/Resources/public/');
$filesystem->mkdir('public/bundles/');
$filesystem->symlink('../../src/Resources/public/', 'public/bundles/mybundle');
$dirsToRemove = Finder::create()->depth(0)->directories()->exclude('mybundle')->in('public/bundles/');
var_dump(iterator_to_array($dirsToRemove));

This outputs an entry for the public/bundles/mybundle symlink.

With finder 5.4.21, the script outputs an empty array as expected. (composer does not find a 5.4.22-5.4.25)

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy