Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Building cabal-helper fails on Windows 10 #435

Closed
dnadales opened this issue Jan 3, 2018 · 12 comments
Closed

Building cabal-helper fails on Windows 10 #435

dnadales opened this issue Jan 3, 2018 · 12 comments

Comments

@dnadales
Copy link

dnadales commented Jan 3, 2018

While trying to build HIE on windows 10 I get he following error:

haddock-library-1.4.4: build
haddock-library-1.4.4: copy/register
Progress: 2/16
--  While building custom Setup.hs for package cabal-helper-0.8.0.0 using:
      C:\Users\nadalesagutde\Documents\GitHub\haskell-ide-engine\.stack-work\downloaded\XcrjBfxqjaxS\.stack-work\dist\5c8418a7\setup\s
etup --builddir=.stack-work\dist\5c8418a7 build lib:cabal-helper exe:cabal-helper-wrapper --ghc-options " -ddump-hi -ddump-to-file -fd
iagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: C:\Users\nadalesagutde\Documents\GitHub\haskell-ide-engine\.stack-work\logs\cabal-helper-0.8.0.0.log

    Preprocessing library for cabal-helper-0.8.0.0..
    Building library for cabal-helper-0.8.0.0..
    Preprocessing executable 'cabal-helper-wrapper' for cabal-helper-0.8.0.0..
    Building executable 'cabal-helper-wrapper' for cabal-helper-0.8.0.0..
    [ 9 of 12] Compiling CabalHelper.Compiletime.Data ( src\CabalHelper\Compiletime\Data.hs, .stack-work\dist\5c8418a7\build\cabal-hel
per-wrapper\cabal-helper-wrapper-tmp\CabalHelper\Compiletime\Data.o )
    [10 of 12] Compiling Paths_cabal_helper ( .stack-work\dist\5c8418a7\build\cabal-helper-wrapper\autogen\Paths_cabal_helper.hs, .stack-work\dist\5c8418a7\build\cabal-helper-wrapper\cabal-helper-wrapper-tmp\Paths_cabal_helper.o )
    .stack-work\dist\5c8418a7\build\cabal-helper-wrapper\cabal-helper-wrapper-tmp\.stack-work\dist\5c8418a7\build\cabal-helper-wrapper

I don't know whether windows is a supported platform, but this might be related to long path names.

@nponeccop
Copy link
Contributor

Windows is a supported platform.

@dnadales
Copy link
Author

dnadales commented Jan 3, 2018

Maybe I can help with setting up an appveyor CI then, and updating the build instructions on windows.

@nponeccop
Copy link
Contributor

Did you manage to resolve it? Your paths seem to be 140 chars, way less than the infamous MAX_PATH of 260

@dnadales
Copy link
Author

dnadales commented Jan 3, 2018

No, I Googled around without any luck. Should I set the MAX_PATH environment variable to 260 then?

@nponeccop
Copy link
Contributor

MAX_PATH is not an environment variable, you cannot get past that limitation if you hit it. But I doubt you have this long path issue

@ShrykeWindgrace
Copy link

Hi,

do you have updates on this subject? I'm having the same issue on a win10 machine with latest stack.

@nponeccop
Copy link
Contributor

nponeccop commented Jan 30, 2018

Was it really the long path issue? I'll investigate and see how log folder. Note that cabal-helper was fixed recently.

@ShrykeWindgrace
Copy link

ShrykeWindgrace commented Jan 30, 2018

It appears that way. I had haskell-ide-engine somewhere deep in folder hierarchy and the compilation failed with file not found message. The moment I moved the folder to e:\hie, the compilation succeeded.

Also, what fix in cabal-helper are you talking about?

@nponeccop
Copy link
Contributor

nponeccop commented Jan 30, 2018

I had haskell-ide-engine somewhere deep in folder hierarchy

Your comment implied that you encountered the same problem as in this issue. But apparently it was a completely unrelated issue as the path in the first message of this issue is way too short, and there are no "path not found" messages in the original log either.

what fix in cabal-helper are you talking about?

DanielG/cabal-helper#40

See also this comment from @alanz : #372 (comment)

@ShrykeWindgrace
Copy link

@nponeccop You may be right. It seems that by a weird coincidence the fix rolled in exactly when I changed the checkout folder.

@dnadales
Copy link
Author

dnadales commented Apr 4, 2018

I can confirm that setting the group policy "Enable Win32 long paths" to "Enabled" fixes the problem for me, so I'm closing this issue. Now I'm able to build HIE on windows! 🍾

@dnadales dnadales closed this as completed Apr 4, 2018
@Ciantic
Copy link

Ciantic commented Jun 14, 2018

I've set that Group Policy, yet it doesn't work:

PS C:\haskell-ide-engine> stack install
�[0mNo packages found in snapshot which provide a "cabal" executable, which is a build-tool dependency of "cabal-helper"�[0m

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for haskell-ide-engine-0.2.0.0(+pedantic):
    win32 needed, but the stack configuration has no specified version (no package with that name
          found, perhaps there is a typo in a package's build-depends or an omission from the
          stack.yaml packages list?)
needed since haskell-ide-engine is a build target.

Some different approaches to resolving this:

  * Consider trying 'stack solver', which uses the cabal-install solver to attempt to find some
    working build configuration. This can be convenient when dealing with many complicated
    constraint errors, but results may be unpredictable.

Plan construction failed.

This is clean install of stack. I have also tried this half a year ago, I could build it back then.

I think proper way would be to provide pre-built binaries, since this is difficult to get working.

@alanz alanz added this to the prehistory milestone Feb 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants