You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cabal sdist concatenates names of conditional Main module names #9724
I tried the first package description, again, with cabal-install/HEAD:
$ cabal-head sdist
Ambiguous values for modulePath field: '"MainA.hs"' and '"MainB.hs"'
CallStack (from HasCallStack):
error, called at src/Distribution/Types/UnqualComponentName.hs:128:7 in Cabal-syntax-3.11.0.0-d54fadae152d752a73dcccd915a662b3b5c3d9fb8cb0cf56dac9da702763d64d:Distribution.Types.UnqualComponentName
Maybe the deeper problem is that PackageDescription can only store one Main-Is per executable.
I think the right thing is to make main-is a list rather than a single value, and then to enforce at build time (and check time) that the list is single-valued.
I think the right thing is to make main-is a list rather than a single value, and then to enforce at build time (and check time) that the list is single-valued.
Maybe PackageDescription is simply not the right structure to collect the files that should go into the tarball?
Maybe PackageDescription is simply not the right structure to collect the files that should go into the tarball?
Actually yeah, good point.
We currently have listPackageSourcesWithDie verbosity thisDie dir (flattenPackageDescription gpd) knownSuffixHandlers
We should arguably instead replace the call to flattenPackageDescription with something that directly recursively traverses the generic package description collecting files -- this will be slightly more efficient too!
Activity
amigalemming commentedon Feb 17, 2024
Maybe the deeper problem is that
PackageDescriptioncan only store oneMain-Isper executable.amigalemming commentedon Feb 17, 2024
I tried this work-around:
This lacks
src-b/Main.hsin the tarball. I can fix this withExtra-Source-Files, though.ffaf1 commentedon Feb 17, 2024
See #9659. Thanks for having provided a workaround.
Again a bug caused by
flattenPackageDescription.amigalemming commentedon Feb 17, 2024
This is how we ensured inclusion of all files before
Cabal-1.18or so, because at this timeCabalchose only one of each branches in anIf/Else-tree.amigalemming commentedon Feb 17, 2024
I tried the first package description, again, with cabal-install/HEAD:
gbaz commentedon Feb 17, 2024
I think the right thing is to make main-is a list rather than a single value, and then to enforce at build time (and check time) that the list is single-valued.
amigalemming commentedon Feb 17, 2024
Maybe
PackageDescriptionis simply not the right structure to collect the files that should go into the tarball?gbaz commentedon Feb 17, 2024
Actually yeah, good point.
We currently have
listPackageSourcesWithDie verbosity thisDie dir (flattenPackageDescription gpd) knownSuffixHandlersWe should arguably instead replace the call to
flattenPackageDescriptionwith something that directly recursively traverses the generic package description collecting files -- this will be slightly more efficient too!In particular we can
foldCondTreeover every condTree within the description: https://hackage.haskell.org/package/Cabal-syntax-3.10.2.0/docs/Distribution-Types-CondTree.html#v:foldCondTree(note that the "inclusive" and "exclusive" merges are passed in, so we can actually make them the same -- list append -- for both)