$CYLC_VERSION stripping '-1' suffix at runtime

Hi there.

We have Cylc 8.7.0-1 installed and I want to use it in my Rose suite definition via $CYLC_VERSION.

In my .bash_profile I have export CYLC_VERSION=8.7.0-1 but when I echo $CYLC_VERSION in my task pre-script it gives me 8.7.0, i.e. without the -1 suffix.

This doesn’t seem to tally with the docs as far as I can see?

CYLC_VERSION Can be set by users (e.g. in .bash_profile) in order to select a specific Cylc environment. If set this wrapper will look for an installed environment called cylc-$CYLC_VERSION in the ROOT locations (if not set it will look for an installed environment called cylc). e.g, export CYLC_VERSION=8.0.0-1.

Have I misunderstood this?

Thanks

There are actually two definitions of what $CYLC_VERSION means depending on context, which is definitely a bit confusing.

The first is the one used by the wrapper script to determine what cylc installation to use. This is the one you set in your profile and that you have found the docs for. The -1 suffix is for when there are multiple deployments of the same cylc version, perhaps with updated dependencies or configuration.

However, there is a second definition of $CYLC_VERSION as a job script environment variable, which is just the version of cylc that is running. This is what you see within your actual jobs.

1 Like

Hi there!

Oh OK I think I get it now! So basically Cylc itself at runtime doesn’t know anything about the -1, which is just a site-specific thing to point at one of multiple versions, if there are any?

Much appreciated.

Jonny

1 Like

Exactly. The name could be anything, as the wrapper script just uses it as the folder name to try and use, but by convention it is the cylc version with a suffix. Other examples you might see are “8” or “8-next” which is typically a symlink to the latest deployed/soon to be deployed version at a site.

1 Like

Yes it does - CYLC_ENV_NAME is set to the basename of the selected environment (so, in this case, CYLC_ENV_NAME=cylc-8.7.0-1).

1 Like

That works perfectly, thanks!