-
Notifications
You must be signed in to change notification settings - Fork 701
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
Task: Implement v2-install --bindir-method={copy,symlink}
#5837
Comments
Update: @fgaz's PRs (see #5870) have gone for using a new flag
|
For Windows, one could detect developer mode via the registry [1] or detect if the user has elevation rights [2] and on Windows Vista+, then symlinks would work, otherwise default to copy. This way you don't need to fail the operation to determine if it supports symlinks or not. One annoyance is that #4597 is still the case, so we'd store symlinks in a location that is being synched. I'm not sure if this will cause problems or not for network users. Perhaps we really should fix this for [1] https://stackoverflow.com/questions/41231586/how-to-detect-if-developer-mode-is-active-on-windows-10 |
I think it would be pretty weird to have two different windows defaults that are picked via some "smart" policy. Imho it would be less confusing to end users for windows to always default to copy. |
I disagree. The end-user doesn't and shouldn't care about which method is being used. copying is just simply slower. and it takes more space especially on a platform where we statically link binaries. I don't see why it should matter to the end-user as long as it works and works consistently. We shouldn't punish Windows users with an inferior approach. Also "copying" as it currently is implemented in Directory goes through the GHC I/O manager (another limitation that posix apis have but not Windows for when moving files to another physical disk), so we hit another much slower path. I personally think, users will be much more annoyed by having things be even slower. |
the
|
Sounds like something we should try to fix in 3.0.0.1. |
and what would be an eta on that? :-) (btw congrats on 3.0.0.0 !) |
2-3 weeks. |
I opened an MR changing the default on windows: #6506 |
There's at least two use-cases for having this code-path
v2-install
to copy executables instead of symlinking #5628)Currently, cabal already has support for two locations,
--bindir=DIR
--symlink-bindir=DIR
All that we need is the ability to configure which of those two locations to use; right now
v2-install
is hardwired to symlink and use--symlink-bindir
This task is about adding a new flag
--bindir-method=...
tov2-install
(whose default ought to be configurable via~/.cabal/config
) which takes takes an enumeration of at leastsymlink
, symlink into--symlink-bindir
location; operation fails if it cannot be symlinkedcopy
, copy into--bindir
location; operation fails if it cannot be copied to target locationOptional (i.e. not critical for 2.4; can be done later): additionally, we might want a 3rd variant (maybe called
auto
) which tries tosymlink
, but falls back tocopy
if symlink fails (relevant for Windows; see also PR #5684 which tried to hardcode this scheme)Finally, for the implied defaults (i.e. when there's no explicit default set via
~/.cabal/config
) forbindir-method:
we should havesymlink
copy
(or maybe theauto
method, once it's implemented; however sticking tocopy
as default might result in more deterministic results)Possible bikeshedding alternative:
--bindir-style
--bindir-policy
(c.f.--overwrite-policy
)The text was updated successfully, but these errors were encountered: