fpco / stackage-view

MIT License
21 stars 10 forks source link

Can't build using stack on OS X #12

Open jwhitley opened 9 years ago

jwhitley commented 9 years ago

[N.B.: this is quite possibly also relevant to commercialhaskell/stack than stackage-view, but I'm starting the discussion here.]

Repro steps

  1. On an OS X box, install stack and clone this repo.
  2. cd path/to/stackage-view
  3. stack build

Actual results

>> stack build
Cannot find 'docker' in PATH.  Is Docker installed?

Expected results

stackage-view builds natively, so it can be invoked in a Cabal project directory.

Notes

The stack.yml file includes the stanza:

docker:
  repo: fpco/ghcjs-dev

This means that what should be a straightforward local build of this tool now must be built inside of a docker instance. This makes for a positively bizarre workflow, since the primary usage of this tool appears to be on a development host.

I fully understand the benefits of fully reproducible builds using docker (and VMs in general). Yet those benefits don't appear to apply to stackage-view because it's a client tool, not a server tool.

jwhitley commented 9 years ago

Ah ha! From this comment by @snoyberg it's now clear that the current stack.yaml setup is to satisfy this build's dependency on GHCJS, thus the repo: ghcjs-dev docker image.

The error reporting observed below is rather obscure for a missing CLI dependency:

[13 of 17] Compiling Import           ( server/Import.hs, .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/Import.o )
[14 of 17] Compiling Handler.Home     ( server/Handler/Home.hs, .stack-work/dist/x86_64-osx/Cabal-1.18.1.5/build/Handler/Home.o )
ghcjs app/Client.hs -outputdir dist/ghcjs -o /var/folders/x6/bd5b_zh50cg2fp5jzzv30zn80000gn/T/run-ghcjs.51318 -i -iclient -ishared -iclient -ishared -XCPP -XTemplateHaskell -hide-all-packages -package aeson -package attoparsec -package base -package containers -package data-default -package ghcjs-base -package ghcjs-dom -package ghcjs-jquery -package ghcjs-react -package lens -package mtl -package stm -package text

server/Handler/Home.hs:17:5:
    Exception when trying to run compile-time code:
      The GHCJS process failed with exit code 127.
    Code: ghcjsFileDev
            development
            ((++)
               ["-iclient", "-ishared", "-XCPP", ....]
               concatMap
                 (\ pkg -> ["-package", pkg]) ["aeson", "attoparsec", "base", ....])
            ["client", "shared"]
            "app/Client.hs"
    In the splice:
      $(ghcjsFileDev
          development
          (["-iclient", "-ishared", "-XCPP", ....]
           ++
             concatMap
               (\ pkg -> ["-package", pkg]) ["aeson", "attoparsec", "base", ....])
          ["client", "shared"]
          "app/Client.hs")
Completed all 180 actions.
nrolland commented 9 years ago

@jwhitley could you build it finally ? I switched to the 3.XX listed her https://hub.docker.com/r/fpco/stack-ghcjs-build/tags/ to no avail (some permission in .profile popping up when stack build-ing ). retrying my luck with 2.16 (10Go... !)

nrolland commented 9 years ago
$ stack build                                                                                                                                                      not sandboxed
tar: ./.profile: Cannot open: Permission denied
tar: ./.bashrc: Cannot open: Permission denied
tar: ./.bash_logout: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors

with 2.16 as well. that's annoying. no idea where this come from..

Edit : same as here apparently https://github.com/commercialhaskell/stack/issues/488

nrolland commented 9 years ago

cabal build as of now does not succeed either : I give up. that's my haskell experience when not using Nix or Stack. can't wait for the dev tooling to improve