Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Additional configuration for "follow_symlinks" #55

wants to merge 2 commits into from

3 participants

  • enable additional configuration for "follow_symlinks" use case

    without "follow_skip" GatherDir may die when processing some
    file/dir for the second time

Please see for exact details.

@SamuraiJack SamuraiJack - enable additional configuration for "follow_symlinks" use case
  without "follow_skip" GatherDir may fail when processing some
  file/dir for the second time

I'm a little worried about getting more tied to the behavior of File::Find::Rule, which I'd like to stop using.

Can you spell out what behaviors you need available, so I can make sure they're documented as such, rather than being closely tied to the options for FFR?



Ok. Symlinks can form cyclic structures. Seems for protection against the infinite loop, default behavior of FFR is to immediately die when it encounter the file it has already processed (it keeps all resolved file names in hash and counts the processing times).

However in my use case, symlinks can form "good" cycles (w/o infinite loops). Its just a crazy way of working with dependencies in development environment in NodeJS.

FFR also has an option to not die on cycles - and patch makes it accessible via plugin configuration.

Hope that makes sense.

Regards, Nickolay


Any updates on this feature?


I was just churning through pull requests when I
got your request for updates.

SamuraiJack: What I was hoping was that you could update the docs
for the options in question so that they are clear in their intent
without saying that pass through to FFR so that later when I
replace all our use of FFR, they still make sense and work. ;-)


@rjbs Did you know, that you can merge the pull request from the web interface on github? ;)


Hey, any updates? Don't want to maintain an own copy of "GatherDir".


I just went to merge this. Honestly! I even did some minor tweaking of commits messages and whitespace (now available at rjbs/symlinks) but I see there are no tests.

I want to be able to replace File::Find::Rule in the future, and without tests for this, I'm sure to break it. Give me some tests and I promise to merge it within a few days of the patch!


Ok, will do in few days, thanks!


Where's this at now?

@rjbs rjbs added the Abandoned? label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 2, 2011
  1. @SamuraiJack

    - enable additional configuration for "follow_symlinks" use case

    SamuraiJack committed
      without "follow_skip" GatherDir may fail when processing some
      file/dir for the second time
Commits on Dec 23, 2011
  1. @SamuraiJack

    - renamed "follow_skip" to "allowallow_symlink_cycles"

    SamuraiJack committed
    - not refer to FFR in documentation
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 1 deletion.
  1. +20 −1 lib/Dist/Zilla/Plugin/
21 lib/Dist/Zilla/Plugin/
@@ -100,6 +100,22 @@ has follow_symlinks => (
default => 0,
+=attr allow_symlink_cycles
+Is only meaningful if "follow_symlinks" is enabled. When set to "true" will allow
+you to have symlink cycles in files being gathered by this plugin. Default value
+is "false" meaning the plugin will die with diagnostic message.
+has allow_symlink_cycles => (
+ is => 'ro',
+ isa => 'Bool',
+ default => 0,
sub mvp_multivalue_args { qw(exclude_filename exclude_match) }
=attr exclude_filename
@@ -138,7 +154,10 @@ sub gather_files {
my @files;
my $rule = File::Find::Rule->new();
- $rule->extras({follow => $self->follow_symlinks});
+ # for `allow_symlink_cycles=true` we set the "follow_skip" to 2
+ # for `allow_symlink_cycles=false` we set the "follow_skip" to 1 (default value)
+ # for details refer to:
+ $rule->extras({follow => $self->follow_symlinks, follow_skip => $self->allow_symlink_cycles ? 2 : 1 });
FILE: for my $filename ($rule->file->in($root)) {
my $file = file($filename)->relative($root);
Something went wrong with that request. Please try again.