Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prompt overwrite policy #5672

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@fredefox
Copy link

fredefox commented Nov 8, 2018

When linking binaries into a globally accessible location on the machine --overwrite-policy=always is needed if an existing file sits where we are trying to create a link. This allows for a prompt-the-user strategy.


Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
    NA: Couldn't find any existing documentation about overwrite-policy.
  • If the change is docs-only, [ci skip] is used to avoid triggering the build bots.

How I tested the change:

I simply ran cabal new-install on cabal-install (after having installed cabal-install with my feature.

WIP

  • Testing on Windows. Help wanted
  • A way to globally configure --overwrite-policy=prompt as the default. This was my idea with the patch. I need a bit of help on how to achieve this though as I'm not familiar with the code-base.

haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 8, 2018

{"origin":"haskell/cabal/pull/5672",
"url":"pull/5672",
"account":"haskell",
"repo":"cabal",
"commit": "f459bb10c1e75c425bdb8acdce892d00a231aed5",
"tag":"linux-7.10.3"
}

haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 8, 2018

{"origin":"haskell/cabal/pull/5672",
"url":"pull/5672",
"account":"haskell",
"repo":"cabal",
"commit": "f459bb10c1e75c425bdb8acdce892d00a231aed5",
"tag":"linux-8.0.2"
}
@fgaz

This comment has been minimized.

Copy link
Collaborator

fgaz commented Nov 8, 2018

A way to globally configure --overwrite-policy=prompt as the default. This was my idea with the patch. I need a bit of help on how to achieve this though as I'm not familiar with the code-base.

See #5644. SavedConfig represents the ~/.cabal/config file, but right now NewInstallFlags isn't in there

haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 8, 2018

{"origin":"haskell/cabal/pull/5672",
"url":"pull/5672",
"account":"haskell",
"repo":"cabal",
"commit": "f459bb10c1e75c425bdb8acdce892d00a231aed5",
"tag":"linux-8.2.2"
}

haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 8, 2018

{"origin":"haskell/cabal/pull/5672",
"url":"pull/5672",
"account":"haskell",
"repo":"cabal",
"commit": "f459bb10c1e75c425bdb8acdce892d00a231aed5",
"tag":"linux-8.4.3"
}

haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 8, 2018

{"origin":"haskell/cabal/pull/5672",
"url":"pull/5672",
"account":"haskell",
"repo":"cabal",
"commit": "f459bb10c1e75c425bdb8acdce892d00a231aed5",
"tag":"linux-8.4.3-fdebug-expensive-assertions"
}

haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 8, 2018

{"origin":"haskell/cabal/pull/5672",
"url":"pull/5672",
"account":"haskell",
"repo":"cabal",
"commit": "f459bb10c1e75c425bdb8acdce892d00a231aed5",
"tag":"osx-8.0.2"
}

haskell-pushbot pushed a commit to haskell-pushbot/cabal-binaries that referenced this pull request Nov 8, 2018

{"origin":"haskell/cabal/pull/5672",
"url":"pull/5672",
"account":"haskell",
"repo":"cabal",
"commit": "f459bb10c1e75c425bdb8acdce892d00a231aed5",
"tag":"osx-7.10.3"
}
@23Skidoo

This comment has been minimized.

Copy link
Member

23Skidoo commented Nov 9, 2018

/cc @hvr

@hvr

This comment has been minimized.

Copy link
Member

hvr commented Nov 10, 2018

@23Skidoo I haven't yet looked at this in detail, but this is exactly the kind of overwrite policies I had in mind :-)

What I'm a bit unsure about though is how we can model interactivity into a future abstracted UI I/O layer (that thing for which the big "Cabal Monad" refactoring represents a pre-req) ... (but this isn't a blocker for this PR -- just something this reminds me of)

@fredefox fredefox force-pushed the fredefox:wip/prompt-overwrite-policy branch from f459bb1 to e61b60d Feb 3, 2019

@fredefox fredefox changed the base branch from 2.4 to master Feb 3, 2019

@fredefox

This comment has been minimized.

Copy link
Author

fredefox commented Feb 3, 2019

I've changed the PR to target master. I just cherry-picked the one commit I have made towards this.

@fgaz

This comment has been minimized.

Copy link
Collaborator

fgaz commented Mar 26, 2019

I added the new-install flags to SavedConfig with #5870 (not working yet due to a bug in how flags are handled: #5942)

There's a conflict now though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.