Question: Failing to use $mixin to include "global" settings
gravatar for karl.nordstrom
3.9 years ago by
karl.nordstrom90 wrote:

(Duplication of

I want to split out some off my settings to a central configuration file and decided to use the mixin keyword. I started out with this example:


cwlVersion: "v1.0"

class: Workflow

  $mixin: settings.yml
    type: File


  type: string
  default: "/opt/java6/bin/java"
  type: string
  default: "/opt/java8/bin/java"

Running this through cwltool (v1.0.20161110155008) I get the following error:

Tool definition failed validation:
While checking field `inputs`
  While checking object `file:///DEEP_fhgfs/projects/karln/WGBS/161007.cwlPlayground/git/BS-seq-pipelines/CWL/pipelines/postMap/bisSNP-realignPipe.yml#$mixin`
    Field `type` contains undefined reference to `../settings.yml`, tried [u'file:///DEEP_fhgfs/projects/karln/WGBS/161007.cwlPlayground/git/BS-seq-pipelines/CWL/pipelines/postMap/bisSNP-realignPipe.yml#../settings.yml']

My question is two-fold:

  1. What am I doing wrong? I assume that I'm formatting the settings.yml file wrongly. (Including the curly brackets from the example renders me another error)
  2. Is there a better way to provide global settings for multiple tools?

(Edit: after trying to figure it out for a while this is as far as I got. I also found an issue on the CWL-github page referring to something similar)

ADD COMMENTlink modified 3.9 years ago by Michael R. Crusoe1.8k • written 3.9 years ago by karl.nordstrom90

you can use that to check your yaml

ADD REPLYlink written 3.9 years ago by Zaag800

Thanks for the site. Very useful.

Both files validate, but the tool helped me what could be the problem. The $mixin line is an entry in the inputs array. This leads to that the content of the settings.yml file becomes a subarray instead of being mixed in with the other elements.

ADD REPLYlink written 3.9 years ago by karl.nordstrom90

It might be that I'm duplicating this:

ADD REPLYlink written 3.9 years ago by karl.nordstrom90
gravatar for Michael R. Crusoe
3.9 years ago by
Common Workflow Language project
Michael R. Crusoe1.8k wrote:

Hello Karl,

  1. You don't appear to be doing anything wrong -- looks like you found a bug in the reference implementation!
  2. $mixin was designed to solve your use case, so there isn't a better way

We don't have any CWL conformance tests that use mixins, hence why the pull request is open.

ADD COMMENTlink written 3.9 years ago by Michael R. Crusoe1.8k

OK, after doing some things wrong I found pull request 309 and it confirmed that I was on the right track :) I'll wait for it to resolve. It would be nice to have, but I can work around it for now.

ADD REPLYlink written 3.9 years ago by karl.nordstrom90
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1005 users visited in the last hour