Repository navigation
BLD: Use cygpath utility for path conversion in cyg2win32 - #19547
Merged
Merged
Conversation
The old function only handled the default `/cygdrive` prefix. This can be customized to different values: `/` and `/mnt` are both common. `/proc/cygdrive` does the same thing, regardless of user customization. `cygpath` handles all of these. There's also a C function if you'd prefer to avoid the `fork()` call, which tends to be slow on Cygwin. Edit: Fix the cyg2win32 function to have correct types. It returned bytes earlier; this should return a string. Edit: Fix docsrting to follow numpydoc. BLD,DOC: Expand documentation for cyg2win32 Fix a misleading statement, and expand on the things `cygpath` handles that can otherwise be tricky to get right.
Member
|
Is falling back to the original path the best response to a failure? |
Contributor
Author
|
It's not worse than what's currently done. It will work for relative paths. I don't remember how much of what gets passed to the compilers is relative vs. absolute paths. The So, the options I can think of:
I suspect anyone who knows enough to be able to convince a Cygwin python to use Absoft compilers for NumPy will understand the |
The only reasons I can think for this to fail are an incomplete installation or an environment hostile to fork(), both of which should probably be fixed before trying to compile NumPy.
Member
|
Lets give it a shot. Thanks @DWesl . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
/cygdriveprefix. Thiscan be customized to different values:
/and/mntare both common./proc/cygdrivedoes 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.
cygpathhandles 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 intis 32 bits, 64-bit Cygwinlong intis 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.