Skip to content

Fix #6915 config set recreates global-project directory, when required#6916

Merged
mpilgrem merged 2 commits into
masterfrom
fix6915
May 26, 2026
Merged

Fix #6915 config set recreates global-project directory, when required#6916
mpilgrem merged 2 commits into
masterfrom
fix6915

Conversation

@mpilgrem
Copy link
Copy Markdown
Member

See:

Please also shortly describe how you tested your change. Bonus points for added tests!

@mpilgrem
Copy link
Copy Markdown
Member Author

Currently, the recreation of the global-project directory happens in the first part of Stack.Config.withBuildConfig. The final part does other things, which are not of interest to Stack's config set command.

The first part also outputs a user message, if one is specified in the project-level configuration file. I think Stack's config set command would want to skip that.

This pull request:

  • separates the first part of withBuildConfig as:

    withConfigExtra ::
         forall a env. (HasConfig env, HasTerm env)
      => Bool
         -- ^ Report user message in the project-level configuration file, if
         -- a user message is present?
      -> (ConfigExtra -> RIO env a)
      -> RIO env a
  • introduces the new type ConfigExtra for the information provided by the first part of withBuildConfig used by the remaining part;

  • makes use of withConfigExtra in Stack.ConfigCmd.cfgCmdSet;

  • adds an integration test for the bug fix 6915-config-set-outside-project.

@mpilgrem mpilgrem changed the title Fix #6915 config set recreates global-package directory, when required Fix #6915 config set recreates global-project directory, when required May 26, 2026
@mpilgrem mpilgrem merged commit 01f8403 into master May 26, 2026
13 checks passed
@mpilgrem mpilgrem deleted the fix6915 branch May 26, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant