Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Nixpkgs to the latest nixpkgs-unstable #2573

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ in
# We can re-enable these once https://github.com/NixOS/nixpkgs/issues/133271
# is fixed and Nixpkgs is upgraded to a version that incorporates GHCJS

# inherit (shared_ghcjs) dhall-try;
# dhall-ghcjs = shared_ghcjs.dhall;
inherit (shared_ghcjs) dhall-try;
dhall-ghcjs = shared_ghcjs.dhall;
}
6 changes: 4 additions & 2 deletions dhall-csv/dhall-csv.cabal
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Cabal-Version: 2.4
Name: dhall-csv
Version: 1.0.4
Cabal-Version: >=1.10
Build-Type: Simple
License: BSD3
License: BSD-3-Clause
License-File: LICENSE
Copyright: 2021 Marcos Lerones
Author: Marcos Lerones
Expand All @@ -25,6 +25,8 @@ Category: Compiler
Extra-Source-Files:
CHANGELOG.md
README.md
tasty/data/**/*.dhall
tasty/data/**/*.csv
Source-Repository head
Type: git
Location: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-csv
Expand Down
6 changes: 3 additions & 3 deletions dhall-lsp-server/dhall-lsp-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ library
, dhall >= 1.38.0 && < 1.43
, dhall-json >= 1.4 && < 1.8
, filepath >= 1.4.2 && < 1.5
, lsp >= 2.1.0.0 && < 2.2
, lsp >= 2.1.0.0 && < 2.4
, lens >= 4.16.1 && < 5.3
-- megaparsec follows SemVer: https://github.com/mrkkrp/megaparsec/issues/469#issuecomment-927918469
, megaparsec >= 7.0.2 && < 10
Expand Down Expand Up @@ -104,9 +104,9 @@ Test-Suite tests
GHC-Options: -Wall
Build-Depends:
base ,
lsp-types >= 2.0.1 && < 2.1 ,
lsp-types >= 2.0.1 && < 2.2 ,
hspec >= 2.7 && < 2.11 ,
lsp-test >= 0.15.0.0 && < 0.16 ,
lsp-test >= 0.15.0.0 && < 0.17 ,
tasty >= 0.11.2 && < 1.5 ,
tasty-hspec >= 1.1 && < 1.3 ,
text >= 0.11 && < 2.1
Expand Down
1 change: 0 additions & 1 deletion dhall-lsp-server/src/Dhall/LSP/Handlers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,10 @@
respond (Right _default)

handler (severity_, _message) = do
let _type_ = case severity_ of

Check warning on line 656 in dhall-lsp-server/src/Dhall/LSP/Handlers.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest - stack.ghc-8.10.yaml

Pattern match(es) are non-exhaustive
Error -> MessageType_Error
Warning -> MessageType_Warning
Info -> MessageType_Info
Log -> MessageType_Log

liftLSP $ LSP.sendNotification SMethod_WindowShowMessage ShowMessageParams{..}
respond (Right _default)
7 changes: 5 additions & 2 deletions dhall-lsp-server/src/Dhall/LSP/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,15 @@

let defaultConfig = def

let onConfigurationChange _oldConfig json =
let configSection = "dhall-lsp-server"

Check warning on line 55 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / macOS-latest - stack.yaml

Defined but not used: ‘configSection’

Check warning on line 55 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / macOS-latest - stack.yaml

• Defaulting the following constraint to type ‘String’

Check warning on line 55 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest - stack.yaml

Defined but not used: ‘configSection’

Check warning on line 55 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest - stack.yaml

• Defaulting the following constraint to type ‘String’

Check warning on line 55 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / windows-latest - stack.yaml

Defined but not used: `configSection'

Check warning on line 55 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / windows-latest - stack.yaml

* Defaulting the following constraint to type `String'

Check warning on line 55 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest - stack.ghc-8.10.yaml

Defined but not used: ‘configSection’

Check warning on line 55 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest - stack.ghc-8.10.yaml

• Defaulting the following constraint to type ‘[Char]’

let parseConfig _oldConfig json =

Check warning on line 57 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / macOS-latest - stack.yaml

Defined but not used: ‘parseConfig’

Check warning on line 57 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest - stack.yaml

Defined but not used: ‘parseConfig’

Check warning on line 57 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / windows-latest - stack.yaml

Defined but not used: `parseConfig'

Check warning on line 57 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest - stack.ghc-8.10.yaml

Defined but not used: ‘parseConfig’
case fromJSON json of
Aeson.Success config -> Right config
Aeson.Error string -> Left (Text.pack string)

let onConfigChange _ = pure ()

Check warning on line 62 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / macOS-latest - stack.yaml

Defined but not used: ‘onConfigChange’

Check warning on line 62 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest - stack.yaml

Defined but not used: ‘onConfigChange’

Check warning on line 62 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / windows-latest - stack.yaml

Defined but not used: `onConfigChange'

Check warning on line 62 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest - stack.ghc-8.10.yaml

Defined but not used: ‘onConfigChange’

let doInitialize environment _request = do
return (Right environment)

Expand Down Expand Up @@ -110,11 +114,10 @@
liftIO (fail (Text.unpack _message))

Left (severity_, _message) -> do
let _type_ = case severity_ of

Check warning on line 117 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest - stack.ghc-8.10.yaml

Pattern match(es) are non-exhaustive
Error -> MessageType_Error
Warning -> MessageType_Warning
Info -> MessageType_Info
Log -> MessageType_Log

LSP.sendNotification SMethod_WindowShowMessage ShowMessageParams{..}
liftIO (fail (Text.unpack _message))
Expand All @@ -125,7 +128,7 @@

backward = liftIO

exitCode <- LSP.runServerWithHandles ioLogger lspLogger stdin stdout ServerDefinition{..}

Check warning on line 131 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / macOS-latest - stack.yaml

• Fields of ‘ServerDefinition’ not initialised:

Check warning on line 131 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest - stack.yaml

• Fields of ‘ServerDefinition’ not initialised:

Check warning on line 131 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / windows-latest - stack.yaml

* Fields of `ServerDefinition' not initialised:

Check warning on line 131 in dhall-lsp-server/src/Dhall/LSP/Server.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest - stack.ghc-8.10.yaml

• Fields of ‘ServerDefinition’ not initialised: onConfigurationChange

case exitCode of
0 -> return ()
Expand Down
8 changes: 6 additions & 2 deletions dhall-lsp-server/tests/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ codeCompletionSpec fixtureDir =
docId <- openDoc "ImportedFunctions.dhall" "dhall"
cs <- getCompletions docId (Position {_line = 0, _character = 33})
liftIO $ do
let [ firstItem, secondItem ] = cs
(firstItem, secondItem) <- case cs of
[x, y] -> pure (x, y)
_ -> fail "Unexpected number of items"
_label firstItem `shouldBe` "`make user`"
_label secondItem `shouldBe` "makeUser"
_detail firstItem `shouldBe` Just "\8704(user : Text) \8594 { home : Text }"
Expand All @@ -152,7 +154,9 @@ codeCompletionSpec fixtureDir =
docId <- openDoc "Union.dhall" "dhall"
cs <- getCompletions docId (Position {_line = 2, _character = 10})
liftIO $ do
let [ firstItem, secondItem ] = cs
(firstItem, secondItem) <- case cs of
[x, y] -> pure (x, y)
_ -> fail "Unexpected number of items"
_label firstItem `shouldBe` "A"
_label secondItem `shouldBe` "`B C`"
_detail firstItem `shouldBe` Just "\8704(A : Text) \8594 < A : Text | `B C` >"
Expand Down
33 changes: 12 additions & 21 deletions dhall-nixpkgs/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ githubToNixpkgs GitHub{ name, uri, rev = maybeRev, hash, fetchSubmodules, direct
ExitFailure _ -> die (FailedToFetchGitHubArchive args)

case Text.lines text of
[ sha256, path ] -> return (r, sha256, Turtle.fromText path)
[ sha256, path ] -> return (r, sha256, Text.unpack path)
_ -> die (FailedToParseNixPrefetchURL args)

_ -> do
Expand All @@ -706,7 +706,7 @@ githubToNixpkgs GitHub{ name, uri, rev = maybeRev, hash, fetchSubmodules, direct
Right n -> do
return n

return (rev, sha256, Turtle.fromText path)
return (rev, sha256, Text.unpack path)

let finalName =
case name of
Expand All @@ -723,15 +723,11 @@ githubToNixpkgs GitHub{ name, uri, rev = maybeRev, hash, fetchSubmodules, direct
then return ()
else die (MissingFile expressionFile)

expressionText <- Turtle.readTextFile expressionFile
expressionText <- Text.IO.readFile expressionFile

let expressionFileString = Turtle.encodeString expressionFile
expression <- Dhall.Core.throws (Dhall.Parser.exprFromText expressionFile expressionText)

expression <- Dhall.Core.throws (Dhall.Parser.exprFromText expressionFileString expressionText)

let status = Dhall.Import.emptyStatus baseDirectoryString
where
baseDirectoryString = Turtle.encodeString baseDirectory
let status = Dhall.Import.emptyStatus baseDirectory

dependencies <- Turtle.reduce Foldl.nub (State.evalStateT (findExternalDependencies expression) status)

Expand Down Expand Up @@ -781,16 +777,13 @@ directoryToNixpkgs Directory{ name, directory, file, source, document, fixedOutp
else do
die (MissingFile expressionFile)

expressionText <- Turtle.readTextFile expressionFile
expressionText <- Text.IO.readFile expressionFile

let expressionFileString = Turtle.encodeString expressionFile
expression <- Dhall.Core.throws (Dhall.Parser.exprFromText expressionFile expressionText)

expression <- Dhall.Core.throws (Dhall.Parser.exprFromText expressionFileString expressionText)

let status = Dhall.Import.emptyStatus directoryString
let status = Dhall.Import.emptyStatus dir
where
directoryString =
Turtle.encodeString (Turtle.directory expressionFile)
dir = Turtle.directory expressionFile

dependencies <- Turtle.reduce Foldl.nub (State.evalStateT (findExternalDependencies expression) status)

Expand All @@ -804,11 +797,9 @@ directoryToNixpkgs Directory{ name, directory, file, source, document, fixedOutp

let buildDhallDirectoryPackage = "buildDhallDirectoryPackage"

let src | null directoryString = directoryString
| last directoryString == '/' = init directoryString
| otherwise = directoryString
where
directoryString = Turtle.encodeString directory
let src | null directory = directory
| last directory == '/' = init directory
| otherwise = directory

let functionParams =
makeNixFunctionParams buildDhallDirectoryPackage nixDependencies
Expand Down
2 changes: 1 addition & 1 deletion dhall-nixpkgs/dhall-nixpkgs.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Executable dhall-to-nixpkgs
, prettyprinter >= 1.7.0 && < 1.8
, text >= 0.11.1.0 && < 2.1
, transformers >= 0.2.0.0 && < 0.6
, turtle < 1.6
, turtle >= 1.6 && < 1.7
, network-uri < 2.8
Default-Language: Haskell2010
GHC-Options: -Wall -threaded
21 changes: 15 additions & 6 deletions dhall/ghcjs-src/Dhall/Import/HTTP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@ import Control.Monad.IO.Class (MonadIO (..))
import Control.Monad.Trans.State.Strict (StateT)
import Data.ByteString (ByteString)
import Data.CaseInsensitive (CI)
import Dhall.Core (URL (..), Expr (..))
import Dhall.Import.Types (Import, Status)
import Dhall.Import.Types (Status)
import Dhall.Parser (Src)
import Dhall.URL (renderURL)

import Dhall.Core
( Import(..)
, ImportHashed(..)
, ImportMode(..)
, ImportType(..)
, URL (..)
, Expr (..)
)

import qualified Data.Text as Text
import qualified Data.Text.Encoding as Text.Encoding
import qualified JavaScript.XHR
Expand All @@ -40,13 +48,14 @@ fetchFromHttpUrl childURL Nothing = do
fetchFromHttpUrl _ _ =
fail "Dhall does not yet support custom headers when built using GHCJS"

fetchFromHTTPUrlBytes
fetchFromHttpUrlBytes
:: URL
-> Maybe [(CI ByteString, ByteString)]
-> StateT Status IO ByteString
fetchFromHTTPUrlBytes childUrl mheader = do
text <- fetchFromHTTPUrl childUrl mheader
fetchFromHttpUrlBytes childUrl mheader = do
text <- fetchFromHttpUrl childUrl mheader
return (Text.Encoding.encodeUtf8 text)

originHeadersFileExpr :: IO (Expr Src Import)
originHeadersFileExpr = return Missing
originHeadersFileExpr =
return (Embed (Import (ImportHashed Nothing Missing) Code))
2 changes: 2 additions & 0 deletions dhall/src/Dhall/Syntax/Chunks.hs-boot
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE NoPolyKinds #-}

module Dhall.Syntax.Chunks where

data Chunks s a
2 changes: 2 additions & 0 deletions dhall/src/Dhall/Syntax/Types.hs-boot
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{-# LANGUAGE NoPolyKinds #-}

module Dhall.Syntax.Types where

data DhallDouble
Expand Down
11 changes: 0 additions & 11 deletions nix/packages/co-log-core.nix

This file was deleted.

19 changes: 0 additions & 19 deletions nix/packages/hashable.nix

This file was deleted.

52 changes: 0 additions & 52 deletions nix/packages/hnix.nix

This file was deleted.

31 changes: 0 additions & 31 deletions nix/packages/lsp-types.nix

This file was deleted.

28 changes: 0 additions & 28 deletions nix/packages/lsp.nix

This file was deleted.

Loading
Loading