Skip to content

ghcide hangs during typechecking on a single-core machine or setting -j1 #727

@expipiplus1

Description

@expipiplus1

Copied from #573 as this happens with just the ghcide command.

I am bumping into this on NixOS with HLS 0.6.0 8.8.4, or ghcide 0.5.0 8.8.4

--verbose doesn't say much interesting aside from [DEBUG] Set files of interest to: [(NormalizedFilePath "/home/alice/Foo.hs". OnDisk)] after Type checking the files`

Here is a reproducer in the form of a nixos test:

import <nixpkgs/nixos/tests/make-test-python.nix> ({ pkgs, ... }: {
  name = "test";
  machine = { ... }: {
    imports = [ <nixpkgs/nixos/tests/common/user-account.nix> ];
    environment.systemPackages =
      [ pkgs.vim pkgs.ghc pkgs.haskellPackages.ghcide ];
  };
  testScript = ''
    # Login
    machine.wait_for_unit("multi-user.target")

    # Create a hie.yaml file and Foo.hs (this happens with and without the yaml file)
    machine.succeed('echo "cradle:\n  direct:\n    arguments: []" > hie.yaml')
    machine.succeed('echo "module Foo where\nfoo = ()" > Foo.hs')

    # Run ghcide
    machine.succeed("ghcide")

    # Record for posterity
    machine.screenshot("ghcide-output")
  '';
})

Either

  • Run with nix-build repro.nix and observe the hang
  • Start the VM to experiment with $(nb tests/vim.nix -A driverInteractive)/bin/nixos-run-vms
    • logging in with alice/foobar

I suspect that it could be something about the minimality of the environment which causes this?

strace tells me that it's hung in FUTEX_WAIT_PRIVATE, but that's not really surprising

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: ghcideperformanceIssues about memory consumption, responsiveness, etc.type: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions