BLD: Use cygpath utility for path conversion in cyg2win32 #19547
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old function only handled the default
/cygdrive
prefix. Thiscan be customized to different values:
/
and/mnt
are both common./proc/cygdrive
does the same thing, regardless of user customization.The old function would also not convert absolute paths unless they were under
/cygdrive
,which wouldn't work unless Cygwin was installed in the root of its drive.
Installing Cygwin in the root of a drive is not recommended.
cygpath
handles all of these. There's also a C function if you'd prefer to avoid thefork()
call, which tends to be slow on Cygwin.I should note that this function seems to be called only when using the Absoft compilers, and only changes the path on Cygwin.
Path conversion like this is only useful when calling a Windows program from Cygwin. 64-bit Windows
long int
is 32 bits, 64-bit Cygwinlong int
is 64 bits, and I'm pretty sure Windows compilers expect to use the Windows C runtime library, while Cygwin native compilers expect to use Newlib with a few extra features. I remember CPython having warnings about using the wrong version of Visual Studio to compile extension modules on Windows, so I don't know that this would work even if everything's 32 bit.This function seems to have been added in 575d373 and not touched since.
Extracted from #18308.