Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.gitignore, config, nimble: use lock file (#418)
Before this commit, configlet pinned the version of each Nimble dependency by using the .nimble file. This was the best approach until recently, and was good enough for creating configlet releases, but it wasn't robust [1] - Nimble wasn't designed to produce reproducible builds with that mechanism. For example, Nimble didn't check the hash of a package at build time to ensure that it was unmodified. Now that we've updated to Nim 2.0 [2] and vendored the parseopt3 dependency [3], let's use Nimble's new lock file mechanism. This should be robust. Run `nimble lock` and `nimble setup`, and remove versions from the nimble file. From the docs for `nimble lock` [4]: The `nimble lock` command will generate or update a package lock file named `nimble.lock`. This file is used for pinning the exact versions of the dependencies of the package. The file is intended to be committed and used by other developers to ensure that exactly the same version of the dependencies is used by all developers. [...] If a lock file `nimble.lock`` exists, then on performing all Nimble commands which require searching for dependencies and downloading them in the case they are missing (like `build`, `install`, `develop`), it is read and its content is used to download the same version of the project dependencies by using the URL, download method and VCS revision written in it. The checksum of the downloaded package is compared against the one written in the lock file. In the case the two checksums are not equal then it will be printed error message and the operation will be aborted. Reverse dependencies are added for installed locked dependencies just like for any other package being locally installed. and `nimble setup` [5]: The `nimble setup` command creates a `nimble.paths` file containing file system paths to the dependencies. It also includes the paths file in the `config.nims` file (by creating it if it does not already exist) to make them available for the compiler. `nimble.paths` file is user-specific and MUST NOT be committed. The command also adds `nimble.develop` and `nimble.paths` files to the `.gitignore` file.` Closes: #467 [1] d6d7283 ("build: pin versions of Nimble packages", 2021-11-25) [2] fa7d0bb (".github, config, json, nimble: bump Nim from 1.6.12 to 2.0.0", 2023-08-08) [3] 7471af3 ("nimble, patches, cli: vendor parseopt3 dependency", 2023-08-08) [4] https://github.com/nim-lang/nimble/blob/412af022a441/readme.markdown#nimble-lock [5] https://github.com/nim-lang/nimble/blob/412af022a441/readme.markdown#nimble-setup
- Loading branch information