stack setup fails with: configure: error: cannot determine current directory

Created on 18 Oct 2016  路  18Comments  路  Source: commercialhaskell/stack

Running on Alpine Linux 3.4.3 with linux-x86_64-static, stack/ghc fails as below (might be missing some packages??):

/tmp/mypackage # /usr/local/bin/stack setup
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Already downloaded.                
Running /root/.stack/programs/x86_64-linux/ghc-8.0.1.temp/ghc-8.0.1/configure --prefix=/root/.stack/programs/x86_64-linux/ghc-8.0.1/ in directory /root/.stack/programs/x86_64-linux/ghc-8.0.1.temp/ghc-8.0.1/ exited with ExitFailure 1

checking for path to top of build tree... 
/root/.stack/programs/x86_64-linux/ghc-8.0.1.temp/ghc-8.0.1/configure: ./configure.lineno: line 2234: utils/ghc-pwd/dist-install/build/tmp/ghc-pwd-bindist: not found
configure: error: cannot determine current directory

Error encountered while configuring GHC with
  /root/.stack/programs/x86_64-linux/ghc-8.0.1.temp/ghc-8.0.1/configure --prefix=/root/.stack/programs/x86_64-linux/ghc-8.0.1/
  run in /root/.stack/programs/x86_64-linux/ghc-8.0.1.temp/ghc-8.0.1/

The following directories may now contain files, but won't be used by stack:
  - /root/.stack/programs/x86_64-linux/ghc-8.0.1.temp/
  - /root/.stack/programs/x86_64-linux/ghc-8.0.1/

Configuring GHC .../tmp/mypackage

Stack version

$ stack --version
Version 1.2.0, Git revision 241cd07d576d9c0c0e712e83d947e3dd64541c42 (4054 commits) x86_64 hpack-0.14.0
new-distro-support

Most helpful comment

Alpine Linux now has ghc 8.x in their testing repo:

https://pkgs.alpinelinux.org/packages?name=ghc&branch=&repo=&arch=&maintainer=

All 18 comments

Seems like another error occurs before this: /root/.stack/programs/x86_64-linux/ghc-8.0.1.temp/ghc-8.0.1/configure: ./configure.lineno: line 2234: utils/ghc-pwd/dist-install/build/tmp/ghc-pwd-bindist: not found

Seems like an issue with running the makefile based installation system of ghc. So I'd say that this is likely an upstream issue to be addressed in ghc. Can you please try to install the ghc bindists manually? It would be curious to see if the same thing occurs.

Yep, that should be the same. then try running configure.

Great, thanks!

Does this mean that we should revert the alpine linux PR I merged? (since it won't work)

Maybe we are to move forward with the followup patch (allowing others to step in ...), while not updating the docs advertising support? Thanks

Sure, but how can you test it? Just seems weird to have stuff in the script for a usecase that doesn't work.

Stack itself is installed and running:

/tmp # /usr/local/bin/stack --version
Version 1.2.0, Git revision 241cd07d576d9c0c0e712e83d947e3dd64541c42 (4054 commits) x86_64 hpack-0.14.0

Oh, great!

Is there an open issue here? Closing on the assumption this was solved or forgotten, please fix reopen otherwise...

@Blaisorblade Paolo, I feel this waits for upstream fix. stack advertises a static binary (which does run), but the ghc it tries to install doesn't, so it is not very useful ...

I haven't reread all links, but is there any upstream issue? Link to that?

Alpine Linux now has ghc 8.x in their testing repo:

https://pkgs.alpinelinux.org/packages?name=ghc&branch=&repo=&arch=&maintainer=

  1. GHC collects links to distro packages under this page鈥攖hey might add a link if pinged.
    https://www.haskell.org/ghc/distribution_packages

  2. This is not (necessarily) an upstream issue, per se鈥攁fter @mgsloan added that tag, we learned that GHC is dynamically linked against ~GHC~ musl (EDITED), so won't work on Alpine Linux. GHC accepts contributed binary builds, but doesn't commit to supporting all existing distributions鈥攖hey delegate this to distros.

  3. Since stack wants to support all distros, it seems it would need to list a GHC variant for musl in its list of GHC bindists here:
    https://github.com/fpco/stackage-content/blob/master/stack/stack-setup-2.yaml

  4. I wondered how Tim Dysinger used GHC on Alpine Linux in that blog post (https://www.fpcomplete.com/blog/2016/10/static-compilation-with-stack). Well, he installs the ghc distro package in the first Dockerfile. Quoting:

    RUN apk add alpine-sdk git ca-certificates ghc gmp-dev zlib-dev

What Stack needs to fully support managing GHC on Alpine is a GHC bindist for it that installs in the usual way (./configure --prefix=/foo/bar && make install after extracting the tarball). We will happily accept contributed bindists and can add code to detect Alpine and choose the correct bindist.

Looks like work in https://github.com/commercialhaskell/stack/issues/2387 will help here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Cosmius picture Cosmius  路  3Comments

rrnewton picture rrnewton  路  4Comments

s5k6 picture s5k6  路  3Comments

mgsloan picture mgsloan  路  3Comments

bitemyapp picture bitemyapp  路  3Comments