Giter Site home page Giter Site logo

Comments (23)

jcollard avatar jcollard commented on May 18, 2024

The first time I tried this, it failed and told me I needed to update cabal. I manually ran cabal update. After this, everything installs fine.

Cabal:

$ cabal --version
cabal-install version 1.20.0.3
using version 1.20.0.2 of the Cabal library 

GHC:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3

OS:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:    14.04
Codename:   trusty

from elm-platform.

evancz avatar evancz commented on May 18, 2024

Awesome, thank you @jcollard! I added cabal update to the build.sh script so it should be in there for everyone now.

from elm-platform.

garyLockyer avatar garyLockyer commented on May 18, 2024

Fails.
OS:
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.04
Release: 15.04
Codename: vivid

GHC: The Glorious Glasgow Haskell Compilation System, version 7.6.3
Cabal: cabal-install version 1.20.0.3
using version 1.20.0.2 of the Cabal library

GHC and cabal installed with:
sudo apt-get install ghc cabal-install

after first failure deleted elm-platform and ran fubar script, same error.

Cloning into 'elm-package'...
remote: Counting objects: 3198, done.
remote: Total 3198 (delta 0), reused 0 (delta 0), pack-reused 3198
Receiving objects: 100% (3198/3198), 587.35 KiB | 383.00 KiB/s, done.
Resolving deltas: 100% (1897/1897), done.
Checking connectivity... done.
Writing a default package environment file to
/home/gary/elm-platform/versions/0.15.1/elm-package/cabal.sandbox.config
Using an existing sandbox located at /home/gary/elm-platform/versions/0.15.1
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: aeson-0.7.0.6/installed-6b1... (user goal)
next goal: elm-package (user goal)
rejecting: elm-package-0.5.1 (conflict: aeson =>
vector==0.11.0.0/installed-512..., elm-package => vector>=0.10 && <0.11)
rejecting: elm-package-0.5, 0.4, 0.2.2, 0.2.1, 0.2 (global constraint requires
==0.5.1)
Dependency tree exhaustively searched.

Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.

from elm-platform.

mgold avatar mgold commented on May 18, 2024

Responding to the mailing list, I got a failed build. Looks to be the same as Gary's but for completeness' sake...

  • Debian 8.1 "Jessie"
  • GHC version 7.8.4
  • "cabal-install version 1.20.0.3, using version 1.20.0.2 of the Cabal library"
  • Followed the README exactly. Did not run the fubar script.
  • Error dump:
max@hostname:/opt/elm-platform/versions/0.15.1$ ./build.sh 
<SNIP>
[71 of 72] Compiling Compile          ( src/Compile.hs, dist/dist-sandbox-9a05b902/build/Compile.o )
[72 of 72] Compiling Elm.Compiler     ( src/Elm/Compiler.hs, dist/dist-sandbox-9a05b902/build/Elm/Compiler.o )
In-place registering elm-compiler-0.15.1...
Preprocessing executable 'elm' for elm-compiler-0.15.1...
[1 of 3] Compiling Paths_elm_compiler ( dist/dist-sandbox-9a05b902/build/autogen/Paths_elm_compiler.hs, dist/dist-sandbox-9a05b902/build/elm/elm-tmp/Paths_elm_compiler.o )
[2 of 3] Compiling Elm.Compiler.Version ( src/Elm/Compiler/Version.hs, dist/dist-sandbox-9a05b902/build/elm/elm-tmp/Elm/Compiler/Version.o )
[3 of 3] Compiling Main             ( src/CommandLineRouter.hs, dist/dist-sandbox-9a05b902/build/elm/elm-tmp/Main.o )
Linking dist/dist-sandbox-9a05b902/build/elm/elm ...
Creating package registration file: /tmp/pkgConf-elm-compiler-0.1531380.1
Installing library in
/opt/elm-platform/versions/0.15.1/lib/x86_64-linux-ghc-7.8.4/elm-compiler-0.15.1
Installing executable(s) in /opt/elm-platform/versions/0.15.1/bin
Registering elm-compiler-0.15.1...
Installed elm-compiler-0.15.1
Cloning into 'elm-package'...
remote: Counting objects: 3198, done.
remote: Total 3198 (delta 0), reused 0 (delta 0), pack-reused 3198
Receiving objects: 100% (3198/3198), 587.35 KiB | 0 bytes/s, done.
Resolving deltas: 100% (1897/1897), done.
Checking connectivity... done.
Writing a default package environment file to
/opt/elm-platform/versions/0.15.1/elm-package/cabal.sandbox.config
Using an existing sandbox located at /opt/elm-platform/versions/0.15.1
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: aeson-0.8.1.1/installed-aa6... (user goal)
next goal: elm-package (user goal)
rejecting: elm-package-0.5.1 (conflict: aeson =>
vector==0.11.0.0/installed-8ca..., elm-package => vector>=0.10 && <0.11)
rejecting: elm-package-0.5, 0.4, 0.2.2, 0.2.1, 0.2 (global constraint requires
==0.5.1)
Backjump limit reached (change with --max-backjumps).

Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.

The "good" news is, this looks like a cabal dependency problem, not an OS or Haskell problem.

from elm-platform.

jvoigtlaender avatar jvoigtlaender commented on May 18, 2024

#65 hopefully fixes the above failing cases.

from elm-platform.

evancz avatar evancz commented on May 18, 2024

Gonna call this experiment a failure. At this time, it seems that a single cabal.config file can only work for some subset of GHC, so folks are still going to get failures no matter what.

The answer is to fix npm. That will have way more impact and actually be reliable.

from elm-platform.

jcollard avatar jcollard commented on May 18, 2024

@evancz fwiw, I've never had any issues installing via npm. Is there a thread discussing the issues?

from elm-platform.

evancz avatar evancz commented on May 18, 2024

It is kind of logged in #60. The main problems are:

  1. The latest version does not set ELM_HOME properly. So many new people try to use elm-reactor and it fails. I think they forgot to do the elm-reactor-wrapped trick that the Mac installer does or something. #60 links to an issue where I try to find out what's going wrong there.
  2. The Debian one was built on a 64-bit machine so it can't be used on any 32-bit OS, which people have.

It seemed like I was getting lots of complaints about this, but now that I've gone through this mess, it seems like that's a far better set of problems to have.

I think it's possible to fix both of those things, but I have not been able to figure it out. (time + unfamiliarity) If you can look, I think that'd be a far better fix than any of the things I have been trying.

from elm-platform.

ianbollinger avatar ianbollinger commented on May 18, 2024

cabal.config only seems to do anything if it's copied into the directory where cabal is run. What happens on my machine is that vector-0.11 is installed into the sandbox when building elm-compiler and then when elm-package is configured, it fails because it needs an older version of vector.

(If I copy cabal.config into the directory then nothing works because I have GHC 7.10.)

For the resolver to work everything needs to be built together, though I don't think cabal can do this.

from elm-platform.

evancz avatar evancz commented on May 18, 2024

@jvoigtlaender just fixed the first thing you mention in #65 but it is true that different versions of GHC cannot work with the same cabal.config file. I did not know that. It's not clear to me how to add that in. I think that's the missing ingredient though.

Once that's added, maybe this route can actually work.

from elm-platform.

llaisdy avatar llaisdy commented on May 18, 2024

Dear All

Perhaps I've done something wrong but I've had no problems installing from source just now on FreeBSD. Fresh installs of GHC and cabal:

$ ghci --version
The Glorious Glasgow Haskell Compilation System, version 7.10.2
~$ cabal --version
cabal-install version 1.22.6.0
using version 1.22.4.0 of the Cabal library

Then run your BuildFromSource.hs script for 0.15.1. Put the bin dir on my PATH, and:

$ elm repl
Elm REPL 0.4.2 (Elm Platform 0.15.1)
See usage examples at https://github.com/elm-lang/elm-repl
Type :help for help, :exit to exit

Thanks

Ivan

from elm-platform.

evancz avatar evancz commented on May 18, 2024

Thanks for letting us know @llaisdy! This thread actually led to a bunch of improvements from @jvoigtlaender and @rehno-lindeque getting merged into the main BuildFromSource.hs script that improved reliability quite a bit!

from elm-platform.

alphydan avatar alphydan commented on May 18, 2024

In case it's relevant, after encountering issue #411 on Ubuntu 14.04,
I wrote a tutorial explaining what worked for me.

from elm-platform.

dusky3 avatar dusky3 commented on May 18, 2024

@jvoigtlaender here is my reply from our conversation at kevva/elm-bin#21. I followed the @alphydan 's tutorial, but first I had to update my glibc library to version >= 2.15 by following the instructions here: http://stackoverflow.com/questions/10863613/how-to-upgrade-glibc-from-version-2-13-to-2-15-on-debian. Then I got the ghc and cabal running:

~ % ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.10.1
~ % cabal --version
cabal-install version 1.22.6.0
using version 1.22.4.0 of the Cabal library 

I added everything to my PATH variables, got the script and ran runhaskell BuildFromSource.hs 0.15.1 . Everything looked fine, but these were the last 10 lines I got after more than one hour of compiling on my older machine:

backend/Main.hs:6:1: Warning:
    The import of `<$>' from module `Control.Applicative' is redundant
Linking dist/dist-sandbox-f099a7d3/build/elm-reactor/elm-reactor ...
Custom build step: creating and collecting all static resources
Installing executable(s) in
/home/dusky/dev/Elm-Platform/0.15.1/.cabal-sandbox/bin
Installed elm-reactor-0.3.2
cabal: Error: some packages failed to install:
elm-package-0.5.1 failed during the building phase. The exception was:
ExitFailure 1

There were few warnings about redundancy during the installation, but if I got it right everything except elm-package-0.5.1 was installed. But I can not run elm-make or elm-reactor even from the folder where they are installed:

elm-make HEAD % ls
elm-make  elm-make-tmp
elm-make HEAD % elm-make --help
zsh: command not found: elm-make

or from .cabal-sandbox/bin directory:

bin % ls
aeson-pretty  elm  elm-make  elm-package  elm-reactor  glsl-pprint
bin % elm-make --help
zsh: command not found: elm-make
bin % elm-reactor --help
zsh: command not found: elm-reactor

I hope this helps somehow. As a reminder I have 32bit Crunchbang Waldorf linux (Debian Wheezy).

from elm-platform.

jvoigtlaender avatar jvoigtlaender commented on May 18, 2024

I'm not a Linux person, but about the last points, where you are in a directory in which you have an executable like elm-make (I assume it's an executable, though an "ls -la" would be a safer way to be sure), but cannot run it: Maybe you need to call it as "./elm-make" due to some safety settings in your shell?

About the actual problem with building the Elm tools: It indeed looks like something failed during the elm-package install specifically. Unfortunately the messages for that will be hidden much further above in your log. So, if you still have the Elm-Platform/0.15.1 directory lying around (with the partially successful build) could you run there just "cabal install elm-package" and post the complete output?

from elm-platform.

dusky3 avatar dusky3 commented on May 18, 2024

Hi @jvoigtlaender, you were right, ./elm-make is the right way to run it:

bin % ls -la
total 52440
drwxr-xr-x 2 dusky dusky     4096 Oct  5 22:24 .
drwxr-xr-x 8 dusky dusky     4096 Oct  5 22:20 ..
-rwxr-xr-x 1 dusky dusky  6264196 Oct  5 22:09 aeson-pretty
-rwxr-xr-x 1 dusky dusky   822896 Oct  5 22:22 elm
-rwxr-xr-x 1 dusky dusky 16462152 Oct  5 22:19 elm-make
-rwxr-xr-x 1 dusky dusky 14261512 Oct  5 22:19 elm-package
-rwxr-xr-x 1 dusky dusky 13857872 Oct  5 22:24 elm-reactor
-rwxr-xr-x 1 dusky dusky  2002276 Oct  5 21:53 glsl-pprint
bin % ./elm-make --help
elm-make 0.2 (Elm Platform 0.15.1)

Usage: elm-make [FILES...] [--output FILE] [--yes] [--report FORMAT] [--warn]
                [--docs FILE]
  build Elm projects

Available options:
  -h,--help                Show this help text
  --output FILE            Write output to FILE.
  --yes                    Reply 'yes' to all automated prompts.
  --report FORMAT          Format of error and warning reports (e.g.
                           --report=json)
  --warn                   Report warnings to improve code quality.
  --docs FILE              Write documentation to FILE as JSON.

To learn more about a particular command run:
    elm-make COMMAND --help
bin % ./elm-reactor 
Elm Reactor 0.3.2 (Elm Platform 0.15.1)
Listening on http://0.0.0.0:8000/

Below is the dump of the "cabal install elm-package":

0.15.1 % cabal install elm-package
Some add-source dependencies have been modified. They will be reinstalled...
Resolving dependencies...
In order, the following will be installed:
elm-compiler-0.15.1 (via: elm-package-0.5.1) (reinstall)
elm-package-0.5.1 (reinstall) (changes: ansi-wl-pprint-0.6.7.3 added, optparse-applicative-0.11.0.2 added, pretty-1.1.2.0 added)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
Configuring elm-compiler-0.15.1...
Building elm-compiler-0.15.1...
Preprocessing library elm-compiler-0.15.1...
In-place registering elm-compiler-0.15.1...
Preprocessing executable 'elm' for elm-compiler-0.15.1...
Creating package registration file:
/tmp/pkgConf-elm-compiler-0.153040891721303455736.1
Installing library in
/home/dusky/dev/Elm-Platform/0.15.1/.cabal-sandbox/lib/i386-linux-ghc-7.10.1/elm-compiler-0.15.1-8kVGzCqQsGp9WSnOaubtTa
Installing executable(s) in
/home/dusky/dev/Elm-Platform/0.15.1/.cabal-sandbox/bin
Registering elm-compiler-0.15.1...
Installed elm-compiler-0.15.1
Configuring elm-package-0.5.1...
Building elm-package-0.5.1...
Preprocessing library elm-package-0.5.1...
In-place registering elm-package-0.5.1...
Preprocessing executable 'elm-package' for elm-package-0.5.1...
[18 of 25] Compiling Docs             ( src/Docs.hs, dist/dist-sandbox-f099a7d3/build/elm-package/elm-package-tmp/Docs.o ) [flags changed]

src/Docs.hs:21:5:
    Non type-variable argument
      in the constraint: Control.Monad.Error.Class.MonadError [Char] m
    (Use FlexibleContexts to permit this)
    When checking that `badJson' has the inferred type
      badJson :: forall (m :: * -> *) a.
                 Control.Monad.Error.Class.MonadError [Char] m =>
                 [Char] -> m a
    In an equation for `generate':
        generate
          = do { Cmd.run "elm-make" ["--docs=" ++ Path.documentation];
                 json <- liftIO (BS.readFile Path.documentation);
                 either badJson return (Json.eitherDecode json) }
          where
              badJson msg
                = throwError $ "Problem with generated documentation:\n" ++ msg
Failed to install elm-package-0.5.1
cabal: Error: some packages failed to install:
elm-package-0.5.1 failed during the building phase. The exception was:
ExitFailure 1

I would like to thank you for taking time to help me.

from elm-platform.

jvoigtlaender avatar jvoigtlaender commented on May 18, 2024

Ah, sorry, I should have asked you to run "cabal install --ghc-options=-XFlexibleContexts elm-package". The build script passes this option automatically.

from elm-platform.

dusky3 avatar dusky3 commented on May 18, 2024

Thank you @jvoigtlaender for solving my problem, it installed fine and if I run it I get:

bin % ./elm-package --help
Elm Package Manager 0.5.1 (Elm Platform 0.15.1)

Usage: elm-package COMMAND
  install and publish elm libraries

Available options:
  -h,--help                Show this help text

Available commands:
  install                  Install packages to use locally
  publish                  Publish your package to the central catalog
  bump                     Bump version numbers based on API changes
  diff                     Get differences between two APIs

To learn more about a particular command run:
    elm-package COMMAND --help

from elm-platform.

jvoigtlaender avatar jvoigtlaender commented on May 18, 2024

Cool that it worked now. I'm a bit puzzled, because the build script should have issued an equivalent command. But unfortunately one sometimes does see such "non-deterministic" behavior with cabal builds. It could depend on some specific combination of versions of other packages being pulled in, that differed depending on whether the build script tried to build everything in one go or whether the last package was built independently.

So probably we won't be able to reproduce what exactly happened here originally. But let's be content that the day you can use Elm on your machine arrived sooner rather than later. 😄

And thanks for staying through this!

from elm-platform.

dusky3 avatar dusky3 commented on May 18, 2024

@jvoigtlaender I was playing with elm (following http://elm-by-example.org) and found out that elm-repl was not installed. I tried to install it, but I got this error:

0.15.1 % cabal install elm-repl
Resolving dependencies...
Configuring elm-repl-0.4.2...
Building elm-repl-0.4.2...
Preprocessing executable 'elm-repl' for elm-repl-0.4.2...
[ 1 of 10] Compiling Paths_elm_repl   ( dist/dist-sandbox-f099a7d3/build/autogen/Paths_elm_repl.hs, dist/dist-sandbox-f099a7d3/build/elm-repl/elm-repl-tmp/Paths_elm_repl.o ) [flags changed]
[ 2 of 10] Compiling Flags            ( src/Flags.hs, dist/dist-sandbox-f099a7d3/build/elm-repl/elm-repl-tmp/Flags.o ) [flags changed]
[ 3 of 10] Compiling Environment      ( src/Environment.hs, dist/dist-sandbox-f099a7d3/build/elm-repl/elm-repl-tmp/Environment.o ) [flags changed]
[ 4 of 10] Compiling Read             ( src/Read.hs, dist/dist-sandbox-f099a7d3/build/elm-repl/elm-repl-tmp/Read.o ) [flags changed]

src/Read.hs:4:1: Warning:
    The import of ‘Data.Functor’ is redundant
      except perhaps to import instances from ‘Data.Functor’
    To import instances alone, use: import Data.Functor()
[ 5 of 10] Compiling Eval.Code        ( src/Eval/Code.hs, dist/dist-sandbox-f099a7d3/build/elm-repl/elm-repl-tmp/Eval/Code.o ) [flags changed]
[ 7 of 10] Compiling Eval             ( src/Eval.hs, dist/dist-sandbox-f099a7d3/build/elm-repl/elm-repl-tmp/Eval.o ) [flags changed]
[ 8 of 10] Compiling Loop             ( src/Loop.hs, dist/dist-sandbox-f099a7d3/build/elm-repl/elm-repl-tmp/Loop.o ) [flags changed]
[ 9 of 10] Compiling Completion       ( src/Completion.hs, dist/dist-sandbox-f099a7d3/build/elm-repl/elm-repl-tmp/Completion.o ) [flags changed]
[10 of 10] Compiling Main             ( src/Main.hs, dist/dist-sandbox-f099a7d3/build/elm-repl/elm-repl-tmp/Main.o ) [flags changed]

src/Main.hs:3:1: Warning:
    The import of ‘<*>, <$>’
    from module ‘Control.Applicative’ is redundant
Linking dist/dist-sandbox-f099a7d3/build/elm-repl/elm-repl ...
/usr/bin/ld: cannot find -ltinfo
collect2: error: ld returned 1 exit status
Failed to install elm-repl-0.4.2
cabal: Error: some packages failed to install:
elm-repl-0.4.2 failed during the building phase. The exception was:
ExitFailure 1

I also tried with the --ghc-options=-XFlexibleContexts flag, but the result was the same. You can also see it was not installed by looking at my ls dumps above. Sorry, I didn't realize it that time.

Elm make, reactor and package work fine.

from elm-platform.

jvoigtlaender avatar jvoigtlaender commented on May 18, 2024

Not being on Linux myself, I can only guess it is related to this: elm-lang/elm-repl#46.

If it is, that is if you find out that this solves your problem with elm-repl, can you please open an issue or pull request here in the elm-platform repo, so that this information is preserved for others (probably in the README somehow)?

from elm-platform.

jvoigtlaender avatar jvoigtlaender commented on May 18, 2024

After building hopefully works, maybe also look out for this: elm-lang/elm-repl#57.

from elm-platform.

dusky3 avatar dusky3 commented on May 18, 2024

I can only thank you again @jvoigtlaender. After installing libtinfo-dev, I was able to install the elm-repl. It works without --interpreter flag on Debian, I think that issue is only Ubuntu specific or was fixed already. I am just to make a pull request (I will add note to README).

from elm-platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.