grin-compiler / ghc-whole-program-compiler-project

GHC Whole Program Compiler and External STG IR tooling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mkfullpak: stglib not found

acertain opened this issue · comments

e.g.

mkfullpak: stglib not found: libHSprocess-1.6.8.2-ghc8.11.0.20210306.dyn_o_stglib
CallStack (from HasCallStack):
  error, called at lib/Stg/Program.hs:221:22 in external-stg-0.1.0.1-FouHBgE1u9NCkO980RRhCu:Stg.Program

from running mkfullpack _build/stage1/bin/runghc.dyn_o_ghc_stgapp

but I also get a similar

mkfullpak: stglib not found: libHSbase-4.14.0.0.o_stglib
CallStack (from HasCallStack):
  error, called at lib/Stg/Program.hs:221:22 in external-stg-0.1.0.1-FouHBgE1u9NCkO980RRhCu:Stg.Program

running mkfullpak Main.o_ghc_stgapp (where Main.lhs is self-contained).

The stglib files are in e.g. stage1/libraries/base/build/libHSbase-4.14.0.0.o_stglib, and aren't being copied into stage1/lib/x86_64-linux-ghc-8.11.0.20210306. But mkfullpak is only searching in stage1/lib/x86_64-linux-ghc-8.11.0.20210306

This bug was fixed. It works for me with the latest ghc-wpc and external-stg's mkfullpak.
Rebuild your ghc-wpc and install the latest mkfullpak form external-stg and try again.

This is with latest (a5646c16b5634bb8e3d568df4ebeb7fa194471e6) ghc-wpc and latest (6a26eca) ghc-whole-program-compiler-project.

is mkfullpak also the latest?

Yes

Could you please attach the _build/stage1/bin/runghc.dyn_o_ghc_stgapp file?

(added .txt extension to make github happy)
runghc.dyn_o_ghc_stgapp.txt

What is the content of these folders (recursively)? (*_stglib)

  • "/data/Code/ghc-whole-program-compiler-project/ghc-wpc/_build/stage1/lib/../lib/x86_64-linux-ghc-8.11.0.20210306"
  • "/nix/store/fphpbj8jpyibz0l2xspidg6s7zm7xyb5-gmp-6.2.0/lib"
  • "/nix/store/saghih5p46g1nm8vmvxc5vw5pfj1nc79-numactl-2.0.13/lib"

It is strange, it works on Ubuntu 16.04. Could this be a nix issue? (I mean surely I miss something in ghc-wpc)

/data/Code/ghc-whole-program-compiler-project/ghc-wpc/_build/stage1/lib/../lib/x86_64-linux-ghc-8.11.0.20210306
array-0.5.4.0
base-4.14.0.0
binary-0.8.7.0
bytestring-0.10.9.0
Cabal-3.2.0.0
containers-0.6.2.1
deepseq-1.4.4.0
directory-1.3.6.0
exceptions-0.10.4
filepath-1.4.2.1
ghc-boot-8.11.0.20210306
ghc-boot-th-8.11.0.20210306
ghc-compact-0.1.0.0
ghc-heap-8.11.0.20210306
ghci-8.11.0.20210306
ghc-prim-0.6.1
haskeline-0.8.0.1
hpc-0.6.1.0
integer-gmp-1.0.3.0
libffi.so
libffi.so.7
libffi.so.7.1.0
libHSarray-0.5.4.0-ghc8.11.0.20210306.so
libHSbase-4.14.0.0-ghc8.11.0.20210306.so
libHSbinary-0.8.7.0-ghc8.11.0.20210306.so
libHSbytestring-0.10.9.0-ghc8.11.0.20210306.so
libHSCabal-3.2.0.0-ghc8.11.0.20210306.so
libHScontainers-0.6.2.1-ghc8.11.0.20210306.so
libHSdeepseq-1.4.4.0-ghc8.11.0.20210306.so
libHSdirectory-1.3.6.0-ghc8.11.0.20210306.so
libHSexceptions-0.10.4-ghc8.11.0.20210306.so
libHSfilepath-1.4.2.1-ghc8.11.0.20210306.so
libHSghc-boot-8.11.0.20210306-ghc8.11.0.20210306.so
libHSghc-boot-th-8.11.0.20210306-ghc8.11.0.20210306.so
libHSghc-compact-0.1.0.0-ghc8.11.0.20210306.so
libHSghc-heap-8.11.0.20210306-ghc8.11.0.20210306.so
libHSghci-8.11.0.20210306-ghc8.11.0.20210306.so
libHSghc-prim-0.6.1-ghc8.11.0.20210306.so
libHShaskeline-0.8.0.1-ghc8.11.0.20210306.so
libHShpc-0.6.1.0-ghc8.11.0.20210306.so
libHSinteger-gmp-1.0.3.0-ghc8.11.0.20210306.so
libHSlibiserv-8.11.0.20210306-ghc8.11.0.20210306.so
libHSmtl-2.2.2-ghc8.11.0.20210306.so
libHSparsec-3.1.14.0-ghc8.11.0.20210306.so
libHSpretty-1.1.3.6-ghc8.11.0.20210306.so
libHSprocess-1.6.8.2-ghc8.11.0.20210306.so
libHSrts-1.0_debug-ghc8.11.0.20210306.so
libHSrts-1.0-ghc8.11.0.20210306.so
libHSrts-1.0_l-ghc8.11.0.20210306.so
libHSrts-1.0_thr_debug-ghc8.11.0.20210306.so
libHSrts-1.0_thr-ghc8.11.0.20210306.so
libHSrts-1.0_thr_l-ghc8.11.0.20210306.so
libHSrts_debug-ghc8.11.0.20210306.so
libHSrts-ghc8.11.0.20210306.so
libHSrts_l-ghc8.11.0.20210306.so
libHSrts_thr_debug-ghc8.11.0.20210306.so
libHSrts_thr-ghc8.11.0.20210306.so
libHSrts_thr_l-ghc8.11.0.20210306.so
libHSstm-2.5.0.0-ghc8.11.0.20210306.so
libHStemplate-haskell-2.17.0.0-ghc8.11.0.20210306.so
libHSterminfo-0.4.1.4-ghc8.11.0.20210306.so
libHStext-1.2.4.0-ghc8.11.0.20210306.so
libHStime-1.9.3-ghc8.11.0.20210306.so
libHStransformers-0.5.6.2-ghc8.11.0.20210306.so
libHSunix-2.7.2.2-ghc8.11.0.20210306.so
libHSxhtml-3000.2.2.1-ghc8.11.0.20210306.so
libiserv-8.11.0.20210306
mtl-2.2.2
parsec-3.1.14.0
pretty-1.1.3.6
process-1.6.8.2
rts-1.0
stm-2.5.0.0
template-haskell-2.17.0.0
terminfo-0.4.1.4
text-1.2.4.0
time-1.9.3
transformers-0.5.6.2
unix-2.7.2.2
xhtml-3000.2.2.1

/nix/store/fphpbj8jpyibz0l2xspidg6s7zm7xyb5-gmp-6.2.0/lib: libgmp.la libgmp.so libgmp.so.10 libgmp.so.10.4.0 libgmpxx.la libgmpxx.so libgmpxx.so.4 libgmpxx.so.4.6.0
/nix/store/saghih5p46g1nm8vmvxc5vw5pfj1nc79-numactl-2.0.13/lib: libnuma.la libnuma.so libnuma.so.1 libnuma.so.1.0.0 pkgconfig

I'm using hadrian-cabal with cabal 3.2.0.0, and ghc 8.10.2 to build ghc-wpc

I'm using hadrian-stack. That should be the issue!
The stglib files got installed on my machine correctly:

ls _build/stage1/lib/x86_64-linux-ghc-8.11.0.20210306/base-4.14.0.0/libHSbase-4.14.0.0*stglib
_build/stage1/lib/x86_64-linux-ghc-8.11.0.20210306/base-4.14.0.0/libHSbase-4.14.0.0-ghc8.11.0.20210306.dyn_o_stglib
_build/stage1/lib/x86_64-linux-ghc-8.11.0.20210306/base-4.14.0.0/libHSbase-4.14.0.0.o_stglib

use hadrian/build-stack

The cabal lib is also patched in ghc-wpc, and hadrian/build-stack uses the modified cabal lib.

Works, thanks!