Skip to content

"shadow: full" mode skip symbolic links #2511

@yxwucq

Description

@yxwucq

Snakemake version
7.30.1

Describe the bug
Using "full" mode of shadow will skip files in symbolic link dirs

Minimal example

tree -L 1 .
>  .
> ├── ref -> /abs/ref

rule UseSomeFiles:
    input:
        ref="ref/hg38.genome.bed",
    output:
        out="output/cat_output.txt"
    shadow: full
    shell: """
        cat {input.ref} > {output.out}
    """

Excuting this will raise Error: Error: Unable to open file ref/hg38.genome.bed. Exiting.

Additional context
In job.py, os.walk automatically ignores symlink by default setting followlinks = False. https://docs.python.org/3/library/os.html#os.walk

elif self.rule.shadow_depth == "full":
      snakemake_dir = os.path.join(cwd, ".snakemake")
      for dirpath, dirnames, filenames in os.walk(cwd):
      . . .

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions