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
Restoring test on ident validity while browsing directory structure. #1054
Conversation
This commit apparently breaks the compilation of the standard library. Now, for the design question itself: I'm unsure that what is fixed here is the real problem that ought to be fixed (not saying though that I'm opposing to this PR which may be good in any case). Maybe we can consider indeed that users should only use To me, the real issue of BZ#5734 is that CoqIDE calls What would it cost to simply stop sending |
I am afraid I have not a clear picture of what direction we would like to move here :( I have been thinking about the What do other compilers do? Do they support "recursive" path binding? |
Actually, it should break almost everything. Indeed, at the time of 8.5, |
a9b02e5
to
12e5afe
Compare
The commit was multiply broken, and not only for what @silene is reporting. Hopefully ok now. |
It indeed looks a lot better. I don't think we are ever interested in iterating over filenames that cannot be mapped to Coq identifiers. So I suggest making |
@silene: it remains the case of OCaml files (option |
Then we don't have to worry about it; no need to overengineer it, in my opinion. Thinking a bit more about the code, we would still be doing too many syscalls in some degenerate cases. So the code could just look as follows; this would fully recover the time-complexity of Coq 8.5.
|
Even if more restricted than the one of Coq for module name, the OCaml syntax is more liberal for file name. I can call a file e.g. |
Is it possible to then load the plugin? (just curious)
Yes, at least when it comes to plugins. |
Yes:
Not unreasonable. Let's give us some time to ponder it. |
I'm fine with a restricted charset for plugin objects. |
I don't like that we rely on some file names to be outside of the allowed subset for identifiers in order not to crash. But this patch seems like a good emergency fix until we improve the design. So if that's ok with everyone, I can merge it and leave https://coq.inria.fr/bugs/show_bug.cgi?id=5734 open. |
I'm not sure I understand what you mean @maximedenes but yes, I think this PR can be merged and the bug report left open. I don't think that this |
What I meant is that IIUC, this patch does not really fix the underlying pb (browsing of potentially large subtrees of |
No patch can ever fix that. As long as |
Sure, but it still does some browsing that was not asked explicitly by the user, doesn't it? Or did I miss that it also removes the |
No, it does not remove it, but that is kind of orthogonal. For example, I did not quite follow what the issue with hangul characters was, but I would not be surprised if this commit had prevented it. |
The test was abandoned at the time of merging subdirectory browsing between coqdep and coqtop, and to limit at the same time the dependency of coqdep in files such as unicode.cmo. But checking ident validity speeds up browsing in arbitrary directory structure and we restore it for this reason. (One could also say that browsing arbitrary directory structures is not intended, but in practice this may happen, as e.g. reported in BZ#5734.)
I rebased (it now includes @silene's optimization). Two questions remain for future work:
|
12e5afe
to
7c36b13
Compare
The failures look unrelated so merging. |
… directory structure.
The test was abandoned at the time of merging subdirectory browsing between
coqdep
andcoqtop
, and to limit at the same time the dependency ofcoqdep
in files such asunicode.cmo
.But checking ident validity speeds up browsing in arbitrary non-Coq-specific directory structures and we restore it for this reason.
(One could also consider that browsing arbitrary directory structures is not intended, but in practice this may happen, as e.g. reported in BZ#5734.)
@letouzey, I know that you care about minimal dependencies for
coqdep
.Is it ok for you that we make
coqdep
aware of the exact (UTF-8) syntax of module names? Otherwise we can also consider that users are not supposed to doAdd LoadPath
on non-Coq related directory structure and that the regression in efficiency ofAdd LoadPath
between 8.5 and 8.6 is not a problem. Or, we can have different ocaml code to locate modules incoqdep
andcoqtop
(but with the risk of inconsistencies as we had).Note that the question is also about whether we want
coqdep
to be aware of the exact (UTF-8) syntax of library names (see commit e88dfed in PR#1041). (Though here, I could not understand if there were a global agreement on supporting arbitrary letters in library names, as we do for modules in general, rather than just ascii letters.)