Skip to content

Conda: Support .lock file extensions. #5583

@ewels

Description

@ewels

The conda process takes a string input that can be either one or more package names, or a conda environment / lock file. To determine which of these two the string is, we check the file extension:

@PackageScope
boolean isYamlFilePath(String str) {
(str.endsWith('.yml') || str.endsWith('.yaml')) && !str.contains('\n')
}
boolean isTextFilePath(String str) {
str.endsWith('.txt') && !str.contains('\n')
}

This generally works well as until now almost all usage has been with files called environment.yml, by convention. However, since Wave has started supporting Conda lock files, this convention has become weaker. Wave itself generates downloads called condalock (no extension) and the Conda ecosystem often uses .lock file extensions by loose convention. These are interpreted as package names by Nextflow and the Conda environment resolution fails.

Instead I'd propose one of two different approaches:

  1. Try to match the conda string against local file paths, treat as package names only if no local files match (eg. accept any file extension)
  2. Explicitly add support for *.lock and condalock file names.

Originally raised by @pinin4fjords in #5453 - see original issue for examples of current failure / error messages. Splitting that issue into two to keep discussion focussed.

See also #5582 about handling remote files.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions