joergen7 / cuneiform

Cuneiform distributed programming language
https://cuneiform-lang.org/
Apache License 2.0
232 stars 16 forks source link

File name error #58

Closed bearbob closed 8 years ago

bearbob commented 8 years ago

I have a workflow with the file definition: fq1 = "files/ext_L6918-1_JH-1_S6_R1_001.fastq"; fq2 = "files/ext_L6918-1_JH-1_S6_R1_001.fastq";

By accident, these names happen to be the same file, which (seems) to trigger the following error:

$ cuneiform rna_vc.small.cf {"init terminating in do_boot",{{eexist,make_symlink,["./files/ext_L6918-1_JH-1_S6_R1_001.fastq",["/tmp/cf","-","4",47,119,111,114,107,47,49,47,49,95,101,120,116,95,76,54,57,49,56,45,49,95,74,72,45,49,95,83,54,95,82,49,95,48,48,49,46,102,97,115,116,113]]},[{lib_refactor,apply_refactoring,1,[{file,"/home/jorgen/git/cuneiform/_build/default/lib/effi/src/lib_refactor.erl"},{line,79}]},{lists,foreach,2,[{file,"lists.erl"},{line,1337}]},{local,stage,6,[{file,"/home/jorgen/git/cuneiform/_build/default/lib/cuneiform/src/local.erl"},{line,130}]},{gen_queue,stage_reply,2,[{file,"/home/jorgen/git/cuneiform/_build/default/lib/cuneiform/src/gen_queue.erl"},{line,100}]}]}} User defined signal 2

After changing the filename it works again. Also, when I had the same file but as a .gz it also worked.

joergen7 commented 8 years ago

Since the error occurs in the refactoring phase of a foreign task, it would help to also see the rest of the workflow.

bearbob commented 8 years ago

The error hasn't shown up since. Hope this helps somehow, nonetheless. rnaVC2.txt

joergen7 commented 8 years ago

Ran into the same issue just today. This minimal script reproduces the bug:

deftask cat( out( File ) : <lst( File )> ) in bash *{
  out=out.txt
  cat ${lst[@]} > $out
}*

x = "a.txt" "a.txt";

cat( lst: x );

The problem is, that if a.txt is staged in twice, it already exists the second time effi tries to create a link in the directory. That's why you got the eexist error.

joergen7 commented 8 years ago

Fixed the bug in effi.