Skip to content

Cabal freeze does not clobber cabal.config - #1629

Merged
tibbe merged 2 commits into
haskell:masterfrom
benarmston:cabal-freeze-does-not-clobber-cabal.config
Dec 31, 2013
Merged

tibbe merged 2 commits into
haskell:masterfrom
benarmston:cabal-freeze-does-not-clobber-cabal.config

Conversation

@benarmston

Copy link
Copy Markdown
Contributor

This PR has the freeze command update the cabal.config file without clobbering all of its content, as wanted in #1615.

There are some limitations in the final approach which has been taken: 1) any comments in the file are removed; 2) the ordering of the configuration items may be changed; and 3) an extraneous field install-dirs is included. The ordering of the configuration items is stable, but in the case that a user has manually added new fields they may be changed.

I've taken a number of different approaches to get this working. I think that the final approach I've settled on is close to the correct one, but I'd appreciate it if someone could take a look and comment, and provide a suggestion on how to remove install-dirs from the included fields.

@23Skidoo

Copy link
Copy Markdown
Member

Nice, thanks. I'll take a look when I get home.

@benarmston

Copy link
Copy Markdown
Contributor Author

Rebased to remove a couple of redundant commits as requested.

This requires `getPkgEnvDir` to be exported from `D.Client.Sandbox`.
@tibbe
tibbe merged commit 57bce8d into haskell:master Dec 31, 2013
@tibbe

tibbe commented Dec 31, 2013

Copy link
Copy Markdown
Contributor

Merged. Sorry about the delay.

@benarmston

Copy link
Copy Markdown
Contributor Author

Regarding the compilation failure, commit d8e1c31 moved getPkgEnvDir from a top-level function to a private function of loadConfigOrSandboxConfig and changed its type. I mention this as I wanted to understand why it was failing to compile for @23Skidoo but not for me or for Travis.

As this pull request remains closed but one of the commits on it has been reverted, I'm uncertain as to whether anything still needs to be done here. If so, let me know what and I'll see if I can find the time.

@23Skidoo

23Skidoo commented Jan 3, 2014

Copy link
Copy Markdown
Member

@benarmston As I said above, cabal.config is always loaded from the current directory, and not from the directory that cabal.sandbox.config resides in (the user can specify a different location for cabal.sandbox.config via the --sandbox-config-file option or the CABAL_SANDBOX_CONFIG environment variable). So IMO that commit was incorrect anyway.

@benarmston
benarmston deleted the cabal-freeze-does-not-clobber-cabal.config branch January 3, 2014 23:28
@mietek

mietek commented Dec 10, 2014

Copy link
Copy Markdown
Contributor

cabal.config is always loaded from the current directory, and not from the directory that cabal.sandbox.config resides in (the user can specify a different location for cabal.sandbox.config via the --sandbox-config-file option or the CABAL_SANDBOX_CONFIG environment variable).

While this describes what should happen, it does not describe what is happening, which is in fact, the opposite. See #1915 for details.

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.

4 participants