haskell / haskell/cabal

Autogen directory, build directory layout in general.

Open
#6,702 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Take a contrived example

```cabal
cabal-version: 2.2
name: autogen
version: 0.1.0.0

library
default-language: Haskell2010
hs-source-dirs: src
build-depends: base >=4.12 && <4.13

exposed-modules: Autogen.Paths_autogen
exposed-modules: Paths_autogen
```

with `src/Autogen/Paths_autogen.hs` as e.g.

```haskell
module Autogen.Paths_autogen where

version :: String
version = "Hello"
```

On Linux the package will compile fine, but...

`find dist-newstyle` shows

```
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/autogen
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/autogen/Paths_autogen.hs
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/autogen/cabal_macros.h
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/Paths_autogen.dyn_hi
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/Paths_autogen.o
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/libHSautogen-0.1.0.0-inplace-ghc8.6.5.so
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/Paths_autogen.dyn_o
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/Autogen
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/Autogen/Paths_autogen.dyn_hi
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/Autogen/Paths_autogen.o
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/Autogen/Paths_autogen.dyn_o
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/Autogen/Paths_autogen.hi
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/Paths_autogen.hi
dist-newstyle/build/x86_64-linux/ghc-8.6.5/autogen-0.1.0.0/build/libHSautogen-0.1.0.0-inplace.a
```

I don't think that `autogen` and `Autogen` would cause problems on case-insensitive filesystem & platforms (e.g. Windows, macOS), but I don't like the lack of hygiene anyway.

Maybe this would be easier to refactor after #6667 is started.

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.