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

Not working with cabal-2.4.1.0 #1015

Open
newhoggy opened this Issue Dec 30, 2018 · 11 comments

Comments

Projects
None yet
4 participants
@newhoggy
Copy link

newhoggy commented Dec 30, 2018

Looks like the setup-config is located in a slightly different location when building with cabal-2.4.1.0:

$  /Users/jky/wrk/haskell-works/haskell-ide-engine-6/.stack-work/install/x86_64-osx/lts-12.14/8.4.3/bin/cabal-helper-wrapper "--with-ghc=ghc" "--with-ghc-pkg=ghc-pkg" "--with-cabal=cabal" "v1-style" "/Users/jky/wrk/haskell-works/hw-json" "/Users/jky/wrk/haskell-works/hw-json/dist-newstyle/build/x86_64-osx/ghc-8.4.3/hw-json-0.9.0.1" "package-db-stack" "flags" "compiler-version" "ghc-merged-pkg-options" "config-flags" "non-default-config-flags" "ghc-src-options" "ghc-pkg-options" "ghc-lang-options" "ghc-options" "source-dirs" "entrypoints" "needs-build-output"
cabal-helper-wrapper: /Users/jky/wrk/haskell-works/hw-json/dist-newstyle/build/x86_64-osx/ghc-8.4.3/hw-json-0.9.0.1/setup-config: openFile: does not exist (No such file or directory)
$ find dist-newstyle -name setup-config
dist-newstyle/build/x86_64-osx/ghc-8.4.3/hw-json-0.9.0.1/t/hw-json-test/opt/setup-config
dist-newstyle/build/x86_64-osx/ghc-8.4.3/hw-json-0.9.0.1/opt/setup-config
@newhoggy

This comment has been minimized.

Copy link
Author

newhoggy commented Dec 30, 2018

Notice that haskell-ide-engine expects the file to be located here:

dist-newstyle/build/x86_64-osx/ghc-8.4.3/hw-json-0.9.0.1/setup-config

but it is actually found here:

dist-newstyle/build/x86_64-osx/ghc-8.4.3/hw-json-0.9.0.1/opt/setup-config

It is unclear if it is the cabal version that is causing this difference or if it is the cabal file version, which I've specified like this:

$ head -n 1 hw-json.cabal
cabal-version:  2.2
@newhoggy

This comment has been minimized.

Copy link
Author

newhoggy commented Dec 30, 2018

After downgrading my cabal file to remove cabal-version: 2.2 and add cabal-version: >= 1.10, the problem still persists.

@newhoggy

This comment has been minimized.

Copy link
Author

newhoggy commented Dec 30, 2018

Work around:

$ cd dist-newstyle/build/x86_64-osx/ghc-8.4.3/hw-json-0.9.0.1/
$ ln -s opt/setup-config setup-config
@newhoggy

This comment has been minimized.

Copy link
Author

newhoggy commented Dec 30, 2018

Work around in the general case:

# haskell-ide-engine work-around
for x in $(find dist-newstyle -name setup-config | grep '/opt/setup-config$' | sed 's|/opt/setup-config$||g'); do
  ( cd $x
    ln -fs opt/setup-config setup-config
  )
done
@alanz

This comment has been minimized.

Copy link
Collaborator

alanz commented Dec 30, 2018

@newhoggy this is a problem with new-build in general, and the interim support we have at the moment, which basically only supports the library component.

@alanz alanz added this to the 2019-01 milestone Dec 31, 2018

@AlexeyRaga

This comment has been minimized.

Copy link
Contributor

AlexeyRaga commented Jan 7, 2019

Reading setup-config seems to be unreliable anyway because producing it requires new-build to be executed first. Even new-configure doesn't seem to be enough.

One of the implications is that changing the version number in a .cabal file changes the path to the file which doesn't exist until new-build is issued so the IDE reports readCreateProcess errors.
Which is not an ideal user experience.

Can it be worked around without requiring setup-config to be there?

@AlexeyRaga

This comment has been minimized.

Copy link
Contributor

AlexeyRaga commented Jan 7, 2019

I am curious, should we be using v2-style instead in the cabal helper?
Since dist-newstyle/cache/plan.json is in an "easier" location and it is generated by cabal new-configure we could use it, and issue cabal new-configure automatically when it is not present?

I wanted to try, but I see that to v2-style I should provide something that is called Unit, which is, perhaps, looks something like <my-executable-name>-<version>-inplace and this is where I am a bit lost. Which one do I suppose to use? How do I determine the "right" executable name, assuming that there can be >1 of them in the cabal file?

Can anyone provide a direction here?

@alanz

This comment has been minimized.

Copy link
Collaborator

alanz commented Jan 8, 2019

@AlexeyRaga , the proper new-build support is coming via https://github.com/alanz/haskell-ide-engine/tree/bleeding-edge-c-h

It sort of works at the moment, but has issues with caching, and detecting changes in the project being developed.

@AlexeyRaga

This comment has been minimized.

Copy link
Contributor

AlexeyRaga commented Jan 8, 2019

@alanz awesome, thanks! :) Can't wait! :)

@tjarvstrand

This comment has been minimized.

Copy link

tjarvstrand commented Jan 22, 2019

Any news? I'm eagerly awaiting this! :)

@alanz

This comment has been minimized.

Copy link
Collaborator

alanz commented Jan 28, 2019

@DanielG has managed to find some time to work on this solidly in the next few months, so rather than doing my band-aid patch, we will wait for his work.

And we are hoping for some assistance from @power-fungus and @fendor too.

@alanz alanz modified the milestones: 2019-01, 2019-02 Feb 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment