snapframework / snap

Top-level package for the official Snap Framework libraries, includes the snaplets API as well as infrastructure for sessions, auth, and templates.
http://snapframework.com/
BSD 3-Clause "New" or "Revised" License
455 stars 68 forks source link

Compilation issue (dependencies), GHC 8.0.1, Cabal 1.24 #170

Closed roper79 closed 8 years ago

roper79 commented 8 years ago

I tried to update the dependencies to compile with current versions, however, I ended with deadly messages and I do not know what to do now.

Apologies if this is some incompetence of mine.

msgs.txt snap.cabal.zip

mightybyte commented 8 years ago

Did you need to make any updates to snap-core, snap-server, heist, io-streams, or io-streams-haproxy? If not, try the following:

git clone https://github.com/snapframework/snap.git
cd snap
git submodule update --init --recursive
./init-sandbox.sh
cabal install
gspia commented 8 years ago

@Hi In issue #171, that is related, you can see, what version numbers will compile. It seems that there are four different cabal files that possibly would need minor changes (mainly the lines having bounds for time, lens, transformers, template-haskell and hint -packages). Also, if we would like to get the project templates to work, there are couple of other (about 5) changes to be done.

Somehow after the above changes there was no need for sandboxes. The compilation order was xmlhtml, io-streams, io-stream-haproxy, snap-core, snap-server, snap. And after those the loaders and snap-templates. And then 'snap init' gave a working server. If you make those log-directories too, then the server doesn't whine about "too bad situation".

(and the above with ghc 8.0.1 and cabal 1.24)

mightybyte commented 8 years ago

@perglr I've made the changes mentioned by @gspia. Can you try the set of commands I gave above and let me know if that works for you?

gspia commented 8 years ago

@perglr One note about the setup that worked easily. It was a fresh setup and install (I used a new user in a linux-box) and there was no other packages installed, except those that came with ghc 8.0.1 and cabal 1.24.

roper79 commented 8 years ago

rm -rf ~/.cabal ~/.ghc and then @mightybyte 's set of commands.

Resolving dependencies... cabal: Could not resolve dependencies: trying: snap-1.0.0.0 (user goal) trying: time-1.6.0.1/installed-1.6... (dependency of snap-1.0.0.0) next goal: snap-server (dependency of snap-1.0.0.0) rejecting: snap-server-1.0.0.0 (conflict: time==1.6.0.1/installed-1.6..., snap-server => time>=1.0 && <1.6) rejecting: snap-server-0.9.5.1, snap-server-0.9.5.0, snap-server-0.9.4.6, snap-server-0.9.4.5, snap-server-0.9.4.4, snap-server-0.9.4.3, snap-server-0.9.4.2, snap-server-0.9.4.1, snap-server-0.9.4.0, snap-server-0.9.3.4, snap-server-0.9.3.3, snap-server-0.9.3.1, snap-server-0.9.3, snap-server-0.9.2.4, snap-server-0.9.2.3, snap-server-0.9.2.2, snap-server-0.9.2.1, snap-server-0.9.2, snap-server-0.9.0, snap-server-0.8.1.1, snap-server-0.8.1, snap-server-0.8.0.1, snap-server-0.8.0, snap-server-0.7.0.1, snap-server-0.7, snap-server-0.6.0.1, snap-server-0.6.0, snap-server-0.5.5, snap-server-0.5.4, snap-server-0.5.3.1, snap-server-0.5.3, snap-server-0.5.2, snap-server-0.5.1.4, snap-server-0.5.1.3, snap-server-0.5.1.2, snap-server-0.5.1.1, snap-server-0.5.1, snap-server-0.5.0, snap-server-0.4.3, snap-server-0.4.2, snap-server-0.4.1, snap-server-0.4.0.2, snap-server-0.4.0.1, snap-server-0.4.0, snap-server-0.3.1.1, snap-server-0.3.1, snap-server-0.3.0, snap-server-0.2.16.2, snap-server-0.2.16.1, snap-server-0.2.16, snap-server-0.2.15.1, snap-server-0.2.15, snap-server-0.2.14.1, snap-server-0.2.14, snap-server-0.2.13.3, snap-server-0.2.13.2, snap-server-0.2.13.1, snap-server-0.2.13, snap-server-0.2.12, snap-server-0.2.11, snap-server-0.2.10.2, snap-server-0.2.10.1, snap-server-0.2.10, snap-server-0.2.9, snap-server-0.2.8.1, snap-server-0.2.8, snap-server-0.2.7.2, snap-server-0.2.7.1, snap-server-0.2.7, snap-server-0.2.6, snap-server-0.2.5, snap-server-0.2.4, snap-server-0.2.2, snap-server-0.2.1, snap-server-0.1.4, snap-server-0.1.3, snap-server-0.1.2, snap-server-0.1.1 (conflict: snap => snap-server>=1.0 && <1.1) Dependency tree exhaustively searched.

gspia commented 8 years ago

Hi It might be that the time-package is not the one that succeeded in the installation. Could you please check, what version you have?

➜ snap git:(master) ✗ ghc-pkg list | grep time time-1.6.0.1

And after that, could you please check, what your cabal says:

➜ snap git:(master) ✗ grep time snap.cabal -n 132: time >= 1.1 && < 1.7, 259: time,

After updating 1.6 to 1.7 (and with the other similar changes), this compiled. And since this is already updated to the sources, do you have the latest set? If the cabal-file shows old bounds on time-packages, you probably don't have the latest.

I hope this helps you!

roper79 commented 8 years ago

Thanks, @gspia, mine shows exactly the same results. I just wonder why I do not have the latest: I made a fresh git clone https://github.com/snapframework/snap.git...

For the reference, I did

rm -rf ~/.cabal ~/.ghc
git clone https://github.com/snapframework/snap.git
cd snap
git submodule update --init --recursive
./init-sandbox.sh
cabal install
gspia commented 8 years ago

I tried the instructions to git clone and build dependencies in a sand-box and it didn't work. It seems that on the git the dependencies point to wrong versions, e.g., snap/deps-directory has a dependency

snap-core @ b5ca1f0 If you follow that link and take a look of the version, it clearly shows old cabal-file etc. and you can also see that it is a tree and not a master branch. And other deps seems to have the same problem.

(Ok, it seems that it is time to try the 2nd fork-pull exercise... and what are the right git commands to change the deps from trees to masters?)

gspia commented 8 years ago

Luckily, git commands found quickly and the pull request #172 is on its way now. Here is the set of commands if you want to try it right away:

git pull && git submodule update --init --recursive git submodule foreach "(git checkout master; git pull --recurse-submodules)&" ./init-sandbox.sh cabal install

mightybyte commented 8 years ago

@perglr I just merge @gspia's pull request. Let me know if this fixes the issue.

roper79 commented 8 years ago

Now compiles perfectly, thank you both!