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

Integrate dhall-nix into CI #887

Merged
merged 24 commits into from
Apr 11, 2019
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3f69e8f
Integrate `dhall-nix` into CI
Gabriella439 Apr 10, 2019
5d41b80
Fix build of `dhall-nix-static`
Gabriella439 Apr 11, 2019
33fae12
Disable test suite for `dhall-lsp-server` when built via Nix
Gabriella439 Apr 11, 2019
59cd196
Fix package versions
Gabriella439 Apr 11, 2019
7bccddd
Use latest revision of `cryptohash-sha256`
Gabriella439 Apr 11, 2019
5e85f41
Remove `dhall-nix` build for GHC 7.10.3
Gabriella439 Apr 11, 2019
3935e1b
Add back newer revision of `cryptohash-sha256`
Gabriella439 Apr 11, 2019
70462b0
Use newer revision of `cryptohash-sha512`
Gabriella439 Apr 11, 2019
641a56c
Upgrade `lens-family` to build against GHC 8.6
Gabriella439 Apr 11, 2019
17b63d4
Disable `dhall-lsp-server` builds for GHC-7.10/GHC-8.6
Gabriella439 Apr 11, 2019
8d99aa2
Fix `vector` build on GHC 7.10.3
Gabriella439 Apr 11, 2019
d54994e
Upgrade `ref-tf` to build against newer `stm` version
Gabriella439 Apr 11, 2019
27c0d39
Upgrade `th-lift` to support GHC 8.6
Gabriella439 Apr 11, 2019
e0b1e18
Fix `optparse-applicative` override to build on GHC 7.10
Gabriella439 Apr 11, 2019
71d701b
Fix parser-combinators override to build on GHC 7.10
Gabriella439 Apr 11, 2019
2c336d0
Fix `th-expand-syns` to build on GHC 8.6
Gabriella439 Apr 11, 2019
57eafc2
Upgrade `haskell-src-meta` to build against GHC 8.6
Gabriella439 Apr 11, 2019
6e82329
Use newer version of `unix` package for Linux builds
Gabriella439 Apr 11, 2019
3a4f677
Remove `dhall-nix` build for GHC 8.6
Gabriella439 Apr 11, 2019
a1173af
Update README
Gabriella439 Apr 11, 2019
e96edcd
Restore fix for `optparse-applicative` on GHC 7.10
Gabriella439 Apr 11, 2019
c224487
Restore fix for `parser-combinators`
Gabriella439 Apr 11, 2019
959e5a5
Restore `vector`
Gabriella439 Apr 11, 2019
a02d53c
Restore `vector` file
Gabriella439 Apr 11, 2019
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: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ the following packages:
* [`dhall`](./dhall) - [![Hackage](https://img.shields.io/hackage/v/dhall.svg)](https://hackage.haskell.org/package/dhall)
* [`dhall-bash`](./dhall-bash) - [![Hackage](https://img.shields.io/hackage/v/dhall-bash.svg)](https://hackage.haskell.org/package/dhall-bash)
* [`dhall-json`](./dhall-json) - [![Hackage](https://img.shields.io/hackage/v/dhall-json.svg)](https://hackage.haskell.org/package/dhall-json)
* [`dhall-nix`](./dhall-nix) - [![Hackage](https://img.shields.io/hackage/v/dhall-nix.svg)](https://hackage.haskell.org/package/dhall-nix)
* [`dhall-text`](./dhall-text) - [![Hackage](https://img.shields.io/hackage/v/dhall-text.svg)](https://hackage.haskell.org/package/dhall-text)

Navigate to each package's directory for their respective `README`s
@@ -38,6 +39,7 @@ visit one of the following links:
* [https://hydra.dhall-lang.org/job/dhall-haskell/master/linux-dhall/latest](https://hydra.dhall-lang.org/job/dhall-haskell/master/linux-dhall/latest)
* [https://hydra.dhall-lang.org/job/dhall-haskell/master/linux-dhall-bash/latest](https://hydra.dhall-lang.org/job/dhall-haskell/master/linux-dhall-bash/latest)
* [https://hydra.dhall-lang.org/job/dhall-haskell/master/linux-dhall-json/latest](https://hydra.dhall-lang.org/job/dhall-haskell/master/linux-dhall-json/latest)
* [https://hydra.dhall-lang.org/job/dhall-haskell/master/linux-dhall-nix/latest](https://hydra.dhall-lang.org/job/dhall-haskell/master/linux-dhall-nix/latest)
* [https://hydra.dhall-lang.org/job/dhall-haskell/master/linux-dhall-lsp-server/latest](https://hydra.dhall-lang.org/job/dhall-haskell/master/linux-dhall-lsp-server/latest)
* [https://hydra.dhall-lang.org/job/dhall-haskell/master/linux-dhall-text/latest](https://hydra.dhall-lang.org/job/dhall-haskell/master/linux-dhall-text/latest)

1 change: 1 addition & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ in
dhall-bash
dhall-json
dhall-lsp-server
dhall-nix
dhall-text
;

60 changes: 16 additions & 44 deletions dhall-nix/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# `dhall-nix 1.1.6`
# `dhall-nix`

For installation or development instructions, see:

* [`dhall-haskell` - `README`](https://github.com/dhall-lang/dhall-haskell/blob/master/README.md)

Full documentation here:

* [`dhall-nix` instructions](https://hackage.haskell.org/package/dhall-nix/docs/Dhall-Nix.html)

## Introduction

This `dhall-nix` package provides a Dhall to Nix compiler. You can use this
compiler to program Nix using the Dhall language. This package targets people
@@ -9,12 +19,11 @@ who wish Nix had a type system.
If you have Nix installed then you can build and run this package using:

```bash
$ nix-build -A dhall-nix release.nix
$ result/bin/dhall-to-nix <<< "λ(x : Bool) → x == False"
$ dhall-to-nix <<< "λ(x : Bool) → x == False"
x: x == false
$ result/bin/dhall-to-nix <<< "{ foo = 1, bar = True }"
$ dhall-to-nix <<< "{ foo = 1, bar = True }"
{ bar = true; foo = 1; }
$ result/bin/dhall-to-nix <<< "< Left = 2 | Right : Natural >"
$ dhall-to-nix <<< "< Left = 2 | Right : Natural >"
{ Left, Right }: Left 2
```
@@ -40,42 +49,5 @@ dhallToNix = code :
import "${drv}";
```
The above `dhallToNix` utility is now in `nixpkgs` so you can use `pkgs.dhallToNix`
to transform Dhall expressions to Nix expressions
## Development status
[![Build Status](https://travis-ci.org/Gabriel439/Haskell-Dhall-Nix-Library.png)](https://travis-ci.org/Gabriel439/Haskell-Dhall-Nix-Library)
I don't expect this library to change unless:
* ... the Dhall language changes, which is possible but not very likely
* ... there are bugs, but the test suite in [release.nix](./release.nix) should
protect against this
## License (BSD 3-clause)
Copyright (c) 2017 Gabriel Gonzalez
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Gabriel Gonzalez nor the names of other contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The above `dhallToNix` utility is now in `nixpkgs` so you can use
`pkgs.dhallToNix` to transform Dhall expressions to Nix expressions
1 change: 1 addition & 0 deletions dhall-nix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(import ../nix/shared.nix {}).possibly-static.dhall-nix
14 changes: 0 additions & 14 deletions dhall-nix/nix/base-orphans.nix

This file was deleted.

15 changes: 0 additions & 15 deletions dhall-nix/nix/cborg-json.nix

This file was deleted.

10 changes: 0 additions & 10 deletions dhall-nix/nix/contravariant.nix

This file was deleted.

18 changes: 0 additions & 18 deletions dhall-nix/nix/dhall-nix.nix

This file was deleted.

41 changes: 0 additions & 41 deletions dhall-nix/nix/dhall.nix

This file was deleted.

49 changes: 0 additions & 49 deletions dhall-nix/nix/fetchNixpkgs.nix

This file was deleted.

25 changes: 0 additions & 25 deletions dhall-nix/nix/megaparsec.nix

This file was deleted.

15 changes: 0 additions & 15 deletions dhall-nix/nix/neat-interpolation.nix

This file was deleted.

11 changes: 0 additions & 11 deletions dhall-nix/nix/repline.nix

This file was deleted.

20 changes: 0 additions & 20 deletions dhall-nix/nix/semigroupoids.nix

This file was deleted.

2 changes: 1 addition & 1 deletion dhall-nix/shell.nix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(import ./release.nix).shell
(import ../nix/shared.nix {}).shell-dhall-nix
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions nix/hspec-core.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{ mkDerivation, ansi-terminal, array, base, call-stack, clock
, deepseq, directory, filepath, hspec-expectations, hspec-meta
, HUnit, process, QuickCheck, quickcheck-io, random, setenv
, silently, stdenv, stm, temporary, tf-random, transformers
}:
mkDerivation {
pname = "hspec-core";
version = "2.5.6";
sha256 = "6f188cf2322d0bafca7a9a11feb80a66631bdf6911d236ed16e4f4a22c1e455e";
libraryHaskellDepends = [
ansi-terminal array base call-stack clock deepseq directory
filepath hspec-expectations HUnit QuickCheck quickcheck-io random
setenv stm tf-random transformers
];
testHaskellDepends = [
ansi-terminal array base call-stack clock deepseq directory
filepath hspec-expectations hspec-meta HUnit process QuickCheck
quickcheck-io random setenv silently stm temporary tf-random
transformers
];
testToolDepends = [ hspec-meta ];
testTarget = "--test-option=--skip --test-option='Test.Hspec.Core.Runner.hspecResult runs specs in parallel'";
homepage = "http://hspec.github.io/";
description = "A Testing Framework for Haskell";
license = stdenv.lib.licenses.mit;
}
19 changes: 19 additions & 0 deletions nix/hspec-discover.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ mkDerivation, base, directory, filepath, hspec-meta, QuickCheck
, stdenv
}:
mkDerivation {
pname = "hspec-discover";
version = "2.5.6";
sha256 = "8c9689b51aa44b8278a5ff3059e0e8a609dce077df3781aad977c647a8c18a46";
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [ base directory filepath ];
executableHaskellDepends = [ base directory filepath ];
testHaskellDepends = [
base directory filepath hspec-meta QuickCheck
];
testToolDepends = [ hspec-meta ];
homepage = "http://hspec.github.io/";
description = "Automatically discover and run Hspec tests";
license = stdenv.lib.licenses.mit;
}
14 changes: 14 additions & 0 deletions nix/hspec.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{ mkDerivation, base, hspec-core, hspec-discover
, hspec-expectations, QuickCheck, stdenv
}:
mkDerivation {
pname = "hspec";
version = "2.5.6";
sha256 = "9ea6eb6ac6b49e1593e272707b760e125d3bdca2d8845d76e116c1ea8112da59";
libraryHaskellDepends = [
base hspec-core hspec-discover hspec-expectations QuickCheck
];
homepage = "http://hspec.github.io/";
description = "A Testing Framework for Haskell";
license = stdenv.lib.licenses.mit;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions nix/relude.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ mkDerivation, base, bytestring, containers, deepseq, doctest
, gauge, ghc-prim, Glob, hashable, hedgehog, mtl, QuickCheck
, stdenv, stm, tasty, tasty-hedgehog, text, transformers
, unordered-containers
}:
mkDerivation {
pname = "relude";
version = "0.5.0";
sha256 = "75411b958121c813f4a0a2297542d4df85f141f52c1c081803fb48b73c691d81";
libraryHaskellDepends = [
base bytestring containers deepseq ghc-prim hashable mtl stm text
transformers unordered-containers
];
testHaskellDepends = [
base bytestring doctest Glob hedgehog QuickCheck tasty
tasty-hedgehog text
];
benchmarkHaskellDepends = [
base containers gauge unordered-containers
];
homepage = "https://github.com/kowainik/relude";
description = "Custom prelude from Kowainik";
license = stdenv.lib.licenses.mit;
}
File renamed without changes.
61 changes: 45 additions & 16 deletions nix/shared.nix
Original file line number Diff line number Diff line change
@@ -136,7 +136,10 @@ let
mass pkgsNew.haskell.lib.doCheck
( [ "dhall-bash"
"dhall-json"
"dhall-lsp-server"
# The test suite fails due to a relative reference
# to ../dhall/dhall-lang/
# "dhall-lsp-server"
"dhall-nix"
"dhall-text"
]
# Test suite doesn't work on GHCJS or GHC 7.10.3
@@ -185,6 +188,12 @@ let
../dhall-lsp-server
{ };

dhall-nix =
haskellPackagesNew.callCabal2nix
"dhall-nix"
../dhall-nix
{ };

dhall-text =
haskellPackagesNew.callCabal2nix
"dhall-text"
@@ -351,6 +360,16 @@ let
pkgsNew.haskell.lib.doJailbreak
haskellPackagesOld.neat-interpolation;

optparse-applicative =
pkgsNew.haskell.lib.addBuildDepend
haskellPackagesOld.optparse-applicative
haskellPackagesNew.fail;

parser-combinators =
pkgsNew.haskell.lib.addBuildDepend
haskellPackagesOld.parser-combinators
haskellPackagesNew.semigroups;

prettyprinter =
pkgsNew.haskell.lib.addBuildDepend
haskellPackagesOld.prettyprinter
@@ -361,6 +380,11 @@ let
haskellPackagesOld.transformers-compat
haskellPackagesNew.generic-deriving;

vector =
pkgsNew.haskell.lib.addBuildDepend
haskellPackagesOld.vector
haskellPackagesNew.semigroups;

# For some reason, `Cabal-1.22.5` does not respect the
# `buildable: False` directive for the executable section
# even when configured with `-f -cli`. Fixing this requires
@@ -473,6 +497,9 @@ let
dhall-lsp-server-static =
pkgsNew.haskell.lib.statify haskellPackagesOld.dhall-lsp-server;

dhall-nix-static =
pkgsNew.haskell.lib.statify haskellPackagesOld.dhall-nix;

dhall-text-static =
pkgsNew.haskell.lib.statify haskellPackagesOld.dhall-text;
};
@@ -531,32 +558,34 @@ in
inherit trivial;

possibly-static = {
dhall = makeStaticIfPossible "dhall" ;
dhall-bash = makeStaticIfPossible "dhall-bash";
dhall-json = makeStaticIfPossible "dhall-json";
dhall = makeStaticIfPossible "dhall" ;
dhall-bash = makeStaticIfPossible "dhall-bash" ;
dhall-json = makeStaticIfPossible "dhall-json" ;
dhall-lsp-server = makeStaticIfPossible "dhall-lsp-server";
dhall-text = makeStaticIfPossible "dhall-text";
dhall-nix = makeStaticIfPossible "dhall-nix" ;
dhall-text = makeStaticIfPossible "dhall-text" ;
};

tarball-dhall = makeTarball "dhall" ;
tarball-dhall-bash = makeTarball "dhall-bash";
tarball-dhall-json = makeTarball "dhall-json";
tarball-dhall = makeTarball "dhall" ;
tarball-dhall-bash = makeTarball "dhall-bash" ;
tarball-dhall-json = makeTarball "dhall-json" ;
tarball-dhall-lsp-server = makeTarball "dhall-lsp-server";
tarball-dhall-text = makeTarball "dhall-text";
tarball-dhall-nix = makeTarball "dhall-nix" ;
tarball-dhall-text = makeTarball "dhall-text" ;

inherit (pkgs) tarball-website website;

inherit (pkgs.haskell.packages."${compiler}") dhall dhall-bash dhall-json dhall-lsp-server dhall-text dhall-try;
inherit (pkgs.haskell.packages."${compiler}") dhall dhall-bash dhall-json dhall-lsp-server dhall-nix dhall-text dhall-try;

inherit (pkgs.releaseTools) aggregate;

shell-dhall = toShell pkgs.haskell.packages."${compiler}".dhall ;
shell-dhall-bash = toShell pkgs.haskell.packages."${compiler}".dhall-bash;
shell-dhall-json = toShell pkgs.haskell.packages."${compiler}".dhall-json;
shell-dhall = toShell pkgs.haskell.packages."${compiler}".dhall ;
shell-dhall-bash = toShell pkgs.haskell.packages."${compiler}".dhall-bash ;
shell-dhall-json = toShell pkgs.haskell.packages."${compiler}".dhall-json ;
shell-dhall-lsp-server = toShell pkgs.haskell.packages."${compiler}".dhall-lsp-server;

shell-dhall-text = toShell pkgs.haskell.packages."${compiler}".dhall-text;
shell-dhall-try = toShell pkgs.haskell.packages."${compiler}".dhall-try ;
shell-dhall-nix = toShell pkgs.haskell.packages."${compiler}".dhall-nix ;
shell-dhall-text = toShell pkgs.haskell.packages."${compiler}".dhall-text ;
shell-dhall-try = toShell pkgs.haskell.packages."${compiler}".dhall-try ;

test-dhall =
pkgs.mkShell
17 changes: 17 additions & 0 deletions nix/tasty-hspec.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{ mkDerivation, base, hspec, hspec-core, QuickCheck, stdenv, tasty
, tasty-quickcheck, tasty-smallcheck
}:
mkDerivation {
pname = "tasty-hspec";
version = "1.1.5";
sha256 = "db0cdcf71d534cfa32a1698f1eb6be03192af09a5dd63177b697bc4ca8b81154";
revision = "3";
editedCabalFile = "14198y7w9y4h36b6agzmsyappkhz4gmmi6nlzj137z5siwic7igm";
libraryHaskellDepends = [
base hspec hspec-core QuickCheck tasty tasty-quickcheck
tasty-smallcheck
];
homepage = "https://github.com/mitchellwrosen/tasty-hspec";
description = "Hspec support for the Tasty test framework";
license = stdenv.lib.licenses.bsd3;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 18 additions & 4 deletions release.nix
Original file line number Diff line number Diff line change
@@ -29,13 +29,21 @@ in
shared_7_10_3.dhall
shared_7_10_3.dhall-bash
shared_7_10_3.dhall-json
# `base-noprelude` depends on a specific version of `base`
# shared_7_10_3.dhall-lsp-server
# `hnix` depends on `lens-family-th`, which doesn't support GHC 7.10.3
# shared_7_10_3.dhall-nix
shared_7_10_3.dhall-text

# Verify that the packages build against the latest supported version
# of the compiler
shared_8_6_1.dhall
shared_8_6_1.dhall-bash
shared_8_6_1.dhall-json
# `base-noprelude` depends on a specific version of `base`
# shared_8_6_1.dhall-lsp-server
# `hnix` depends on `unix-2.7.*` and doesn't work with GHC 8.6
# shared_8_6_1.dhall-nix
shared_8_6_1.dhall-text

# However, we still use GHC 8.4.3 to build the distributed tarballs
@@ -45,6 +53,8 @@ in
shared.tarball-dhall
shared.tarball-dhall-bash
shared.tarball-dhall-json
shared.tarball-dhall-lsp-server
shared.tarball-dhall-nix
shared.tarball-dhall-text

shared_ghcjs.tarball-website
@@ -64,11 +74,15 @@ in
tarball-dhall
tarball-dhall-bash
tarball-dhall-json
tarball-dhall-lsp-server
tarball-dhall-nix
tarball-dhall-text
;

linux-dhall = shared_linux.possibly-static.dhall;
linux-dhall-bash = shared_linux.possibly-static.dhall-bash;
linux-dhall-json = shared_linux.possibly-static.dhall-json;
linux-dhall-text = shared_linux.possibly-static.dhall-text;
linux-dhall = shared_linux.possibly-static.dhall;
linux-dhall-bash = shared_linux.possibly-static.dhall-bash;
linux-dhall-json = shared_linux.possibly-static.dhall-json;
linux-dhall-lsp-server = shared_linux.possibly-static.dhall-lsp-server;
linux-dhall-nix = shared_linux.possibly-static.dhall-nix;
linux-dhall-text = shared_linux.possibly-static.dhall-text;
}