-
Notifications
You must be signed in to change notification settings - Fork 718
Description
Currently, we have:
componentBuildDir :: LocalBuildInfo -> ComponentLocalBuildInfo -> FilePath
componentBuildDir lbi clbi =
buildDir lbi
</> case componentLocalName clbi of
CLibName LMainLibName ->
if prettyShow (componentUnitId clbi) == prettyShow (componentComponentId clbi)
then ""
else prettyShow (componentUnitId clbi)
CLibName (LSubLibName s) ->
if prettyShow (componentUnitId clbi) == prettyShow (componentComponentId clbi)
then unUnqualComponentName s
else prettyShow (componentUnitId clbi)
CFLibName s -> unUnqualComponentName s
CExeName s -> unUnqualComponentName s
CTestName s -> unUnqualComponentName s
CBenchName s -> unUnqualComponentName s
Ignoring the Backpack-related stuff about libraries, one issue here is that one can end up with the same build directory for a library and an executable of the same name. Instead, I would expect library build dirs to be given by buildDir lbi </> "lib" </> nm
and the executable build dirs to be buildDir lbi </> "exe" </> nm
.
This potential for clashes was the source of workarounds, e.g. using buildDir lbi </> nm </> nl ++ "-tmp"
to avoid the build path for a non-library clashing with the main library build path. I believe this workaround was introduced by commit 56bb1ba.
How feasible would such a change be? I imagine changing the structure of these buildDir
s could break assumptions people make about where build products are put, but I think it would be nicer if build products were always simply put in componentBuildDir
and that there are no additional workarounds piled on top involving -tmp
.