-
Notifications
You must be signed in to change notification settings - Fork 642
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
[cmdline] use / in -print-mod-uid as dir separator on windows #13861
Conversation
To be extra safe, you might want to check for files starting with \. This is fairly rare in Windows, one typically either uses relative paths or has a drive letter as well. |
let fix_windows_dirsep s = | ||
if Sys.win32 then Str.(global_replace (regexp_string "\\") "/" s) | ||
else s | ||
|
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.
Umm, the below code is already using Filename.concat
which should do the right thing on Win32, so this seems wrong. Looking at the original bug, the problem seems to be in the Makefiles that mess with quoting, so it seems to me that the problem should be handled there.
In fact, this whole operation get_native_name
seems to be ultra-costly, as it loads the whole summary, etc... the name of the native file can be easily computed without calling Coq [this is what we do in Dune] and indeed it seems like a better approach to me.
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.
In fact, this whole operation
get_native_name
seems to be ultra-costly, as it loads the whole summary, etc... the name of the native file can be easily computed without calling Coq [this is what we do in Dune] and indeed it seems like a better approach to me.
Are you saying that you coded, in dune, the whole -R
and -Q
resolution strategy?
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.
No, dune already knows about these flags natively, so the operation of producing the name for native is quite easy:
Indeed having a bit more information about library resolution would be very interesting as it would solve the current problem of having to generate all source files before calling coqdep, but that's offtopic here.
As far as I can see the bug is a bug in the Makefiles, that are quoting incorrectly somewhere, so IMO it should be solved there, not in Coq which is doing the right thing. [If filename.concat is buggy upstream that's a different story, but then we should provide our own, not hack ad-hoc here]
Well, |
Out of inspiration I replaced |
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.
It seems that the problem here is that the makefiles are incorrect w.r.t. quoting, so instead of this hack we should fix the makefiles instead to preserve the \
.
The problem is not that thing work when |
This pull request is a one-liner. Either we apply it or we close it. Keeping it as a draft forever is just a waste of time. |
In https://github.com/coq/coq/wiki/Coq-Call-2021-11-10 we said we would go with this solution |
@SkySkimmer don't you want to assign and merge this one? It has been lingering quite a bit. |
Since we collectively agreed on merging this I don't see any point in keeping this around. Let's fire and forget. |
@coqbot merge now |
@ppedrot: You can't merge the PR because some changes are requested. |
@coqbot merge now |
@MSoegtropIMC I've opted for the most conservative solution, I've flipped \ for / only in this option
Fix #13827