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

Different with-http CPP check; fix remote imports in GHCJS #1330

Merged
merged 2 commits into from
Sep 20, 2019
Merged

Different with-http CPP check; fix remote imports in GHCJS #1330

merged 2 commits into from
Sep 20, 2019

Conversation

patrickmn
Copy link
Sponsor Collaborator

I submitted #1311 before studying Import.hs carefully enough, and my GHCJS build worked perfectly (with local imports, doh!) so I didn't notice.

Since I removed the GHCJS dependency on http-client, the CPP check for MIN_VERSION_http_client no longer works. I noticed the existence of -DWITH_HTTP in the tasty test suite and added that at the library level. (I think it's clearer too.)

Also, fortunately, Manager is not actually needed in Import.hs, just the check for WITH_HTTP.

@patrickmn
Copy link
Sponsor Collaborator Author

Doctest again. Revisiting tomorrow.

Copy link
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty reasonable to me. I think CI with GHCJS would still be a good idea though – I could try adding a Travis job for this…

Regarding the doctests failure: AppVeyor reports:

when making flags consistent: warning:
    -O conflicts with --interactive; -O ignored.
C:\projects\dhall-haskell\dhall\src/Dhall/Tutorial.hs:447: failure in expression `input auto "https://raw.githubusercontent.com/dhall-lang/dhall-haskell/18e4e9a18dc53271146df3ccf5b4177c3552236b/examples/True" :: IO Bool'
expected: "True"
 but got: "*** Exception: "
          "\8627 https://raw.githubusercontent.com/dhall-lang/dhall-haskell/18e4e9a18dc53271146df3ccf5b4177c3552236b/examples/True"
          ""
          "\ESC[1;31mError\ESC[0m: Cannot import HTTP URL."
          ""
          "Dhall was compiled without the 'with-http' flag."
          ""
          "The requested URL was: https://raw.githubusercontent.com/dhall-lang/dhall-haskell/18e4e9a18dc53271146df3ccf5b4177c3552236b/examples/True"
          ""
          ""
          "1\9474 https://raw.githubusercontent.com/dhall-lang/dhall-haskell/18e4e9a18dc53271146df3ccf5b4177c3552236b/examples/True"
          ""
          "(input):1:1"

I suspect this can be fixed by passing -DWITH_HTTP when calling doctest in dhall/doctests/Main.hs.

@patrickmn
Copy link
Sponsor Collaborator Author

Btw stuck on this trying to enter nix shell to run doctest locally:

...
5pfkp8gqca-source/pkgs/development/haskell-modules/make-package-set.nix:75:37, called from /nix/store/xz3aw1hswykigk6ivipisj5pfkp8gqca-source/pkgs/development/haskell-modules/make-package-set.nix:115:28:
while evaluating 'makeOverridable' at /nix/store/xz3aw1hswykigk6ivipisj5pfkp8gqca-source/lib/customisation.nix:72:24, called from /nix/store/xz3aw1hswykigk6ivipisj5pfkp8gqca-source/pkgs/development/haskell-modules/make-package-set.nix:98:8:
while evaluating 'drvScope' at /nix/store/xz3aw1hswykigk6ivipisj5pfkp8gqca-source/pkgs/development/haskell-modules/make-package-set.nix:88:18, called from /nix/store/xz3aw1hswykigk6ivipisj5pfkp8gqca-source/lib/customisation.nix:74:12:
moving build output '/nix/store/x8sk4h2ylq3k0xmawqh8v8bar2ljx8mg-cabal-dedupe-src' from the sandbox to the Nix store: Permission denied

@patrickmn
Copy link
Sponsor Collaborator Author

Looks like that worked. Thank you :)

@patrickmn patrickmn merged commit fa84b0d into dhall-lang:master Sep 20, 2019
@patrickmn patrickmn deleted the ghcjs-fetchremote branch September 20, 2019 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants