2019-05-06 16:45:31 +03:00
|
|
|
# How to upgrade packages in this repo
|
|
|
|
|
|
|
|
## Stackage
|
|
|
|
|
2019-11-22 17:24:08 +03:00
|
|
|
The daml repository uses a custom stack snapshot defined in
|
|
|
|
`stack-snapshot.yaml`. Modify the `resolver` entry in that file to update the
|
|
|
|
base Stackage snapshot. Update the package overrides defined in that file as
|
|
|
|
appropriate.
|
|
|
|
|
|
|
|
A few Stackage packages require custom patches or custom build rules. These are
|
|
|
|
defined in the `WORKSPACE` file and referenced in the `vendored_packages`
|
|
|
|
attribute to `stack_snapshot` in the same file.
|
2019-05-06 16:45:31 +03:00
|
|
|
|
2020-07-02 19:55:09 +03:00
|
|
|
After changing any of this entries you need to execute the following command to
|
|
|
|
update the lock-file:
|
|
|
|
|
|
|
|
```
|
|
|
|
bazel run @stackage-unpinned//:pin
|
|
|
|
```
|
|
|
|
|
2019-05-06 16:45:31 +03:00
|
|
|
|
|
|
|
## Nixpkgs
|
|
|
|
|
2019-06-27 19:47:42 +03:00
|
|
|
To update the nixpkgs revision, find a commit in nixkgs-unstable from
|
2021-08-20 15:34:19 +03:00
|
|
|
https://github.com/NixOS/nixpkgs/commits/nixpkgs-unstable and
|
2019-06-27 19:47:42 +03:00
|
|
|
use it in the `rev` field in `nix/nixpkgs/default.src.json`. Set the
|
|
|
|
`sha256` to a dummy hash, e.g., 64 zeros and run `nix-build -A tools
|
|
|
|
-A cached nix` and nix will tell you the correct hash.
|
2019-05-07 17:18:57 +03:00
|
|
|
|
|
|
|
After upgrading the revision, the easiest solution is usually to open
|
|
|
|
a PR and see what fails on CI (running the builds locally can take
|
|
|
|
quite some time). The most common reason for failures is usually that
|
|
|
|
we have overriden a specific package with certain patches that no
|
|
|
|
longer work. In that case, a good first step is to check if these
|
|
|
|
patches are still necessary and if not try to switch to the unpatched
|
|
|
|
package from nixpkgs.
|