Skip to content

Enable MOVEFILE_COPY_ALLOWED by default for renameFileInternal for Windows #189

Description

@jasagredo

Currently only MOVEFILE_REPLACE_EXISTING is enabled but I don't think there would be a downside to enable the mentioned flag. The documentation for that one says:

If the file is to be moved to a different volume, the function simulates the move by using the CopyFile and DeleteFile functions.

My motivation here is: I'm trying to make Cabal use the global temp directory for creating temp files instead of the final destination directory (as GetTempFileName doesn't support long paths, which is one of the few remaining uses of functions that can't use long paths in cabal) but the temp dir in GHA (and potentially in the user's system could be) is in C: and the working dir is in D:, so renaming paths fails because the mentioned flag is not set.

Similarly, if I override the temp dir to something in D: (like ${{ runner.temp }}) cabal can't copy files to the store which is then in C:.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions