Commit Graph

32 Commits

Author SHA1 Message Date
Simon Jakobi cd49b65c23 Move HsYAML-based code to new package dhall-yaml (#1514)
* Shared code for the dhall-to-yaml[-ng] executables stays in dhall-json.
* Shared tests are in dhall-yaml.

Fixes #1435.
2019-11-07 12:11:04 +00:00
Ehmry - 48ca2d2424 Optionally pass Nixpkgs through entry functions (#1409)
The "builtins.fetchTarball" function is not available in some restricted
environments such as build jobs of the latest Hydra. Make it possible to
pass nixpkgs and nixpkgsStaticLinux when evaulating default.nix and
release.nix to avoid importing them internally. This does not change the
result of evaulation if no parameters are passed.
2019-10-17 19:06:21 -07:00
Vijay Tadikamalla cced515494 Migrate to the HsYAML package (#1248) 2019-10-05 14:52:19 -07:00
Frederik Ramcke fd8683216d Fix tests without `with-http` flag (#1159)
* Allow customization of remote import resolution

Makes the `Status` type more general; previously support for
`Network.HTTP.Client` was hardcoded. In short:

```
data Status = Status
    { _stack :: NonEmpty Chained
    [...]
--  , _manager :: Maybe Dynamic
--  --   importing the same expression twice with different values
++  , _remote :: URL -> StateT Status IO Data.Text.Text
++  -- ^ The remote resolver, fetches the content at the given URL.

    [...]
    }

```

* Simplify and expose `toHeaders`

`toHeaders` will be needed for mock http testing

* Fix compilation without `with-http` flag

* Fix compilation with `with-http` flag

* Fix tests without `with-http` flag

Implements a mock http client that handles requests to:
- `https://raw.githubusercontent.com/dhall-lang/dhall-lang/master/`
- `https://test.dhall-lang.org/Bool/package.dhall`
- `https://httpbin.org/user-agent`

This allows tests involving remote imports to succeed even when compiled
without the `with-http` flag.

* Build `dhall` with HTTP support compiled out in CI

... to prevent regressions from occurring in the future
2019-07-27 02:59:25 +00:00
Gabriel Gonzalez 90b62ee9d7 Replace `dhall-to-text` with `dhall text` subcommand (#1090)
Fixes #1087
2019-07-08 17:18:09 +00:00
Gabriel Gonzalez 6748d15584
Fix `dhall-json` test failure (#997)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/996

This enables the test suite for `dhall-json` and also ensures that
all packages are built using the source distribution (to catch
missing `extra-files`)
2019-06-09 08:17:07 -07:00
Gabriel Gonzalez 89817b41fd
Build docker images for each package in CI (#950)
Fixes #513
2019-05-13 10:37:03 -07:00
Gabriel Gonzalez f4542d5bc5
Integrate `dhall-nix` into CI (#887) 2019-04-11 09:16:43 -07:00
Gabriel Gonzalez bffe2ed2a1
Remove support for URL fragments (#851)
... as standardized in https://github.com/dhall-lang/dhall-lang/pull/406
2019-03-14 07:23:23 -07:00
Gabriel Gonzalez 8663bfe296
Add `linux-dhall*` jobs to Hydra (#821)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/783

These can be used to conveniently install Dhall using `nix-env` on Linux systems
2019-02-22 07:32:59 -08:00
Gabriel Gonzalez 68c5278559
Support GHC 7.10.3 for all Dhall packages (#814)
This also updates the declared set of GHC versions tested with in the
`.cabal` files
2019-02-11 22:45:34 -08:00
Gabriel Gonzalez 2635c582eb
Add contributing instructions for the website (#760)
This is so that I can link people to the `README` if they are interested in
improving the site
2018-12-20 10:36:10 -08:00
Gabriel Gonzalez cf69f5a953
Add "Try Dhall" project (#739)
This adds three new Nix build products:

* `try-dhall-static` - The static assets for "Try Dhall"
* `try-dhall-server` - A script which serves the static assets for local
   debugging
* `tarball-try-dhall` - A tarball of the static assets

This is powered by a new small `dhall-try` package which is also included
in this change.
2018-12-06 18:00:03 -08:00
Gabriel Gonzalez 10a781534d
GHCJS support for Dhall (#734)
This adds a GHCJS build for Dhall so that:

* We can build a `try.dhall-lang.org` to try Dhall in the
  browser until the PureScript implementation comes online
* We can document how to build `dhall` using GHCJS
* We can verify that new changes to `dhall` or its dependencies
  don't break GHCJS support
* CI can build and cache GHCJS-related dependencies
2018-12-03 08:07:18 -08:00
Gabriel Gonzalez ef7c0681ca
Run tests in CI (#686)
CI was running tests, but they weren't blocking merge because they weren't a
dependency of the `dhall` attribute (which is what gates the GitHub status).

This fixes that by adding `coverage.dhall` as a dependency (which does include
tests).  The other builds were not running tests since that is what happens
`coverage` defaults to `false`.
2018-11-16 08:20:31 -08:00
Gabriel Gonzalez dc5493d87f
Test build against `ghc-8.6` (#669)
This ensures that all of the `dhall-*` libraries build against
GHC 8.6.1, but still generates tarballs using GHC 8.4.3 and
uses GHC 8.4.3 for development
2018-11-03 07:27:12 -07:00
Gabriel Gonzalez aecfbc9acc
Migrate `dhall-{bash,json,text}` into this repository (#661)
The motivation for this change is:

* To catch build failures in downstream packages whenever we make a breaking
  change to the `dhall` API
* To reduce the amount of work I need in order to cut a release for all of
  these packages
* To better share Nix/CI-related logic between the projects

Note that I have not yet migrated `dhall-nix` in.  I'm waiting for
https://github.com/dhall-lang/dhall-nix/issues/17 to be fixed since
`dhall-nix` is incompatible with later versions of `megaparsec` due to
`hnix`.
2018-10-28 17:32:51 -07:00
Gabriel Gonzalez 01d6cad27f
Update `README` and Nix logic (#650)
Fixes https://github.com/dhall-lang/dhall-haskell/issues/645

Fixes https://github.com/dhall-lang/dhall-lang/issues/216

This updates the `README` with the following changes:

* Points to the language-agnostic `README` in the `dhall-lang` repository
* Retains only Haskell-specific sections of interest
* Removes the embedded LICENSE now that GitHub auto-recognizes the project
  license (#644)
* Changes the Quick Start instructions to use Nix
* Adds instructions for project development using Nix

The latter two points entailed refactors to the Nix logic to simplify the
user experience:

* `default.nix` was moved to `shared.nix` and replaced with a new `default.nix`
  that works out-of-the-box with `nix-build`
* There is a new `nix/test-dhall.nix` which users can use to create a
  `nix-shell` with Dhall as a dependency
2018-10-20 09:27:16 -07:00
Gabriel Gonzalez f3a372c99a
Build against GHC 7.10.3 (#621)
... as requested by @jneira so that Dhall will continue to work as a
dependency of Eta, which is built using GHC 7.10.3

This adds CI support for testing the build against GHC 7.10.3 and also
fixes issues building against that GHC version that were caught in the process
2018-10-05 20:51:18 -07:00
Gabriel Gonzalez e4145ce192
Add coverage testing (#569) 2018-09-09 16:25:10 -07:00
Gabriel Gonzalez 1adafa0502
Build a completely static Dhall executable in CI (#517)
This adds a new `dhall-static` target that builds a fully static `dhall`
executable that can be run on any Linux machine (i.e. it is a relocatable
executable that is completely dependency free).  That in turns implies
that even though it is built with Nix it doesn't require that the user
installs Nix to run it (i.e. no dependency on the `/nix/store` or a
Nix installer).  Just copy the standalone executable to any Linux  machine
and it's good to go.

This based on the following work of @nh2:

* https://github.com/NixOS/nixpkgs/issues/43795
* https://github.com/dhall-lang/dhall-lang/issues/192#issuecomment-406134451

This also bumps the version of `nixpkgs` used for the normal (non-static)
Dhall build to be the closest revision on `nixpkgs` `master` as the one
used by @nh2 in his work.  Once that work is merged into `nixpkgs` `master`
then both builds can use the same revision from `nixpkgs` `master`.
2018-07-21 22:11:57 -07:00
Fintan Halpenny 6f626c96bc
Add Benchmarking (#415)
* Benchmark Prelude files

* Add issue 108 example

* Some cleaning up

* Remove printing of files

* Add bounds

* Clean cabal formatting

* Add benchmark examples to extra source files

* Add Nix support for benchmarks

* This doesn't (yet) run or build the benchmarks in CI due to the long time
to execute all of them, but this does add them to the `shell.nix` so that
they can be run using local development
2018-06-01 11:39:30 -06:00
Gabriel Gonzalez 544b863cbc
Add a `pwd` derivation force status updates by Hydra (#393)
Hydra doesn't update a pull request if the derivation hasn't changed
since the last revision (i.e. a cache hit).  This change adds a `pwd`
derivation which depends trivially on the current directory to force a
cache miss and status update
2018-05-17 08:01:00 -07:00
Gabriel Gonzalez c635f1f77b
Pin `nixpkgs` (#372)
This pins `nixpkgs` to a recent revision from the `release-18.03`
2018-04-30 08:40:29 -07:00
Oliver Charles 922e20e6ab Replace trifecta with megaparsec (#268)
The long-term motivation for this change is so that we can eventually use a
separate `attoparsec`-based lexing step to greatly increase parsing speed since
the `trifecta`/`parsers` API doesn't allow tokens other than `Char`.

The secondary motivation for this is that `megaparsec` is a smaller dependency
that is more actively maintained.
2018-03-27 09:09:20 -07:00
Joe Kachmar c87e5d9980 Switches from text-format to formatting (#330) 2018-03-18 22:05:30 -07:00
Gabriel Gonzalez be7a5771ea
Use the latest `prettyprinter` library (#287)
This fixes the root cause of e24b3d90fa so
that we no longer need the workaround of using `Pretty.Text.renderIO`
2018-02-19 11:05:11 -08:00
Gabriel Gonzalez 8e1acafac4
Enforce `-Werror` in CI (#286)
This adds the `-Werror` flag to CI so that warnings don't sneak into the
build (and also fixes the current set of warnings)
2018-02-19 10:31:21 -08:00
Gabriel Gonzalez adf370370b
Generate statically linked executables (#282)
Eventually we will want to encourage users to download pre-built executables
from Hydra, but this requires statically linking them so that they have
a smaller footprint.  Otherwise users will have to download an entire
GHC installation.
2018-02-18 16:39:59 -08:00
Gabriel Gonzalez be10607f96
Update `release.nix` (#180)
Fixes #179

This updates the instructions and fixes the spurious reference to
`prettyprinter.nix` that I accidentally checked in
2017-11-15 09:31:27 -08:00
Gabriel Gonzalez ebc884226d Version 1.6.0 → 1.7.0 (#160) 2017-10-10 20:25:19 +03:00
Gabriel Gonzalez 56365164ca Add Nix derivations for building Dhall 2016-12-19 20:27:15 -08:00