Closed evan0greenup closed 6 months ago
Hpack added --force
in Hpack 0.20.0 (16 November 2017) because the original behaviour was to overwrite Cabal files and some Stack users found that confusing:
However, it seems to me reasonable to have a Stack flag --[no-]hpack-force
(configuration option hpack-force: true
) that enables --force
(disabled by default).
@evan0greenup, if you are not using GHCup to manage versions of Stack, the above feature can be tested in stack upgrade --source-only --git --git-branch fix6521
.
It can be used at the command line with stack --hpack-force <command>
but the primary intention is that Stack would be configured in YAML files with hpack-force: true
. I have kept the default as hpack-force: false
, given the history discussed above.
Make sure that you are using the latest release (currently Stack 2.15.3). See the upgrade instructions to upgrade.
If there is
<package_name>.cabal
existed in the root directory of package,stack
will automatically ignorepackage.yaml
. when build, stack will convertpackage.yaml
into<package_name>.cabal
viahpack
.When update
package.yaml
, the developer has to manually delete<project_name>.cabal
. This is very inconvenient. It would be nice to make the generated cabal file as<project_name>.generated.cabal
. So if there is only<project_name>.generated.cabal
,stack
will automatically overwrite<project_name>.generated.cabal
frompackage.yaml
.This feature can make developer completely forget about the cabal stuff, if he/her workflow is completely depend on
stack
.