Skip to content

Duplicate component name in build path. #10965

Open
@angerman

Description

@angerman

Ref.: #4548 When building sublibraries with cabal today, you end up with build paths like:

$pkg/l/$comp/build/$comp/

note the duplicate $lib in there.

Tracking this down, leads us to two commits by @ezyang almost a decade ago.

on Mar 30, 2016 8e3c2d7
introduced the componentBuildDir which added the $comp as a suffix to the $buildDir.

$pkg/l/$comp/build/$comp/
                   ^^^^^

(this is lib:Cabal).

on Aug 21, 2016 d9bf678
Changed the

distBuildRootDirectory </> display pkgid

to also include a c/$comp suffix. This was later modified by @hvr to have distinct single letter names for different components. E.g. l for library.

$pkg/l/$comp/build/$comp/
     ^^^^^^^

(this is cabal-install).

Thus we now have $comp redundantly twice in the path. Also the buildPath we pass to runConfigureScript (in ConfigureScript.hs), via ConfigFlags:CommonSetupFlags:setupDistPref is $pkg/l/$comp/build.

It seems to me we've basically changed the component build path twice; while we only need to change it once to make it unique per component. As such I'm proposing to conceptually revert the componentBuildDir change from 8e3c2d7. And leave $pkg/l/$comp/build to be the build directory. This will also transparently make build-type: Configure work for components. We already run the configure script in the $pkg/l/$comp folder per component.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions