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

if impl(ghcjs) XXX else YYY should process both XXX and YYY (like it does for flags), but instead chooses none #2120

Closed
srghma opened this issue Aug 21, 2021 · 1 comment
Labels
status: needs info Not actionable, because there's missing information type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@srghma
Copy link

srghma commented Aug 21, 2021

Your environment

Output of haskell-language-server --probe-tools or haskell-language-server-wrapper --probe-tools:

haskell-language-server version: 1.3.0.0 (GHC: 8.10.4) (PATH: /nix/store/4wkv3mi2hidvbgvmibvjgyzp5nbnqzw6-haskell-language-server-1.3.0-installer/bin/haskell-language-server-wrapper) (GIT hash: e7c5e90b6df5dff2760d76169eddaea3bdd6a831)
Tool versions found on the $PATH
cabal:          3.0.0.0
stack:          Not found
ghc:            8.6.5

Which OS do you use: NixOs

Which lsp-client do you use: Vs Code

Describe your project (alternative: link to the project): it's a develop branch reflex-frp/reflex-platform@55da77c , but I have added

  tryReflexShell = pinBuildInputs ("shell-" + system) (tryReflexPackages ++
    (
      let
        inherit (nixpkgs) callPackage fetchFromGitHub mkShell;
        easy-hls-src = fetchFromGitHub {
          owner  = "jkachmar";
          repo   = "easy-hls-nix";
          rev    = "6cb50f04e3a61b1ec258c6849df84dae9dfd763f";
          sha256 = "1rvi6067nw64dka8kksl7f34pwkq7wx7pnhnz3y261fw9z5j4ndp";
        };
        easy-hls = callPackage easy-hls-src {
          ghcVersions = [ "8.6.5" ];
        };
      in
        [easy-hls]
    )
  );

and run ./try-reflex

check this comment

Contents of hie.yaml: without hie.yaml file

Steps to reproduce

I clone this repo and execute

./scripts/hack-on haskell-overlays/reflex-packages/dep/universe
./scripts/hack-on haskell-overlays/reflex-packages/dep/dependent-sum-universe-orphans
./scripts/hack-on haskell-overlays/reflex-packages/dep/reflex
./scripts/hack-on haskell-overlays/reflex-packages/dep/cabal-macosx
./scripts/hack-on haskell-overlays/reflex-packages/dep/jsaddle-dom
./scripts/hack-on haskell-overlays/reflex-packages/dep/reflex-dom
./scripts/hack-on haskell-overlays/reflex-packages/dep/ghcjs-dom
./scripts/hack-on haskell-overlays/reflex-packages/dep/dependent-monoidal-map
./scripts/hack-on haskell-overlays/reflex-packages/dep/reflex-todomvc
./scripts/hack-on haskell-overlays/reflex-packages/dep/gargoyle
./scripts/hack-on haskell-overlays/reflex-packages/dep/reflex-aeson-orphans
./scripts/hack-on haskell-overlays/reflex-packages/dep/jsaddle
./scripts/hack-on haskell-overlays/reflex-packages/dep/patch
./try-reflex
code .

hack-on is using https://github.com/obsidiansystems/nix-thunk to replace the contents of dir (e.g. https://github.com/reflex-frp/reflex-platform/blob/develop/haskell-overlays/reflex-packages/dep/reflex/) with the actual repo

so, I see that reflex compiles, but this module https://github.com/reflex-frp/reflex-dom/blob/6a7782a61e90e7369a8278441eb47f702bb7c63b/reflex-dom-core/src/Reflex/Dom/Builder/Immediate.hs#L148 throws error

Could not load module ‘Foreign.JavaScript.Internal.Utils’
it is a hidden module in the package ‘reflex-dom-core-0.6.2.0’not found

this is because of (I think)

  if impl(ghcjs)
    hs-source-dirs: src-ghcjs
    build-depends:
      ghcjs-base,
      hashable >= 1.2 && < 1.4
  else
    hs-source-dirs: src-ghc
    if !os(windows)
      build-depends: unix == 2.7.*

I THINK it doesn't choose any of this cases, but should EITHER:

  • allow user to choose implementation (ghc or ghcjs)
  • choose BOTH, just like (I think) it does for flags (again, am I right about flags?) (TODO: both src-ghc and src-ghcjs first contain the same module Foreign.JavaScript.Internal.Utils, how it should work then?)

I don't really know how it SHOULD work

Include debug information

  1. in the bottom of this comment you can find a logs of vscode when it loads Immediate.hs
  2. haskell-language-server-wrapper --debug . 2>&1 | tee haskell-language-server-wrapper.log (here you can find only part of log -- if program is started outside vscode, the log is neverending and all 36gb of memory of my computer gets consumed, I have to kill program even after CTRL-C, probably there is a memory leak)
@jneira jneira added type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. type: setup labels Aug 22, 2021
@hasufell hasufell added status: needs info Not actionable, because there's missing information and removed old_status: needs repro labels Jul 13, 2022
@michaelpj
Copy link
Collaborator

We just ask cabal what to do, it's cabal that makes decisions here. I think there is certainly some confusion about what to do fro cross usecases but I'm not sure what to do about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs info Not actionable, because there's missing information 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

5 participants