Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ccd17ca
Use GHC 9.2.4 in nix and cabal
smatting Nov 1, 2022
b347f05
Fix bug in generate-local-nix-packages.sh
smatting Jan 17, 2023
8c2a26d
partial-isomorphisms: remove pin
smatting Nov 2, 2022
6f88d55
type-errors: skip tests
smatting Nov 2, 2022
1c6d298
binary-parsers: jailbreak
smatting Nov 2, 2022
7650bc5
th-desugar: unpin
smatting Nov 2, 2022
ab02f24
imports: Remove hiding Option and option
smatting Nov 9, 2022
5557575
use generic-data_1_0_0_0
smatting Nov 10, 2022
cb77263
tinylog: use new fork
smatting Jan 17, 2023
3e68220
kind-generics(-th): bump to newer versions
smatting Jan 17, 2023
75645fc
kind-generics-th: jailbreak
smatting Jan 19, 2023
29ae9bb
singletons: remove pin
smatting Jan 19, 2023
a70bd03
wai-predicates: use new fork
smatting Jan 19, 2023
b5a6d30
hspec-wai: pin to commit 6984a0
smatting Jan 20, 2023
a7c82fc
hscim: fix compilation and tests after by hspec-wai upgrade
smatting Jan 20, 2023
0e12168
saml2-web-sso: pin to b79a45
smatting Jan 20, 2023
7c55aaf
extended: fix compilation
smatting Jan 20, 2023
170c7fd
types-common: refactor Data.Range w/ GHC.TypeNats
smatting Jan 20, 2023
bf7b95f
singletons: pin libarries to new release
smatting Jan 21, 2023
ae4c084
wire-api: fix compilation
smatting Jan 21, 2023
90e2944
wire-api-federation: fix compilation
smatting Jan 23, 2023
18448d6
polysemy-wire-zoo: fix compilation
smatting Jan 23, 2023
73fe69a
imports: dont export Data.List.singleton
smatting Jan 23, 2023
3532953
federator: fix compilation
smatting Jan 23, 2023
11318c7
galley: fix compilation
smatting Jan 23, 2023
7c7f789
bloodhound: bump to abf819
smatting Jan 23, 2023
0099c4b
brig: fix compilation
smatting Jan 23, 2023
ae40488
cargohold: fix compilation
smatting Jan 23, 2023
de11ae6
gundeck: fix compilation
smatting Jan 23, 2023
c8ed6f8
stern: fix compilation
smatting Jan 24, 2023
dba1027
assets: fix compilation
smatting Jan 24, 2023
b43e382
move wire forks repos from axeman to wireapp/forks
smatting Jan 24, 2023
7aa419f
Add docs with workflow hints when upgrading
smatting Jan 24, 2023
c4faef6
Apply suggestions from code review
smatting Jan 25, 2023
c6a75e0
Apply suggestions from code review
smatting Jan 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
with-compiler: ghc-8.10.7
with-compiler: ghc-9.2.4

packages:
libs/api-bot/
Expand Down
32 changes: 32 additions & 0 deletions docs/src/developer/developer/upgrading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Upgrading

Here are some workflow suggestions when you're trying to upgrade packages (or GHC) in wire-server.

- Use and install https://github.com/maralorn/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 feeling how much progress you've made.

- The `.envrc` environment probably won't load anymore. To fix this adjust the for packages that get passed to `shellFor` in `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 repl` and then `:l ./nix` to load the attrset in `./nix/default.nix`. For example to see which version of `aeson` will be used you can evaluate `wireServer.haskellPackages.aeson.version`. TAB-autocompletion also tells you if multiple versions of a package are included in the `nixpkgs` pin, e.g. `aeson_1_5_6_0`, `aeson_2_1_1_0`, which can be used in `manual-overrides.nix` to overwrite the default, e.g. `aeson`.

- Your goal is to make all packages compile again with nix. Start small by trying to build single packages, e.g. `wire-api` or 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 (`haskell-pins.nix`, or `manual-overrides.nix` if multiple versions of the package are included in the `nixpkgs` pin). 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 `doJailbreak` in `manual-overrides.nix`.

- If test-suites of a dependency don't compile, or cannot be run because they require IO interaction you can disable them: see `dontCheck` in `manual-overrides.nix`

- To force a rebuild of the nix shell delete the `.env` directory and run `direnv reload`

- 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 `libs/` then run `generate-local-nix-packages.sh` to 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 dump` to see the list of nix-provided ghc packages used by cabal.

- Consider using `ghcid --command "cabal repl <package>"` when fixing packages

- Delete the `dist-newstyle` directory everytime you upgrade the nix environment, without any exception. That is because cabal does not pick up changes to the `ghc-pkg` set (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 `shellFor` argument 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.nix` file (generated by `generate-local-nix-packages.sh`) to add the test suits dependencies to the library section.

- If cabal is complaining about a missing `libsodium`, add `sodium-crypt-sign` to the `shellFor` environment.
4 changes: 2 additions & 2 deletions hack/bin/generate-local-nix-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
ROOT_DIR=$(cd -- "$SCRIPT_DIR/../../" &> /dev/null && pwd)
cabalFiles=$(find "$ROOT_DIR" -name '*.cabal' \
cabalFiles=$(find -L "$ROOT_DIR" -name '*.cabal' \
| grep -v dist-newstyle | sort)

warningFile=$(mktemp)
Expand All @@ -21,7 +21,7 @@ echo "$cabalFiles" \

# shellcheck disable=SC2016
echo "$cabalFiles" \
| xargs -I {} bash -c 'cd $(dirname {}); cabal2nix . --no-hpack --extra-arguments gitignoreSource | sed "s/.\/./gitignoreSource .\/./g" >> default.nix; nixpkgs-fmt default.nix &> /dev/null'
| xargs -I {} bash -c 'cd $(dirname {}); cabal2nix . --no-hpack --extra-arguments gitignoreSource | sed "s/src = \.\/\./src = gitignoreSource .\/./g" >> default.nix; nixpkgs-fmt default.nix &> /dev/null'

overridesFile="$ROOT_DIR/nix/local-haskell-packages.nix"

Expand Down
5 changes: 3 additions & 2 deletions libs/extended/src/Servant/API/Extended.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module Servant.API.Extended where

import qualified Data.ByteString.Lazy as BL
import Data.EitherR (fmapL)
import Data.Kind
import Data.Metrics.Servant
import Data.String.Conversions (cs)
import Data.Typeable
Expand Down Expand Up @@ -54,12 +55,12 @@ import Prelude ()
-- that'll be).
--
-- See also: https://github.com/haskell-servant/servant/issues/353
data ReqBodyCustomError' (mods :: [*]) (list :: [ct]) (tag :: Symbol) (a :: *)
data ReqBodyCustomError' (mods :: [Type]) (list :: [ct]) (tag :: Symbol) (a :: Type)

type ReqBodyCustomError = ReqBodyCustomError' '[Required, Strict]

-- | Custom parse error for bad request bodies.
class MakeCustomError (tag :: Symbol) (a :: *) where
class MakeCustomError (tag :: Symbol) (a :: Type) where
makeCustomError :: String -> ServerError

-- | Variant of the 'ReqBody'' instance that takes a 'ServerError' as argument instead of a
Expand Down
2 changes: 1 addition & 1 deletion libs/hscim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ mkDerivation {
warp
];
testToolDepends = [ hspec-discover ];
homepage = "httpsgitignoreSource ./.github.cogitignoreSource ./.ireapgitignoreSource ./.ire-servegitignoreSource ./.ibgitignoreSource ./.scigitignoreSource ./.EADME.md";
homepage = "https://github.com/wireapp/wire-server/libs/hscim/README.md";
description = "hscim json schema and server implementation";
license = lib.licenses.agpl3Only;
mainProgram = "hscim-server";
Expand Down
228 changes: 114 additions & 114 deletions libs/hscim/hscim.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -83,44 +83,44 @@ library

ghc-options: -Wall -Werror
build-depends:
aeson >=2
, aeson-qq >=0.8.2 && <0.9
, attoparsec >=0.13.2 && <0.15
, base >=4.12 && <4.15
, bytestring >=0.10.8 && <0.11
, case-insensitive >=1.2.1.0 && <1.3
, email-validate >=2.3.2 && <2.4
, hashable >=1.2.7 && <1.5
, hedgehog >=1.0.1 && <1.1
, hspec >=2.7.1 && <2.9
, hspec-expectations >=0.8.2 && <0.9
, hspec-wai >=0.9.2 && <0.10
, http-api-data >=0.4.1 && <0.5
, http-media >=0.8.0 && <0.9
, http-types >=0.12.3 && <0.13
, hw-hspec-hedgehog >=0.1.0 && <0.2
, list-t >=1.0.4 && <1.1
, microlens >=0.4.10 && <0.5
, mmorph >=1.1.3 && <1.2
, mtl >=2.2.2 && <2.3
, network-uri >=2.6.2 && <2.7
, retry >=0.8.1.0 && <0.10
, scientific >=0.3.6 && <0.4
, servant >=0.16.2 && <0.20
, servant-client >=0.16.2 && <0.20
, servant-client-core >=0.16.2 && <0.20
, servant-server >=0.16.2 && <0.20
, stm >=2.5.0 && <2.6
, stm-containers >=1.1.0 && <1.3
, string-conversions >=0.4.0 && <0.5
, template-haskell >=2.14.0 && <2.17
, text >=1.2.3 && <1.3
, time >=1.8.0 && <1.10
, unordered-containers >=0.2.10 && <0.3
, uuid >=1.3.13 && <1.4
, wai >=3.2.2 && <3.3
, wai-extra >=3.0.28 && <3.2
, warp >=3.2.28 && <3.4
aeson
, aeson-qq
, attoparsec
, base
, bytestring
, case-insensitive
, email-validate
, hashable
, hedgehog
, hspec
, hspec-expectations
, hspec-wai
, http-api-data
, http-media
, http-types
, hw-hspec-hedgehog
, list-t
, microlens
, mmorph
, mtl
, network-uri
, retry
, scientific
, servant
, servant-client
, servant-client-core
, servant-server
, stm
, stm-containers
, string-conversions
, template-haskell
, text
, time
, unordered-containers
, uuid
, wai
, wai-extra
, warp

default-language: Haskell2010

Expand Down Expand Up @@ -148,45 +148,45 @@ executable hscim-server

ghc-options: -Wall -Werror -threaded -rtsopts -with-rtsopts=-N
build-depends:
aeson >=2
, aeson-qq >=0.8.2 && <0.9
, attoparsec >=0.13.2 && <0.15
, base >=4.12 && <4.15
, bytestring >=0.10.8 && <0.11
, case-insensitive >=1.2.1.0 && <1.3
, email-validate >=2.3.2 && <2.4
, hashable >=1.2.7 && <1.5
, hedgehog >=1.0.1 && <1.1
aeson
, aeson-qq
, attoparsec
, base
, bytestring
, case-insensitive
, email-validate
, hashable
, hedgehog
, hscim
, hspec >=2.7.1 && <2.9
, hspec-expectations >=0.8.2 && <0.9
, hspec-wai >=0.9.2 && <0.10
, http-api-data >=0.4.1 && <0.5
, http-media >=0.8.0 && <0.9
, http-types >=0.12.3 && <0.13
, hw-hspec-hedgehog >=0.1.0 && <0.2
, list-t >=1.0.4 && <1.1
, microlens >=0.4.10 && <0.5
, mmorph >=1.1.3 && <1.2
, mtl >=2.2.2 && <2.3
, network-uri >=2.6.2 && <2.7
, retry >=0.8.1.0 && <0.10
, scientific >=0.3.6 && <0.4
, servant >=0.16.2 && <0.20
, servant-client >=0.16.2 && <0.20
, servant-client-core >=0.16.2 && <0.20
, servant-server >=0.16.2 && <0.20
, stm >=2.5.0 && <2.6
, stm-containers >=1.1.0 && <1.3
, string-conversions >=0.4.0 && <0.5
, template-haskell >=2.14.0 && <2.17
, text >=1.2.3 && <1.3
, time >=1.8.0 && <1.10
, unordered-containers >=0.2.10 && <0.3
, uuid >=1.3.13 && <1.4
, wai >=3.2.2 && <3.3
, wai-extra >=3.0.28 && <3.2
, warp >=3.2.28 && <3.4
, hspec
, hspec-expectations
, hspec-wai
, http-api-data
, http-media
, http-types
, hw-hspec-hedgehog
, list-t
, microlens
, mmorph
, mtl
, network-uri
, retry
, scientific
, servant
, servant-client
, servant-client-core
, servant-server
, stm
, stm-containers
, string-conversions
, template-haskell
, text
, time
, unordered-containers
, uuid
, wai
, wai-extra
, warp

default-language: Haskell2010

Expand Down Expand Up @@ -232,45 +232,45 @@ test-suite spec
ghc-options: -Wall -Werror -threaded -rtsopts -with-rtsopts=-N
build-tool-depends: hspec-discover:hspec-discover
build-depends:
aeson >=2
, aeson-qq >=0.8.2 && <0.9
, attoparsec >=0.13.2 && <0.15
, base >=4.12 && <4.15
, bytestring >=0.10.8 && <0.11
, case-insensitive >=1.2.1.0 && <1.3
, email-validate >=2.3.2 && <2.4
, hashable >=1.2.7 && <1.5
, hedgehog >=1.0.1 && <1.1
aeson
, aeson-qq
, attoparsec
, base
, bytestring
, case-insensitive
, email-validate
, hashable
, hedgehog
, hscim
, hspec >=2.7.1 && <2.9
, hspec-expectations >=0.8.2 && <0.9
, hspec-wai >=0.9.2 && <0.10
, http-api-data >=0.4.1 && <0.5
, http-media >=0.8.0 && <0.9
, http-types >=0.12.3 && <0.13
, hw-hspec-hedgehog >=0.1.0 && <0.2
, hspec
, hspec-expectations
, hspec-wai
, http-api-data
, http-media
, http-types
, hw-hspec-hedgehog
, indexed-traversable
, list-t >=1.0.4 && <1.1
, microlens >=0.4.10 && <0.5
, mmorph >=1.1.3 && <1.2
, mtl >=2.2.2 && <2.3
, network-uri >=2.6.2 && <2.7
, retry >=0.8.1.0 && <0.10
, scientific >=0.3.6 && <0.4
, servant >=0.16.2 && <0.20
, servant-client >=0.16.2 && <0.20
, servant-client-core >=0.16.2 && <0.20
, servant-server >=0.16.2 && <0.20
, stm >=2.5.0 && <2.6
, stm-containers >=1.1.0 && <1.3
, string-conversions >=0.4.0 && <0.5
, template-haskell >=2.14.0 && <2.17
, text >=1.2.3 && <1.3
, time >=1.8.0 && <1.10
, unordered-containers >=0.2.10 && <0.3
, uuid >=1.3.13 && <1.4
, wai >=3.2.2 && <3.3
, wai-extra >=3.0.28 && <3.2
, warp >=3.2.28 && <3.4
, list-t
, microlens
, mmorph
, mtl
, network-uri
, retry
, scientific
, servant
, servant-client
, servant-client-core
, servant-server
, stm
, stm-containers
, string-conversions
, template-haskell
, text
, time
, unordered-containers
, uuid
, wai
, wai-extra
, warp

default-language: Haskell2010
Loading