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

vscoq passes incorrect -topfile argument #55

Open
Blaisorblade opened this issue Feb 21, 2022 · 0 comments
Open

vscoq passes incorrect -topfile argument #55

Blaisorblade opened this issue Feb 21, 2022 · 0 comments
Assignees

Comments

@Blaisorblade
Copy link
Collaborator

Blaisorblade commented Feb 21, 2022

vscoq uses -topfile file:///path or -topfile untitled:/path, but Coq demands a path (relative or absolute, doesn't matter); that path is compared against the -Q/-R options to compute the correct name of the module being created.

For instance, assume _CoqProject consists of -Q theories D, and test_topfile.v is the following:

Definition hello := Prop.
About hello.
Check D.test_topfile.hello.

This code (based on the testcase in ProofGeneral/PG#407 (comment)) compiles fine and works in coqtop with the correct options, but VSCoq fails to step through it.

Example incorrect command lines that VSCoq uses:

exec: /Users/pgiarrusso1/.opam/__coq-platform.2021.11.0~8.14~2021.11/bin/coqidetop.opt -main-channel 127.0.0.1:58104:58105 -control-channel 127.0.0.1:58106:58107 -async-proofs on -Q theories D -w -notation-overridden -w -redundant-canonical-projection -w -convert_concl_no_check -w -undeclared-scope -w -ambiguous-paths -w -deprecated-hint-rewrite-without-locality -w -deprecated-instance-without-locality -w -deprecated-typeclasses-transparency-without-locality -topfile untitled:/Users/pgiarrusso1/git/gDOT/dot-iris-make/theories/test_topfile.v
exec: /Users/pgiarrusso1/.opam/__coq-platform.2021.11.0~8.14~2021.11/bin/coqidetop.opt -main-channel 127.0.0.1:58158:58155 -control-channel 127.0.0.1:58156:58157 -async-proofs on -Q theories D -w -notation-overridden -w -redundant-canonical-projection -w -convert_concl_no_check -w -undeclared-scope -w -ambiguous-paths -w -deprecated-hint-rewrite-without-locality -w -deprecated-instance-without-locality -w -deprecated-typeclasses-transparency-without-locality -topfile file:///Users/pgiarrusso1/git/gDOT/dot-iris-make/theories/test_topfile.v

Suggested fix

Strip file:// or untitled: from the URL to get the raw path. This works even for unsaved files: we just need the path where the code would live if saved. EDIT: I'm not sure what I had in mind.

Blaisorblade referenced this issue in Blaisorblade/vscoq Feb 10, 2023
This also allows stepping through unsaved files; before this patch, we passed
`-topfile untitled:Untitled-1`, which failed with:

```
coqtop-stderr: Error: Invalid character ':' in identifier "untitled:Untitled-1".
```
Blaisorblade referenced this issue in Blaisorblade/vscoq Feb 10, 2023
This also allows stepping through unsaved files; before this patch, we passed
`-topfile untitled:Untitled-1`, which failed with:

```
coqtop-stderr: Error: Invalid character ':' in identifier "untitled:Untitled-1".
```
Blaisorblade referenced this issue in Blaisorblade/vscoq Feb 11, 2023
This also allows stepping through unsaved files; before this patch, we passed
`-topfile untitled:Untitled-1`, which failed with:

```
coqtop-stderr: Error: Invalid character ':' in identifier "untitled:Untitled-1".
```
Blaisorblade referenced this issue in Blaisorblade/vscoq Apr 11, 2023
This also allows stepping through unsaved files; before this patch, we passed
`-topfile untitled:Untitled-1`, which failed with:

```
coqtop-stderr: Error: Invalid character ':' in identifier "untitled:Untitled-1".
```
@maximedenes maximedenes self-assigned this Jul 31, 2023
4ever2 referenced this issue in 4ever2/vscoq Sep 12, 2023
This also allows stepping through unsaved files; before this patch, we passed
`-topfile untitled:Untitled-1`, which failed with:

```
coqtop-stderr: Error: Invalid character ':' in identifier "untitled:Untitled-1".
```
thery referenced this issue in coq/vscoq Sep 13, 2023
[VsCoq1] Fix #278: pass correct `-topfile` argument
@gares gares transferred this issue from coq/vscoq Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants