Skip to content

Commit

Permalink
chore: Update to new third_party method for haskell deps.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Nov 7, 2023
1 parent 86b1d6b commit 6744bb1
Show file tree
Hide file tree
Showing 46 changed files with 60 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ bazel-opt_task:
- /src/workspace/tools/inject-repo hs-toxcore
test_all_script:
- cd /src/workspace && bazel test -k
--remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST
--config=ci
//hs-toxcore/...

android-aarch64_task:
Expand Down
59 changes: 29 additions & 30 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
load("@ai_formation_hazel//tools:mangling.bzl", "hazel_library")
load("@rules_haskell//haskell:defs.bzl", "haskell_library")
load("//third_party/haskell/hspec-discover:build_defs.bzl", "hspec_test")
load("//tools/project:build_defs.bzl", "project")
Expand All @@ -16,24 +15,24 @@ haskell_library(
visibility = ["//visibility:public"],
deps = [
"//hs-msgpack-binary",
hazel_library("MonadRandom"),
hazel_library("QuickCheck"),
hazel_library("base"),
hazel_library("base16-bytestring"),
hazel_library("binary"),
hazel_library("bytestring"),
hazel_library("clock"),
hazel_library("containers"),
hazel_library("entropy"),
hazel_library("integer-gmp"),
hazel_library("iproute"),
hazel_library("lens-family"),
hazel_library("monad-validate"),
hazel_library("mtl"),
hazel_library("network"),
hazel_library("random"),
hazel_library("saltine"),
hazel_library("transformers"),
"//third_party/haskell:MonadRandom",
"//third_party/haskell:QuickCheck",
"//third_party/haskell:base",
"//third_party/haskell:base16-bytestring",
"//third_party/haskell:binary",
"//third_party/haskell:bytestring",
"//third_party/haskell:clock",
"//third_party/haskell:containers",
"//third_party/haskell:entropy",
"//third_party/haskell:integer-gmp",
"//third_party/haskell:iproute",
"//third_party/haskell:lens-family",
"//third_party/haskell:monad-validate",
"//third_party/haskell:mtl",
"//third_party/haskell:network",
"//third_party/haskell:random",
"//third_party/haskell:saltine",
"//third_party/haskell:transformers",
],
)

Expand All @@ -47,16 +46,16 @@ hspec_test(
":hs-toxcore",
"//hs-msgpack-binary",
"//hs-msgpack-types",
hazel_library("QuickCheck"),
hazel_library("async"),
hazel_library("base"),
hazel_library("binary"),
hazel_library("bytestring"),
hazel_library("containers"),
hazel_library("hspec"),
hazel_library("monad-validate"),
hazel_library("mtl"),
hazel_library("saltine"),
hazel_library("text"),
"//third_party/haskell:QuickCheck",
"//third_party/haskell:async",
"//third_party/haskell:base",
"//third_party/haskell:binary",
"//third_party/haskell:bytestring",
"//third_party/haskell:containers",
"//third_party/haskell:hspec",
"//third_party/haskell:monad-validate",
"//third_party/haskell:mtl",
"//third_party/haskell:saltine",
"//third_party/haskell:text",
],
)
1 change: 0 additions & 1 deletion src/Network/Tox.lhs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
\chapter{Introduction}

\begin{code}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox where
\end{code}
Expand Down
5 changes: 3 additions & 2 deletions src/Network/Tox/Binary.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{-# LANGUAGE Safe #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.Binary
Expand All @@ -9,13 +9,14 @@ module Network.Tox.Binary

import Data.Binary (Binary)
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Data.Typeable (Typeable)
import qualified Data.Typeable as Typeable

import qualified Network.Tox.Encoding as Encoding


typeName :: Typeable a => proxy a -> String
typeName :: Typeable (a :: Type) => proxy a -> String
typeName (_ :: proxy a) =
show . Typeable.typeOf $ (undefined :: a)

Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/Crypto.lhs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
\chapter{Crypto}

\begin{code}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.Crypto where
\end{code}
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/Crypto/Box.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
module Network.Tox.Crypto.Box
( PlainText (..)
, CipherText
Expand Down
3 changes: 1 addition & 2 deletions src/Network/Tox/Crypto/CombinedKey.lhs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
\subsection{Combined Key}

\begin{code}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.Crypto.CombinedKey where
import qualified Crypto.Saltine.Core.Box as Sodium (beforeNM)
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/Crypto/Key.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
module Network.Tox.Crypto.Key where
import Control.Monad ((>=>))
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/Crypto/KeyPair.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ standard group element and the Secret Key. See the
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
module Network.Tox.Crypto.KeyPair where
import qualified Crypto.Saltine.Class as Sodium (decode, encode)
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/Crypto/Keyed.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{-# OPTIONS_GHC -Wno-noncanonical-monad-instances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE UndecidableInstances #-}

Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/Crypto/KeyedT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE UndecidableInstances #-}
module Network.Tox.Crypto.KeyedT where
Expand Down
3 changes: 1 addition & 2 deletions src/Network/Tox/Crypto/Nonce.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ together.

\begin{code}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.Crypto.Nonce where
import qualified Crypto.Saltine.Class as Sodium (decode, encode, nudge)
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT.lhs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
\chapter{DHT}

\begin{code}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT where
\end{code}
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/ClientList.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

\begin{code}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.ClientList where
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/ClientNode.lhs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
\begin{code}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.ClientNode where
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/DhtPacket.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ protocol never actually sends empty messages, so in reality the minimum size is
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.DhtPacket where
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/DhtRequestPacket.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ DHT Packet which is to be received by the addressee.
\begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.DhtRequestPacket where
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/DhtState.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.DhtState where
Expand Down
5 changes: 2 additions & 3 deletions src/Network/Tox/DHT/Distance.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

\begin{code}
{-# OPTIONS_GHC -Wno-noncanonical-monad-instances #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.Distance where
import Control.Arrow (first)
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/KBuckets.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ lifetime of a k-buckets instance.
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
module Network.Tox.DHT.KBuckets where
import Data.Binary (Binary)
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/NodeList.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ The Close List and the Search Entries are termed the \texttt{Node Lists} of
the DHT State.

\begin{code}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.NodeList where
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/NodesRequest.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ The DHT Public Key sent in the request is the one the sender is searching for.
\begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.NodesRequest where
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/NodesResponse.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ response has in their lists of known nodes.
\begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.NodesResponse where
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/Operation.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.Operation where
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/PendingReplies.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ which was sent sufficiently recently, according to a time limit which depends on
the service.

\begin{code}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.PendingReplies where
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/PingPacket.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ The Ping Service is used to check if a node is responsive.
\begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.PingPacket where
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/RpcPacket.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
module Network.Tox.DHT.RpcPacket where
import Data.Binary (Binary)
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/DHT/Stamped.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.DHT.Stamped where

Expand Down
5 changes: 2 additions & 3 deletions src/Network/Tox/Encoding.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.Encoding where

import Data.Binary (Binary, get, put)
Expand Down
3 changes: 1 addition & 2 deletions src/Network/Tox/Network/MonadRandomBytes.hs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}

module Network.Tox.Network.MonadRandomBytes where

import Control.Monad.RWS (RWST)
import Control.Monad.Random (RandT, getRandoms)
import Control.Monad.Reader (ReaderT)
import Control.Monad.RWS (RWST)
import Control.Monad.State (StateT)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Writer (WriterT)
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/Network/Networked.hs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}

-- | Abstraction layer for network functionality.
--
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/NodeInfo.lhs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
\chapter{Node Info}

\begin{code}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.NodeInfo where
\end{code}
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/NodeInfo/HostAddress.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ packed byte is the protocol and the next 7 bits are the address family.
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
module Network.Tox.NodeInfo.HostAddress where
import Control.Arrow ((&&&))
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/NodeInfo/NodeInfo.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ The reason for these numbers is that the numbers on Linux for IPv4 and IPv6
\begin{code}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.NodeInfo.NodeInfo where
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/NodeInfo/PortNumber.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ bit unsigned integer (2 bytes).
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
module Network.Tox.NodeInfo.PortNumber where
import Data.Binary (Binary)
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/NodeInfo/SocketAddress.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ any internet host.
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
module Network.Tox.NodeInfo.SocketAddress where
import Data.Binary (Binary, get, put)
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/NodeInfo/TransportProtocol.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ The human-readable representation for UDP is \texttt{UDP} and for TCP is
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE Trustworthy #-}
module Network.Tox.NodeInfo.TransportProtocol where
import Data.Binary (Binary)
Expand Down
1 change: 0 additions & 1 deletion src/Network/Tox/Protocol.lhs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
\chapter{Protocol Packet}

\begin{code}
{-# LANGUAGE Safe #-}
{-# LANGUAGE StrictData #-}
module Network.Tox.Protocol where
\end{code}
Expand Down
Loading

0 comments on commit 6744bb1

Please sign in to comment.