-
Notifications
You must be signed in to change notification settings - Fork 631
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
Accept \ in Windows pathnames in coq_project args #15775
Conversation
1032583
to
8532a47
Compare
lib/coqProject_file.ml
Outdated
@@ -151,7 +151,8 @@ let check_filename f = | |||
let a = ref None in | |||
let check_char c = | |||
match c with | |||
| '\n' | '\r' | '\t' | '\\' | '\'' | '"' | ' ' | '#' | '$' | '%' -> a := Some c | |||
| '\\' | '$' when Sys.os_type = "Unix" -> a := Some c |
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.
What happens on macos?
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 took out $
for now, that likely won't come up too much on Windows. Very hard to test this because the dune build doesn't have a coq_makefile-prelude and building a modified version for Windows is a project (I rarely do this anymore). If it's not a fix, it is at least a step in the right direction.
8532a47
to
e46913f
Compare
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.
Since the Makefile generated by coq_makefile
assumes that filenames do not contain any backslash, it does not seem to be a good idea to allow them inside _CoqProject
.
Shouldn't it be recommended to have |
The _CoqProject contains no backslashes:
When I try to open I expect this is because As I said, I think this is a step forwards and may be a fix, but I'm not going to do any more work on this now. |
I see, then, it is maybe enough that the |
e46913f
to
28df91b
Compare
Indeed, that just occurred to me. I updated the PR to do just that. |
This is not quite correct. Function |
@silene Yeah, the routine won't make the path absolute unless the argument is absolute, but I expect it always converts |
Will merge soon. |
@coqbot: merge now |
Good catch! Thanks for mentioning me. |
| f :: r -> | ||
let abs_f = CUnix.correct_path f orig_dir in |
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.
@Columbus240 Notice that I renamed the original f'
to f
, so the check_filename f
behaves differently. Right?
If I'm not badly mistaken
Questions from others, even if mistaken, can be quite helpful. So no need to apologize with "badly". I usually make several mistakes before breakfast each day.
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.
Both before and after the change, the code does the following (if I interpret it correctly): Take the first element of the list, and apply CUnix.correct_path _ orig_dir
to it. Before the change, the first element of the list was called f'
and the result was stored in f
, after the change the first element of the list is called f
and the result is stored in abs_f
.
So I don’t see the functional change, because the renaming was done consistently.
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 find abs_f
is a slightly more evocative name, making the meaning of this variable a little more clear. So I have nothing against renaming.
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.
So I don’t see the functional change, because the renaming was done consistently.
not quite, see eg line 259 (before PR) https://github.com/coq/coq/pull/15775/files#diff-13482a4486eee3b60cca52baee0cf046a6d89d7d009e314364bce73ee4377effL259
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.
Ooh, that makes sense. Thanks for the explanation.
Fix regression from #14558. See here.
FYI: @Columbus240