Skip to content
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

coqdep spuriously warns about multiple files with the same name #11631

Closed
whonore opened this issue Feb 19, 2020 · 5 comments · Fixed by #14718
Closed

coqdep spuriously warns about multiple files with the same name #11631

whonore opened this issue Feb 19, 2020 · 5 comments · Fixed by #14718
Labels
part: build The build system. part: coqdep The coqdep binary for resolving dependencies amongst coq .v files.
Milestone

Comments

@whonore
Copy link
Contributor

whonore commented Feb 19, 2020

Description of the problem

Given a B.v with From dir.a Require Import A., and the directory structure:

dir/
    a/
        A.v
    b/
        A.v
    B.v

Running coqdep -R . dir B.v prints:

B.vo B.glob B.v.beautified B.required_vo: B.v a/A.vo
B.vio: B.v a/A.vio
*** Warning: in file B.v, 
    required library A matches several files in path
    (found A.v in a and b; used the latter)

So it seems to choose the correct A.v despite the warning. The warning goes away if the line is changed to Require Import dir.a.A. or if -Q is used instead of -R.

Coq Version

master and at least back to 8.10.

@ejgallego ejgallego added part: build The build system. part: coqdep The coqdep binary for resolving dependencies amongst coq .v files. labels Feb 19, 2020
@ejgallego
Copy link
Member

Indeed this is a bug; we hope to address that once we do the loadpath cleanup after the Dune switch.

On the other hand -R the current semantics of -R seems like a bit dangerous sometimes so it is possible we modify it.

@maximedenes
Copy link
Member

I'd need this fixed for stdlib2. @ppedrot it seems that the logic in 31c7542 w.r.t. to this warning is strange: you warn before searching with the From clause. Would you mind having a look?

@ppedrot
Copy link
Member

ppedrot commented Mar 6, 2020

Indeed, the logic looks wrong. I don't remember this code very well though, I wouldn't mind somebody else writing the fix though :/

@Blaisorblade
Copy link
Contributor

FWIW I get the same warnings while using -Q — it might be because I write From A Require Import B to import A.foo.B.
But the Import is still perfectly well-defined...

@Blaisorblade
Copy link
Contributor

As explained in #12251 but not here,

Moreover, coqdep claims that it's choosing the incorrect version of [dependencies, but in fact is choosing the correct version].

Blaisorblade added a commit to Blaisorblade/dot-iris that referenced this issue May 31, 2020
Blaisorblade added a commit to Blaisorblade/dot-iris that referenced this issue May 31, 2020
herbelin added a commit to herbelin/github-coq that referenced this issue Jul 29, 2021
…ut clashes.

This is a quick fix:
- without From, we rely on the clash table to know the clashes
- with From, we recompute the clash on the fly

Probably a tree should be used to treat From faster.
herbelin added a commit to herbelin/github-coq that referenced this issue Jul 29, 2021
…ut clashes.

This is a quick fix:
- without From, we rely on the clash table to know the clashes
- with From, we recompute the clash on the fly

Probably a tree should be used to treat From faster.
herbelin added a commit to herbelin/github-coq that referenced this issue Aug 1, 2021
…ut clashes.

This is a quick fix:
- without From, we rely on the clash table to know the clashes
- with From, we recompute the clash on the fly

Probably a tree should be used to treat From faster.
herbelin added a commit to herbelin/github-coq that referenced this issue Aug 3, 2021
…ut clashes.

This is a quick fix:
- without From, we rely on the clash table to know the clashes
- with From, we recompute the clash on the fly

Probably a tree should be used to treat From faster.
herbelin added a commit to herbelin/github-coq that referenced this issue Aug 18, 2021
…ut clashes.

This is a quick fix:
- without From, we rely on the clash table to know the clashes
- with From, we recompute the clash on the fly

Probably a tree should be used to treat From faster.
herbelin added a commit to herbelin/github-coq that referenced this issue Aug 31, 2021
…ut clashes.

This is a quick fix:
- without From, we rely on the clash table to know the clashes
- with From, we recompute the clash on the fly

Probably a tree should be used to treat From faster.
herbelin added a commit to herbelin/github-coq that referenced this issue Aug 31, 2021
…ut clashes.

This is a quick fix:
- without From, we rely on the clash table to know the clashes
- with From, we recompute the clash on the fly

Probably a tree should be used to treat From faster.
herbelin added a commit to herbelin/github-coq that referenced this issue Sep 5, 2021
- It stops relaying on the order of hash table keys to find an
  appropriate From path, building instead a direct map of each
  "From dirpath Require dirpath'" to a full physical path.
- Incidentally, it takes From into account to warn about clashes
  - This fixes coq#11631 (initial report)
  - This fixes coq#14539
herbelin added a commit to herbelin/github-coq that referenced this issue Sep 5, 2021
- It stops relaying on the order of hash table keys to find an
  appropriate From path, building instead a direct map of each
  "From dirpath Require dirpath'" to a full physical path.
- Incidentally, it takes From into account to warn about clashes
  - This fixes coq#11631 (initial report)
  - This fixes coq#14539
herbelin added a commit to herbelin/github-coq that referenced this issue Sep 12, 2021
- It stops relaying on the order of hash table keys to find an
  appropriate From path, building instead a direct map of each
  "From dirpath Require dirpath'" to a full physical path.
- Incidentally, it takes From into account to warn about clashes
  - This fixes coq#11631 (initial report)
  - This fixes coq#14539
herbelin added a commit to herbelin/github-coq that referenced this issue Oct 6, 2021
- It stops relaying on the order of hash table keys to find an
  appropriate From path, building instead a direct map of each
  "From dirpath Require dirpath'" to a full physical path.
- Incidentally, it takes From into account to warn about clashes
  - This fixes coq#11631 (initial report)
  - This fixes coq#14539
herbelin added a commit to herbelin/github-coq that referenced this issue Oct 19, 2021
- It stops relaying on the order of hash table keys to find an
  appropriate From path, building instead a direct map of each
  "From dirpath Require dirpath'" to a full physical path.
- Incidentally, it takes From into account to warn about clashes
  - This fixes coq#11631 (initial report)
  - This fixes coq#14539
herbelin added a commit to herbelin/github-coq that referenced this issue Oct 20, 2021
- It stops relaying on the order of hash table keys to find an
  appropriate From path, building instead a direct map of each
  "From dirpath Require dirpath'" to a full physical path.
- Incidentally, it takes From into account to warn about clashes
  - This fixes coq#11631 (initial report)
  - This fixes coq#14539
herbelin added a commit to herbelin/github-coq that referenced this issue Oct 20, 2021
…4539.

Co-authored-by: Ali Caglayan <alizter@gmail.com>
Co-authored-by: Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>
herbelin added a commit to herbelin/github-coq that referenced this issue Oct 24, 2021
- It stops relaying on the order of hash table keys to find an
  appropriate From path, building instead a direct map of each
  "From dirpath Require dirpath'" to a full physical path.
- Incidentally, it takes From into account to warn about clashes
  - This fixes coq#11631 (initial report)
  - This fixes coq#14539
herbelin added a commit to herbelin/github-coq that referenced this issue Oct 24, 2021
…4539.

Co-authored-by: Ali Caglayan <alizter@gmail.com>
Co-authored-by: Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>
coqbot-app bot added a commit that referenced this issue Oct 26, 2021
… + new unifying semantics of coqdep and coqc

Reviewed-by: ejgallego
Reviewed-by: Zimmi48
Reviewed-by: jfehrle
Reviewed-by: Alizter
Reviewed-by: SkySkimmer
Co-authored-by: Alizter <Alizter@users.noreply.github.com>
@Zimmi48 Zimmi48 added this to the 8.15+rc1 milestone Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part: build The build system. part: coqdep The coqdep binary for resolving dependencies amongst coq .v files.
Projects
None yet
6 participants