Ghc will not link for executable, creating .o and .hi only

I am a brand new user of opensuse Leap 15.4. I have distro hopped in the past and have also used Tumbleweed. I am looking for stability

This may be a ghc issue, but I thought I would post here also.

ghc will oftentimes not complete the linking process.

I installed the pattern devel_basis.

I installed stack using curl separately and ghcup

When I create a hello world Main.hs in my home directory, I can create the executable there with no problem.

When I create a new simple stack project in the home directory, I can use stack build/run with no problem. I can go into the src directory and use ghc Main.hs with no problem.

The problem occurs when I create the following directory structure in ~:

work/effective-haskell/Chapter1 and add Main.hs.

when I ghc Main from the Chapter1 directory, the source is compiled but not linked.

I did init a git file in work/effective-haskell and commited an initial commit.

If I create a new stack project in work/effective-haskell ie Chapter2, stack build/run both WORK fine and I can go into that src and ghc Main works fine there too.

I am mystified.

Posting this to #haskell #ghc groups also


First, welcome to the openSUSE Forums.

Question, have you installed the Leap 15.4 “cabal-install” package?