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

Dhall error doing local-setup --force #29

Closed
jjl opened this issue Dec 5, 2018 · 16 comments
Closed

Dhall error doing local-setup --force #29

jjl opened this issue Dec 5, 2018 · 16 comments

Comments

@jjl
Copy link

jjl commented Dec 5, 2018

We discussed on twitter this might be related to old dhall, but I just installed it straight from git and that didn't fix it.

$ spacchetti local-setup --force
spacchetti: 
Error: Invalid input

(stdin):114:1:
    |
114 | let upstream =
    | ^^
unexpected "le"
expecting "!=", "&&", "++", "->", "//", "//\\", "/\", "==", "as", "in", "||", "→", "∧", "⩓", "⫽", '#', '*', '+', ':', '?', or whitespace
@jjl
Copy link
Author

jjl commented Dec 5, 2018

$ dhall version
1.19.1

@justinwoo
Copy link
Contributor

According to spacchetti/spacchetti#49 you are still using an old version of Dhall by using Dhall-JSON from an outdated source.

@jjl
Copy link
Author

jjl commented Dec 5, 2018

Installing 'dhall' actually installed dhall-to-json as it's been moved into the dhall-haskell repository.

@justinwoo
Copy link
Contributor

If you can verify that it is, then I don't know what causes this to fail as I can't reproduce this.

@jjl
Copy link
Author

jjl commented Dec 5, 2018

$ which dhall
/Users/james/.local/bin/dhall
$ which dhall-to-json
/Users/james/.local/bin/dhall-to-json

Yup, same one.

@jjl
Copy link
Author

jjl commented Dec 5, 2018

I removed the homebrew version just in case and as expected, no change.

@f-f
Copy link
Member

f-f commented Dec 5, 2018

@jjl what happens when you do dhall-to-json --version?

If this is the result, you're on the latest:

$ dhall-to-json --version
1.2.5

Note that these dhall-related problems will be fixed anyways in the upcoming release as we won't depend anymore on the installed dhall binaries.

@jjl
Copy link
Author

jjl commented Dec 5, 2018

It reports 1.2.5

@f-f
Copy link
Member

f-f commented Dec 5, 2018

Right, then it's not a problem related to the Dhall versions :)

Could you post the content of your packages.dhall?

@jjl
Copy link
Author

jjl commented Dec 5, 2018

It's the one generated by spacchetti:

{-
Welcome to Spacchetti local packages!

Below are instructions for how to edit this file for most use
cases, so that you don't need to know Dhall to use it.

## Warning: Don't Move This Top-Level Comment!

Due to how `dhall format` currently works, this comment's
instructions cannot appear near corresponding sections below
because `dhall format` will delete the comment. However,
it will not delete a top-level comment like this one.

## Use Cases

Most will want to do one or both of these options:
1. Override/Patch a package's dependency
2. Add a package not already in the default package set

This file will continue to work whether you use one or both options.
Instructions for each option are explained below.

### Overriding/Patching a package

Purpose:
- Change a package's dependency to a newer/older release than the
    default package set's release
- Use your own modified version of some dependency that may
    include new API, changed API, removed API by
    using your custom git repo of the library rather than
    the package set's repo

Syntax:
Replace the overrides' "{=}" (an empty record) with the following idea
The "//" or "⫽" means "merge these two records and
  when they have the same value, use the one on the right:"
-------------------------------
let override =
  { packageName =
      upstream.packageName ⫽ { updateEntity1 = "new value", updateEntity2 = "new value" }
  , packageName =
      upstream.packageName ⫽ { version = "v4.0.0" }
  , packageName =
      upstream.packageName // { repo = "https://www.example.com/path/to/new/repo.git" }
  }
-------------------------------

Example:
-------------------------------
let overrides =
  { halogen =
      upstream.halogen ⫽ { version = "master" }
  , halogen-vdom =
      upstream.halogen-vdom ⫽ { version = "v4.0.0" }
  }
-------------------------------

### Additions

Purpose:
- Add packages that aren't alread included in the default package set

Syntax:
Replace the additions' "{=}" (an empty record) with the following idea:
-------------------------------
let additions =
  { "package-name" =
       mkPackage
         [ "dependency1"
         , "dependency2"
         ]
         "https://example.com/path/to/git/repo.git"
         "tag ('v4.0.0') or branch ('master')"
  , "package-name" =
       mkPackage
         [ "dependency1"
         , "dependency2"
         ]
         "https://example.com/path/to/git/repo.git"
         "tag ('v4.0.0') or branch ('master')"
  , etc.
  }
-------------------------------

Example:
-------------------------------
let additions =
  { benchotron =
      mkPackage
        [ "arrays"
        , "exists"
        , "profunctor"
        , "strings"
        , "quickcheck"
        , "lcg"
        , "transformers"
        , "foldable-traversable"
        , "exceptions"
        , "node-fs"
        , "node-buffer"
        , "node-readline"
        , "datetime"
        , "now"
        ]
        "https://github.com/hdgarrood/purescript-benchotron.git"
        "v7.0.0"
  }
-------------------------------
-}

let mkPackage =
      https://raw.githubusercontent.com/justinwoo/spacchetti/24112018/src/mkPackage.dhall sha256:8e1c6636f8a089f972b21cde0cef4b33fa36a2e503ad4c77928aabf92d2d4ec9

let upstream =
      https://raw.githubusercontent.com/justinwoo/spacchetti/24112018/src/packages.dhall sha256:81454036f1779dbce007a69889ef10f3ecdb7bc8beb97d8d75931c8d87075ad1

let overrides = {=}

let additions = {=}

in  upstream ⫽ overrides ⫽ additions

@f-f
Copy link
Member

f-f commented Dec 5, 2018

Right, did you install spacchetti-cli from source or from a release?

@jjl
Copy link
Author

jjl commented Dec 5, 2018

I checked out git and ran stack install

@f-f
Copy link
Member

f-f commented Dec 5, 2018

Cool, then you're not depending on installed binaries anymore. Unfortunately our dhall dependencies are outdated so the new syntax introduced in 4e9c20e doesn't work.
I'm pushing a commit with the fix

@f-f
Copy link
Member

f-f commented Dec 5, 2018

@jjl could you try latest master?

@jjl
Copy link
Author

jjl commented Dec 5, 2018

Works :)

Thanks folks!

@f-f
Copy link
Member

f-f commented Dec 5, 2018

You're welcome! 🙂

elliotdavies pushed a commit to elliotdavies/spago that referenced this issue Jul 1, 2019
f-f pushed a commit that referenced this issue Sep 27, 2023
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

No branches or pull requests

3 participants