-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
lib: fixing slash to HOST_DIRSEP #3856
base: main
Are you sure you want to change the base?
Conversation
Fixes hardcoded slash to HOST_DIRSEP. Fixes OSGeo#3296
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't test right now, but looks good
Failures are weird, and Windows has way more, many tests exited right away, as instead of taking 50min, tests took 11 min. |
This ends up with mixed Line 183 in 60f6727
|
In 6749496 I have changed more occurrences of The search I used was:
|
Let us see the results of CI runners first. There are a number of hardcoded cases with |
Failures like this in the log, still mixed...:
|
I'm confused about the discussion here.
Portability is not an issue.
Are you saying that the mixing causes the error, forward slash, or are we simply trying to fix the inconsistency in the error message? |
Mixing may not be good, especially when scripting comes into play. |
We'd need to verify by manually doing a single fix and seeing if this one is fixed, but I think that it is only problematic from a Cygwin/msys2 point of there are both. But we need to see that the changes here remove some errors. |
That is unfortunately only valid for .NET API, perhaps https://superuser.com/a/176395 may throw some light into the issue at hand. I'm afraid that our code is full of hardcoded I'm not aware of current other issues than #3296 that reports this kind of problem, so it maybe a less invasive/ more immediate fix for This problem with mixed use of characters originates from the fact that libgis make an effort to use |
Apart from the cygpath tool, what other conversions does msys2 do? There's this docs https://www.msys2.org/docs/filesystem-paths/ They say that they convert automatically env vars, process arguments. Native tools would work with both if they don't process the path too much and forwards it the the system API, which is what Cygwin's POSIX API does (forwarding to the Windows API) |
*p = 0; | ||
} | ||
|
||
/* now append element, one directory at a time, to path */ | ||
while (1) { | ||
if (*element == '/' || *element == 0) { | ||
if (*element == HOST_DIRSEP || *element == 0) { | ||
*p = 0; | ||
char *msg = NULL; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhere in the lines below one more change is needed to avoid issues like this (see OSGeo4W CI run log):
+ v.in.ascii --o -z format=standard input=data/random_points.ref output=random_points
ERROR: Unable to make mapset element vector/random_points
(C:\Users\runneradmin\nc_spm_full_v2alpha2\__vector_v_what_rast3_test.v.what.rast3_fv_az845_621_4592\vector/random_points): No such file or directory
Changes hardcoded slash (
/
) in path to HOST_DIRSEP for portability.Fixes #3296