elm-lang / elm-platform

Bundle of all core development tools for Elm
BSD 3-Clause "New" or "Revised" License
762 stars 125 forks source link

Build from source with Stack #200

Closed jinjor closed 6 years ago

jinjor commented 7 years ago

Is it possible to build elm-platform from source with Stack?

I'm trying to build elm-platform on MacOS. To get old Haskell environment, I'm using Stack.

After installing Stack, I did the following.

$ stack setup 7.10.3
$ stack install --resolver lts-4.2 cabal-install
$ stack runghc --resolver lts-4.2 buildFromSource.hs 0.18

This works almost fine, but .cabal-sandbox/bin is not created.

Full log is here:

Using GHC 7.10
Using Cabal 1.22.7.0

Cloning into 'elm-compiler'...
remote: Counting objects: 24996, done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 24996 (delta 9), reused 0 (delta 0), pack-reused 24968
Receiving objects: 100% (24996/24996), 6.58 MiB | 765.00 KiB/s, done.
Resolving deltas: 100% (15460/15460), done.
Checking connectivity... done.
Cloning into 'elm-package'...
remote: Counting objects: 3703, done.
remote: Total 3703 (delta 0), reused 0 (delta 0), pack-reused 3703
Receiving objects: 100% (3703/3703), 697.31 KiB | 475.00 KiB/s, done.
Resolving deltas: 100% (2203/2203), done.
Checking connectivity... done.
Cloning into 'elm-make'...
remote: Counting objects: 1051, done.
remote: Total 1051 (delta 0), reused 0 (delta 0), pack-reused 1051
Receiving objects: 100% (1051/1051), 217.22 KiB | 172.00 KiB/s, done.
Resolving deltas: 100% (706/706), done.
Checking connectivity... done.
Cloning into 'elm-reactor'...
remote: Counting objects: 3396, done.
remote: Total 3396 (delta 0), reused 0 (delta 0), pack-reused 3396
Receiving objects: 100% (3396/3396), 1.92 MiB | 705.00 KiB/s, done.
Resolving deltas: 100% (1948/1948), done.
Checking connectivity... done.
Cloning into 'elm-repl'...
remote: Counting objects: 995, done.
remote: Total 995 (delta 0), reused 0 (delta 0), pack-reused 995
Receiving objects: 100% (995/995), 175.06 KiB | 0 bytes/s, done.
Resolving deltas: 100% (615/615), done.
Checking connectivity... done.
Downloading the latest package list from hackage.haskell.org
Skipping download: Local and remote files match.
Writing a default package environment file to
/Users/jinjor/Projects/elm-book/Elm-Platform/0.18/cabal.sandbox.config
Creating a new sandbox at
/Users/jinjor/Projects/elm-book/Elm-Platform/0.18/.cabal-sandbox
cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with
Cabal. Use the flag --package-db to specify a package database (it can be used
multiple times).
cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with
Cabal. Use the flag --package-db to specify a package database (it can be used
multiple times).
cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with
Cabal. Use the flag --package-db to specify a package database (it can be used
multiple times).

This error seems to be the same as this issue. Has anyone solved it?

I also tried directly running runghc without stack, but it took very long. (Is it the right behavior? I could not wait and stoped it...)

process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

TiltMeSenpai commented 7 years ago

I think the error

cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with
Cabal. Use the flag --package-db to specify a package database (it can be used
multiple times).

is related to the fact that stack and cabal generally don't play nice. (BuildFromSource.hs is more or less trying to run a cabal install inside a stack install). I'm currently trying to patch the installer to shut up about all its problems so I can get a working 0.18 install on nix, but a more permanent solution may be to just use stack. It honestly looks like the whole BuildFromSource.hs system could just be replaced by a stack.yaml and a .cabal file.

ruuda commented 7 years ago

It can be done.

evancz commented 6 years ago

I don't use stack for various reasons. My workflow is fine, and I'd need to weigh the possible outside benefit against the cost. Right know I do not know that outside benefit at all, so I cannot prioritize this.