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

hls-plugin-api-1.4.0.0 doesn't build with some 1.0.4 #2969

Closed
fxttr opened this issue Jun 18, 2022 · 5 comments
Closed

hls-plugin-api-1.4.0.0 doesn't build with some 1.0.4 #2969

fxttr opened this issue Jun 18, 2022 · 5 comments
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@fxttr
Copy link

fxttr commented Jun 18, 2022

Your environment

Which OS do you use: NixOS
Which LSP client (editor/plugin) do you use: emacs + lsp-mode
Describe your project (alternative: link to the project):

{
  description = "Removing sensitive informations from .nix files";
  inputs.haskellNix.url = "github:input-output-hk/haskell.nix";
  inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
  inputs.flake-utils.url = "github:numtide/flake-utils";
  
  outputs = { self, nixpkgs, flake-utils, haskellNix }:
    flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
    let
      overlays = [ haskellNix.overlay
        (final: prev: {
          nix-strip =
            final.haskell-nix.project' {
              src = ./.;
              compiler-nix-name = "ghc8107";
              shell.tools = {
                cabal = {};
                ormolu = {};
                haskell-language-server = { modules = [{ reinstallableLibGhc = false; }]; };
              };
              shell.buildInputs = with pkgs; [
                nixpkgs-fmt
              ];
            };
        })
      ];
      pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
      flake = pkgs.nix-strip.flake {};
    in flake // {
      defaultPackage = flake.packages."nix_strip:exe:nix_strip-exe";
    });
}

Steps to reproduce

Create a basic cabal project, create flake.nix and run "nix develop ." on NixOS or a system with installed nix package manager

Expected behaviour

Put me in a working development shell with hls.

Actual behaviour

Building the environment crashes with a error message. Please have a look at the link below. Hydra got the same problem.

Include debug information

https://hydra.iohk.io/build/15888389/nixlog/567

@fxttr fxttr added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Jun 18, 2022
@michaelpj
Copy link
Collaborator

Fortunately, I know enough about haskell.nix to be able to decipher this :)

The issue started with a newer version of Hackage, and looking at the error, it's talking about GEq which comes from some. Lo and behold, a new version of some was recently released. And indeed, hls-plugin-api does not build with it, which is strange, since it doesn't look like it should change anything.

@michaelpj michaelpj changed the title hls-plugin-api-1.4.0.0 fails to compile on NixOS hls-plugin-api-1.4.0.0 doesn't build with some 1.0.4 Jun 19, 2022
@michaelpj
Copy link
Collaborator

The error is very odd. It's complaining about not being able to deduce instances which are explicitly declared in lsp-types, I don't see how that can happen 🤔

@hamishmack
Copy link

Diffing the cabal generated freeze files gives:

<              any.algebraic-graphs ==0.6,
---
>              any.algebraic-graphs ==0.6.1,
89c89
<              any.dependent-sum ==0.7.1.0,
---
>              any.dependent-sum ==0.6.2.0,
295c295
<              any.some ==1.0.3,
---
>              any.some ==1.0.4,

The problem is that dependent-sum-0.7.1.0 requires some <1.0.4. Cabal must choose between using the latest dependent-sum and the latest some. It chooses to use the latest some and with an older (0.6.2.0).

I have added obsidiansystems/dependent-sum#71

@hamishmack
Copy link

@sjakobi indicated (input-output-hk/haskell.nix#1526 (comment)) that obsidiansystems/dependent-sum#71 might not be possible. Perhaps we could add a lower bound of dependent-sum >=0.7.1.0 to hls-plugin-api to prevent it cabal choosing dependent-sum-0.6.2.0?

@michaelpj
Copy link
Collaborator

Old, we're well past this now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

3 participants