Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autogen directory, build directory layout in general. #6702

Open
phadej opened this issue Apr 12, 2020 · 0 comments
Open

Autogen directory, build directory layout in general. #6702

phadej opened this issue Apr 12, 2020 · 0 comments

Comments

@phadej
Copy link
Collaborator

phadej commented Apr 12, 2020

Take a contrived example

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant