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
Specifying stack's --datadir= option in stack.yaml causes stack to write cabal's data-files to datadir during stack build. This breaks package manager GNU DESTDIR capability, as discussed in #848. Here is an example automated build that illustrates the problem.
In contrast, specifying datadir in the cabal file Paths_packagename.hs, causes stack to write cabal's data-files to the default .stack-work location during the build, and produce a binary with a correctly hardcoded path in PREFIX. This approach was described years ago by hlint's author @ndmitchell.
Here is the `stack.yaml' configuration that produces the issue:
Also noted for posterity: setting the environment variable packagename_datadir at runtime overrides the binary's hardcoded packagename_datadir path.
I believe that stack's behavior should be the same as setting datadir in Paths_packagename.hs, which would fix a longstanding problem of hardcoded paths of the build directory in stack binaries when cabaldata-files exist in packagename.cabal.
I believe that this
stack
behavior is a bug:Specifying
stack
's--datadir=
option instack.yaml
causesstack
to write cabal'sdata-files
todatadir
duringstack build
. This breaks package manager GNUDESTDIR
capability, as discussed in #848. Here is an example automated build that illustrates the problem.In contrast, specifying
datadir
in thecabal
filePaths_packagename.hs
, causesstack
to write cabal'sdata-files
to the default.stack-work
location during the build, and produce a binary with a correctly hardcoded path inPREFIX
. This approach was described years ago by hlint's author @ndmitchell.Here is the `stack.yaml' configuration that produces the issue:
Here is an automated
stack
build that solves the issue with related files:Also noted for posterity: setting the environment variable
packagename_datadir
at runtime overrides the binary's hardcodedpackagename_datadir
path.I believe that
stack
's behavior should be the same as settingdatadir
inPaths_packagename.hs
, which would fix a longstanding problem of hardcoded paths of the build directory instack
binaries whencabal
data-files
exist inpackagename.cabal
.This is related to:
--prefix
,--datadir
, etc haskell/cabal#3586stack build --prefix
option #848The text was updated successfully, but these errors were encountered: