Skip to content

build: pin versions of Nimble packages #387

@ee7

Description

@ee7

Our configlet.nimble currently contains

requires "nim >= 1.4.8"
requires "parsetoml"
requires "cligen"
requires "uuids >= 0.1.11"

showing that, currently, we just use the latest version of the Nimble packages parsetoml, cligen, and uuids. This makes the build less reproducible, and allows buggy/malicious updates to these dependencies to affect configlet.

We're in this situation because, unfortunately, Nimble doesn't fully support pinning a fixed hash. It's possible to write e.g.

requires "parsetoml == 0.6.0"

and this is probably an improvement, but nothing stops someone with write access to parsetoml from tagging a different commit as 0.6.0.

Some possible solutions:

  1. Use git submodules (or similar).
  2. Use == for each Nimble dependency in the Nimble file, and then make the tests fail if the installed package is not as expected (to catch the re-tag case).
  3. Add an extra build script that clones each package repo and installs a fixed version. Then, the dependency is already satisfied when nimble build is run.
  4. Wait for Nimble to support lock files - this is hopefully coming in the not-so-distant future (see giant PR: https://github.com/nim-lang/nimble/pull/913/files).
  5. Pin commit refs of packages in the .nimble file, even though it isn't recommended. Edit: this is what we did (see d6d7283).

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: buildNon-.nim changes that affect the release binary

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions