haskell / haskell/cabal

Obscure ar error ultimately from missing module header

Open
#5,868 1 comment 0 reactions 0 assignees View on GitHub
type: user-question
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

```
$ cabal new-build all
Build profile: -w ghc-8.6.3 -O1
In order, the following will be built (use -v for more details):
- foo-1 (lib) (first run)
Configuring library for foo-1..
Preprocessing library for foo-1..
Building library for foo-1..
[1 of 1] Compiling Main ( Foo.hs, /tmp/foo/dist-newstyle/build/x86_64-linux/ghc-8.6.3/foo-1/build/Main.o )
/usr/bin/ar: /tmp/foo/dist-newstyle/build/x86_64-linux/ghc-8.6.3/foo-1/build/Foo.o: No such file or directory
$ cat foo.cabal
cabal-version: 2.4
name: foo
version: 1

library
default-language: Haskell2010
exposed-modules: Foo
build-depends: base

$ cat Foo.hs
main = return ()
$ cabal --version
cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library
```

The user's problem here is that `Foo.hs` needs a `module Foo where` header, but it's not at all obvious how to figure that out from the `ar` error.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.