Here are some workflow suggestions when you’re trying to upgrade packages (or GHC) in wire-server.
Use and install nix-output-monitor when building nix derivations locally. It shows you the dependency tree building as well as the progress. This can give you a sense for much progress you’ve made.
.envrcenvironment probably won’t load anymore. To fix this adjust the for packages that get passed to
wire-server.nix. In the beginning you might want to start out with an empty list as an argument.
You can explore our nix derivations via
nix repland then
:l ./nixto load the attrset in
./nix/default.nix. For example to see which version of
aesonwill be used you can evaluate
wireServer.haskellPackages.aeson.version. TAB-autocompletion also tells you if multiple versions of a package are included in the
aeson_2_1_1_0, which can be used in
manual-overrides.nixto overwrite the default, e.g.
Your goal is to make all packages compile again with nix. Start small by trying to build single packages, e.g.
wire-apior any external dependencies.
nix-build ./nix -A wireServer.haskellPackagesUnoptimizedNoDocs.wire-api
When a dependency doesn’t build anymore because of unmet version constraints see if you can use a never version (
manual-overrides.nixif multiple versions of the package are included in the
nixpkgspin). Also check out the git repo or issue tracker of the dependency to find forks that work. You can also try removing versions constraints of packages: see
If test-suites of a dependency don’t compile, or cannot be run because they require IO interaction you can disable them: see
To force a rebuild of the nix shell delete the
.envdirectory and run
If you need to fix code in a dependency consider forking it and creating a PR to the upstream after successful integration. Clone the repo and then symlink it inside
generate-local-nix-packages.shto temporarily include its dependencies in the development shell. Make sure to include the package in
shellFor. If you’ve got a working shell you can check the output of
ghc-pkg dumpto see the list of nix-provided ghc packages used by cabal.
ghcid --command "cabal repl <package>"when fixing packages
dist-newstyledirectory everytime you upgrade the nix environment, without any exception. That is because cabal does not pick up changes to the
ghc-pkgset (defined the development shell). Cabal will complain about missing dependencies in these cases.
When trying to build any packages with cabal (e.g. for fixing code in a depencency or fixing local packages), make sure you’ve got the right package set in the
shellForargument and the right transitive dependencies in
cabal.project. It takes a couple of tries to get both: a nix provided environment that works, and cabal not complaining about missing dependencies when building inside the environment.
It might happen that a package’s test suite dependencies are not available in the nix environment. When you try to build with cabal it might try to build these external dependencies (which you want to avoid). What might work in these cases is to temporarily update the
default.nixfile (generated by
generate-local-nix-packages.sh) to add the test suits dependencies to the library section.
If cabal is complaining about a missing