Open jfennick opened 1 year ago
This needs a fix on the cwltool side, sorry!
Oh, I think this was already fixed in cwltool 3.1.20230302145532 ; can you try that out and see if you still have that error?
I see. I was installing toil using pip install toil[cw]
, and the latest release does not have this fix:
https://github.com/DataBiosphere/toil/blob/releases/5.9.2/requirements-cwl.txt
However, in a brand new conda environment, installing from source using
pip install "git+https://github.com/DataBiosphere/toil.git#egg=toil[cwl]"
still gives the same error.
(pytoolgen) jakefennick$ cwltool --version
/Users/jakefennick/mambaforge-pypy3/envs/pytoolgen/bin/cwltool 3.1.20230302145532
(pytoolgen) jakefennick$ toil --version
5.10.0a1
(pytoolgen) jakefennick$ toil-cwl-runner --enable-dev --enable-ext pytoolgen.txt zing.txt
[2023-03-15T15:51:18-0600] [MainThread] [I] [cwltool] Resolved 'pytoolgen.txt' to 'file:///Users/jakefennick/pytoolgen.txt'
[2023-03-15T15:51:19-0600] [MainThread] [I] [toil.job] Saving graph of 1 jobs, 1 new
[2023-03-15T15:51:19-0600] [MainThread] [I] [toil.job] Processing job 'CWLJob' pytoolgen.txt kind-CWLJob/instance-xu9x5q0k v0
Traceback (most recent call last):
File "/Users/jakefennick/mambaforge-pypy3/envs/pytoolgen/bin/toil-cwl-runner", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/jakefennick/mambaforge-pypy3/envs/pytoolgen/lib/python3.11/site-packages/toil/cwl/cwltoil.py", line 3780, in main
outobj = toil.start(wf1)
^^^^^^^^^^^^^^^
File "/Users/jakefennick/mambaforge-pypy3/envs/pytoolgen/lib/python3.11/site-packages/toil/common.py", line 1040, in start
rootJobDescription = rootJob.saveAsRootJob(self._jobStore)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jakefennick/mambaforge-pypy3/envs/pytoolgen/lib/python3.11/site-packages/toil/job.py", line 2568, in saveAsRootJob
self._saveJobGraph(jobStore, saveSelf=True)
File "/Users/jakefennick/mambaforge-pypy3/envs/pytoolgen/lib/python3.11/site-packages/toil/job.py", line 2541, in _saveJobGraph
job.saveBody(jobStore)
File "/Users/jakefennick/mambaforge-pypy3/envs/pytoolgen/lib/python3.11/site-packages/toil/job.py", line 2438, in saveBody
pickle.dump(self, fileHandle, pickle.HIGHEST_PROTOCOL)
AttributeError: Can't pickle local object 'Loader.__init__.<locals>.<lambda>'
https://github.com/common-workflow-language/cwltool/blob/main/docs/processgen.rst
Toil cannot pickle a cwltool:ProcessGenerator object. This is presumably a simple fix; it appears that one additional clause needs to be inserted into the
remove_pickle_problems
function. https://github.com/DataBiosphere/toil/blob/master/src/toil/cwl/cwltoil.py#L2663 (I attempted to do this myself, without success.)Attached is a minimal reproducible example: pytoolgen.txt zing.txt