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

Bump ghcide to wz1000 hls-2 branch #184

Merged
merged 3 commits into from
Jul 5, 2020
Merged

Conversation

alanz
Copy link
Collaborator

@alanz alanz commented Jul 1, 2020

At 747ec1401c62257ec849319eb2dda966a8008b09

Also bump cabal-project index-state to 2020-07-01T16:33:28Z

stack 8.10.1 to nightly-2020-06-29
stack 8.8.3 to lts-16.3

At 747ec1401c62257ec849319eb2dda966a8008b09

Also bump cabal-project index-state to 2020-07-01T16:33:28Z

stack 8.10.1 to nightly-2020-06-29
stack 8.8.3  to lts-16.3
stack-8.10.1.yaml Outdated Show resolved Hide resolved
@alanz
Copy link
Collaborator Author

alanz commented Jul 1, 2020

I am finding that go to definition for a record field does not work.

e.g. in GHC Expr.hs

  | RecStmt
     { recS_ext :: XRecStmt idL idR body
     , recS_stmts :: [LStmtLR idL idR body]

        -- The next two fields are only valid after renaming

and in Utils.hs

mkRecStmt anns stmts  = (emptyRecStmt' anns) { recS_stmts = stmts }

Putting the cursor on recS_stmts in Utils.hs only says it is defined in GHC.Hs.Expr, but does not go to definition location.

For me this is a blocker.

PS, I have deleted ~/.cache/ghcide first.

@alanz alanz merged commit d0623b2 into haskell:master Jul 5, 2020
@korayal
Copy link
Contributor

korayal commented Jul 6, 2020

After this is merged into the master, I got this error while trying to build hls on nix ( ghc-8.6.5 ):
experiment

Linking dist/build/ghcide/ghcide ...
Preprocessing executable 'ghcide-bench' for ghcide-0.2.0..
Building executable 'ghcide-bench' for ghcide-0.2.0..
[1 of 2] Compiling Experiments      ( bench/lib/Experiments.hs, dist/build/ghcide-bench/ghcide-bench-tmp/Experiments.o )

bench/lib/Experiments.hs:325:21: error:
    • Couldn't match type ‘IO’ with ‘Session’
      Expected type: Session (Seconds, ())
        Actual type: IO (Seconds, ())
    • In a stmt of a 'do' block:
        (startup, _) <- duration
                          $ do waitForProgressDone
                               changeDoc doc [hygienicEdit]
                               waitForProgressDone
      In the second argument of ‘($)’, namely
        ‘do doc <- openDoc exampleModulePath "haskell"
            (startup, _) <- duration
                              $ do waitForProgressDone
                                   changeDoc doc [...]
                                   ....
            liftIO $ output $ "Running " <> name <> " benchmark"
            (runSetup, userState) <- duration $ benchSetup doc
            ....’
      In the second argument of ‘($)’, namely
        ‘runSess dir
           $ do doc <- openDoc exampleModulePath "haskell"
                (startup, _) <- duration
                                  $ do waitForProgressDone
                                       changeDoc doc [...]
                                       ....
                liftIO $ output $ "Running " <> name <> " benchmark"
                (runSetup, userState) <- duration $ benchSetup doc
                ....’
    |
325 |     (startup, _) <- duration $ do
    |                     ^^^^^^^^^^^^^...

bench/lib/Experiments.hs:326:7: error:
    • Couldn't match type ‘Session’ with ‘IO’
      Expected type: IO ()
        Actual type: Session ()
    • In a stmt of a 'do' block: waitForProgressDone
      In the second argument of ‘($)’, namely
        ‘do waitForProgressDone
            changeDoc doc [hygienicEdit]
            waitForProgressDone’
      In a stmt of a 'do' block:
        (startup, _) <- duration
                          $ do waitForProgressDone
                               changeDoc doc [hygienicEdit]
                               waitForProgressDone
    |
326 |       waitForProgressDone
    |       ^^^^^^^^^^^^^^^^^^^

bench/lib/Experiments.hs:329:7: error:
    • Couldn't match type ‘Session’ with ‘IO’
      Expected type: IO ()
        Actual type: Session ()
    • In a stmt of a 'do' block: changeDoc doc [hygienicEdit]
      In the second argument of ‘($)’, namely
        ‘do waitForProgressDone
            changeDoc doc [hygienicEdit]
            waitForProgressDone’
      In a stmt of a 'do' block:
        (startup, _) <- duration
                          $ do waitForProgressDone
                               changeDoc doc [hygienicEdit]
                               waitForProgressDone
    |
329 |       changeDoc doc [hygienicEdit]
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

bench/lib/Experiments.hs:330:7: error:
    • Couldn't match type ‘Session’ with ‘IO’
      Expected type: IO ()
        Actual type: Session ()
    • In a stmt of a 'do' block: waitForProgressDone
      In the second argument of ‘($)’, namely
        ‘do waitForProgressDone
            changeDoc doc [hygienicEdit]
            waitForProgressDone’
      In a stmt of a 'do' block:
        (startup, _) <- duration
                          $ do waitForProgressDone
                               changeDoc doc [hygienicEdit]
                               waitForProgressDone
    |
330 |       waitForProgressDone
    |       ^^^^^^^^^^^^^^^^^^^

bench/lib/Experiments.hs:334:30: error:
    • Couldn't match type ‘IO’ with ‘Session’
      Expected type: Session (Seconds, setup)
        Actual type: IO (Seconds, setup)
    • In a stmt of a 'do' block:
        (runSetup, userState) <- duration $ benchSetup doc
      In the second argument of ‘($)’, namely
        ‘do doc <- openDoc exampleModulePath "haskell"
            (startup, _) <- duration
                              $ do waitForProgressDone
                                   changeDoc doc [...]
                                   ....
            liftIO $ output $ "Running " <> name <> " benchmark"
            (runSetup, userState) <- duration $ benchSetup doc
            ....’
      In the second argument of ‘($)’, namely
        ‘runSess dir
           $ do doc <- openDoc exampleModulePath "haskell"
                (startup, _) <- duration
                                  $ do waitForProgressDone
                                       changeDoc doc [...]
                                       ....
                liftIO $ output $ "Running " <> name <> " benchmark"
                (runSetup, userState) <- duration $ benchSetup doc
                ....’
    |
334 |     (runSetup, userState) <- duration $ benchSetup doc
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^

bench/lib/Experiments.hs:334:41: error:
    • Couldn't match expected type ‘IO setup’
                  with actual type ‘Session setup’
    • In the second argument of ‘($)’, namely ‘benchSetup doc’
      In a stmt of a 'do' block:
        (runSetup, userState) <- duration $ benchSetup doc
      In the second argument of ‘($)’, namely
        ‘do doc <- openDoc exampleModulePath "haskell"
            (startup, _) <- duration
                              $ do waitForProgressDone
                                   changeDoc doc [...]
                                   ....
            liftIO $ output $ "Running " <> name <> " benchmark"
            (runSetup, userState) <- duration $ benchSetup doc
            ....’
    • Relevant bindings include
        experiment :: setup -> Experiment
          (bound at bench/lib/Experiments.hs:321:18)
        benchSetup :: TextDocumentIdentifier -> Session setup
          (bound at bench/lib/Experiments.hs:321:18)
    |
334 |     (runSetup, userState) <- duration $ benchSetup doc
    |                                         ^^^^^^^^^^^^^^

bench/lib/Experiments.hs:337:34: error:
    • Couldn't match expected type ‘IO Bool’
                  with actual type ‘Session Bool’
    • In the second argument of ‘($)’, namely
        ‘experiment userState doc’
      In a stmt of a 'do' block:
        (t, res) <- duration $ experiment userState doc
      In the expression:
        do (t, res) <- duration $ experiment userState doc
           if not res then
               return False
           else
               do output (showDuration t)
                  ....
    |
337 |           (t, res) <- duration $ experiment userState doc
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^

bench/lib/Experiments.hs:344:33: error:
    • Couldn't match type ‘IO’ with ‘Session’
      Expected type: Session (Seconds, Bool)
        Actual type: IO (Seconds, Bool)
    • In a stmt of a 'do' block:
        (runExperiment, success) <- duration $ loop samples
      In the second argument of ‘($)’, namely
        ‘do doc <- openDoc exampleModulePath "haskell"
            (startup, _) <- duration
                              $ do waitForProgressDone
                                   changeDoc doc [...]
                                   ....
            liftIO $ output $ "Running " <> name <> " benchmark"
            (runSetup, userState) <- duration $ benchSetup doc
            ....’
      In the second argument of ‘($)’, namely
        ‘runSess dir
           $ do doc <- openDoc exampleModulePath "haskell"
                (startup, _) <- duration
                                  $ do waitForProgressDone
                                       changeDoc doc [...]
                                       ....
                liftIO $ output $ "Running " <> name <> " benchmark"
                (runSetup, userState) <- duration $ benchSetup doc
                ....’
    |
344 |     (runExperiment, success) <- duration $ loop samples
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^

builder for '/nix/store/sqp6asmsnq4rsqad68ry2vm1slhf4mqm-ghcide-0.2.0.drv' failed with exit code 1
cannot build derivation '/nix/store/1vi8x4y5zaccnqj4877byvbndlyr158d-haskell-language-server-0.1.0.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/1vi8x4y5zaccnqj4877byvbndlyr158d-haskell-language-server-0.1.0.0.drv' failed

@lukel97
Copy link
Collaborator

lukel97 commented Jul 6, 2020

@korayal did you try git submodule update?

@korayal
Copy link
Contributor

korayal commented Jul 6, 2020

@bubba I'm manually updating the revision for submodules. So it looks like I was using the correct revision:

https://github.com/korayal/hls-nix/blob/092570a9f9d1f9ad9c590c96d0005ac50bf90a0f/default.nix#L45

Was this caused by a submodule of ghcide?

@korayal
Copy link
Contributor

korayal commented Jul 7, 2020

Found the cause. I must have bumped one dependency higher than what ghcide requires. one of these should be the reason for the error above:

  • haddock-library (I had 1.9.0, ghcide wants 1.8.0)
  • extra (I had 1.7.3, ghcide wants 1.7.2)
  • shake (I had 1.19.1, ghcide wants 1.18.5)

@ndmitchell
Copy link
Collaborator

extra-1.7.2 moved duration to MonadIO instead of IO. It really looks like you are using extra-1.7.1 or lower. Can you make triple sure your extra is new enough?

@korayal
Copy link
Contributor

korayal commented Jul 7, 2020

@ndmitchell I've tested it again with 1.7.3 and it did work. I must have somehow bumped the version and forgot to change (it seems, in that commit I did the same for opentelemetry too) the SHA256 hash in the nix expression (so even though the version says it's 1.7.3, I was using the already compiled version of 1.7.1), because it doesn't match to what I'm looking at right now. sorry about bothering you both about this.

pepeiborra pushed a commit that referenced this pull request Dec 27, 2020
...using its default configuration layers
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.

6 participants