Skip to content
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

shallow_listing data loss issue #2087

Open
mr-c opened this issue Dec 15, 2024 · 0 comments
Open

shallow_listing data loss issue #2087

mr-c opened this issue Dec 15, 2024 · 0 comments

Comments

@mr-c
Copy link
Member

mr-c commented Dec 15, 2024

Found via DataBiosphere/toil#5099 (comment)

Setup

mkdir 5099-test
mkdir 5099-test/subdir
touch 5099-test/a 5099-test/b 5099-test/c 5099-test/subdir/d
find 5099-test/
# 5099-test/
# 5099-test/a
# 5099-test/c
# 5099-test/subdir
# 5099-test/subdir/d
# 5099-test/b

5099-minimal-example.cwl

class: Workflow
cwlVersion: v1.2
id: minimal_example
label: minimal_example
inputs:
  - id: msin
    type: Directory[]
outputs:
  - id: msout
    outputSource:
      - second_pass/msout
    type: Directory[]
steps:
  - id: pass
    in:
      - id: msin
        source: msin
    out:
      - id: msout
    run: 5099-pass.cwl
  - id: second_pass
    in:
      - id: msin
        source: pass/msout
    out:
      - id: msout
    run: 5099-pass.cwl

5099-pass.cwl

class: CommandLineTool
cwlVersion: v1.2
id: pass
baseCommand: echo
# arguments:
#  - $(inputs.msin[0].listing)
inputs:
  - id: msin
    type: 
      - Directory[]
outputs:
  - id: msout
    type:
      - Directory[]
    outputBinding:
      outputEval: $(inputs.msin)
requirements:
  - class: LoadListingRequirement
    #loadListing: no_listing
    loadListing: shallow_listing

5099-debug.json

{
         "msin":    [  {"class": "Directory", "path": "5099-test"}]
}

Expected Behavior

cwltool 5099-minimal-example.cwl 5099-debug.json without --outdir does not delete any files from the input directory 5099-test

Actual Behavior

The directory 5099-test/subdir and its contents are deleted

$ find 5099-test/
5099-test/
5099-test/a
5099-test/c
5099-test/b

Your Environment

  • cwltool version: 3.1.20241112140731.dev10+gf1d192dd.d202412
    Check using cwltool --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant