GaloisInc / HaLVM

The Haskell Lightweight Virtual Machine (HaLVM): GHC running on Xen
BSD 3-Clause "New" or "Revised" License
1.05k stars 88 forks source link

[dev-build] Use stack to manage the stage0 compiler etc. #88

Closed izgzhen closed 7 years ago

izgzhen commented 7 years ago

This is mentioned in #83 before, and since wip-halvm3-base doesn't have a proper Makefile to do this, so I tried a bit: https://gist.github.com/izgzhen/cea9e2d2770bd32e497c7cb2cd37ef1e

I think the advantages would be more readable Makefile, and the tarballs caching provided by stack.

Currently, I added two entries to PATH to track the binaries built by stack, but I think we can improve it .... let $(GHC) be stack exec ghc etc. in configure?

izgzhen commented 7 years ago

I met such errors during the stage2 build:

/usr/bin/find: ‘libraries/ghc-prim/dist-install/build/GHC/CString_o_split’: No such file or directory
/usr/bin/find: ‘libraries/ghc-prim/dist-install/build/GHC/Classes_o_split’: No such file or directory
/usr/bin/find: ‘libraries/ghc-prim/dist-install/build/GHC/Debug_o_split’: No such file or directory
/usr/bin/find: ‘libraries/ghc-prim/dist-install/build/GHC/IntWord64_o_split’: No such file or directory
/usr/bin/find: ‘libraries/ghc-prim/dist-install/build/GHC/Magic_o_split’: No such file or directory
/usr/bin/find: ‘libraries/ghc-prim/dist-install/build/GHC/Tuple_o_split’: No such file or directory
/usr/bin/find: ‘libraries/ghc-prim/dist-install/build/GHC/Types_o_split’: No such file or directory

@acw Any ideas?

izgzhen commented 7 years ago

I don't know if there is something wrong with stage1 compiler, it just doesn't split the objects (I found some threads saying that LLVM backends have the same problems too ...). So I turned off the SplitObjs and built the stage 2 compiler.

However, I just built it for validating that split-objs problem, since in https://github.com/GaloisInc/HaLVM/wiki/What-is-the-Difference-Between-GHC-and-the-HaLVM%3F:

Because we're cross-compiling to Xen, building a Stage 2 compiler doesn't make all that much sense. Just ... think about it.)

So I guess it is not that useful.

acw commented 7 years ago

Er, many apologies that I didn't see this earlier.

Let's just say I'm not a real big fan of stack, and I'm not hugely thrilled with the idea of building it into the HaLVM build process unless there is a really good reason. I would much rather solve the stage-0 compiler problem by writing configure scripts that require the correct versions of all the required software to be installed by the developer before starting, actually. This seems like a better ticket. In fact: #94.