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

[coq] Fix coqlib file scanning. #7895

Merged
merged 1 commit into from
Jun 9, 2023
Merged

Conversation

ejgallego
Copy link
Collaborator

@ejgallego ejgallego commented Jun 5, 2023

The old code did indeed was nonsense, and among others was filtering all the files due to the String.contains d '.' condition.

I wonder how the test for updating a file in user-contrib did pass tho, that seems pretty strange, as indeed we were not adding any .vo file to the .vo file list on the user-contrib deps, so this deserves more investigation.

Fixes #7893 , thanks to Karl Palmskog for testing and detailed report.

TODO:

  • some code bits can be improved
  • new test cases [installed plugin]
  • figure out why old test-cases were not catching Coq_lib.Legacy.vo always returning the empty list.

@ejgallego ejgallego requested a review from Alizter June 5, 2023 20:34
@ejgallego ejgallego added this to the 3.8.1 milestone Jun 5, 2023
@ejgallego ejgallego added the coq label Jun 5, 2023
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added this for consistency with what Coq does.

Coq also adds $opam_root/lib but I'd rather avoid this for now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yuck, but OK.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should make a bug upstream about this. For now it makes sense to keep the scanning behavior close.

@ejgallego ejgallego force-pushed the fix_coqpath_scan branch 4 times, most recently from 83e2bce to a04f40b Compare June 5, 2023 20:57
Copy link
Collaborator

@Alizter Alizter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scanning code was a little hard to read but I think I got the gist of it. We definitely need more tests, especially those with plugins.

src/dune_rules/coq/coq_lib.ml Show resolved Hide resolved
src/dune_rules/coq/coq_lib.ml Outdated Show resolved Hide resolved
src/dune_rules/coq/coq_lib.ml Outdated Show resolved Hide resolved
src/dune_rules/coq/coq_lib.ml Show resolved Hide resolved
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yuck, but OK.

src/dune_rules/coq/coq_path.ml Show resolved Hide resolved
src/dune_rules/coq/coq_path.ml Outdated Show resolved Hide resolved
src/dune_rules/coq/coq_path.ml Show resolved Hide resolved
@emillon
Copy link
Collaborator

emillon commented Jun 6, 2023

3.8.1 has been released, I'm removing it from the milestone.

@emillon emillon removed this from the 3.8.1 milestone Jun 6, 2023
@Alizter Alizter mentioned this pull request Jun 6, 2023
7 tasks
@ejgallego ejgallego added this to the 3.8.2 milestone Jun 6, 2023
@emillon emillon removed this from the 3.8.2 milestone Jun 7, 2023
@ejgallego ejgallego marked this pull request as ready for review June 8, 2023 15:10
@ejgallego
Copy link
Collaborator Author

Ok this should be ready.

Can we add this to the 3.8.2 milestone ?

@Alizter
Copy link
Collaborator

Alizter commented Jun 8, 2023

@ejgallego Yes, it is already in the list of backports. The milestone won't make sense for PRs targeting the main branch.

@Alizter Alizter self-requested a review June 8, 2023 15:13
Installing $TESTCASE_ROOT/lib/coq/user-contrib/B/c.v
Installing $TESTCASE_ROOT/lib/coq/user-contrib/B/c.vo

Now we should see that A is not rebuilt, however coqdep is called, this seems to fail
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is strange this is not working, we now correctly add the full list of .vo files to the deps for the A.v.d file.

CHANGES.md Outdated Show resolved Hide resolved
The old code did indeed was nonsense, and among others was filtering
all the files due to the `String.contains d '.'` condition.

I wonder how the test for updating a file in user-contrib did pass
tho, that seems pretty strange, as indeed we were not adding any .vo
file to the .vo file list on the user-contrib deps, so this deserves
more investigation.

Fixes ocaml#7893 , thanks to Karl Palmskog for testing and detailed report.

Signed-off-by: Emilio Jesus Gallego Arias <[email protected]>
@ejgallego ejgallego merged commit 188c416 into ocaml:main Jun 9, 2023
@ejgallego ejgallego deleted the fix_coqpath_scan branch June 9, 2023 23:20
emillon added a commit to emillon/opam-repository that referenced this pull request Jun 16, 2023
CHANGES:

- Switch back to threaded console for all systems; fix unresponsive console on
  Windows (ocaml/dune#7906, @nojb)

- Respect `-p` / `--only-packages` for `melange.emit` artifacts (ocaml/dune#7849, @anmonteiro)

- Fix scanning of Coq installed files (@ejgallego, reported by
  @palmskog, ocaml/dune#7895 , fixes ocaml/dune#7893)

- Fix RPC buffer corruption issues due to multi threading. This issue was only
  reproducible with large RPC payloads (ocaml/dune#7418)

- Fix printing errors from excerpts whenever character offsets span multiple
  lines (ocaml/dune#7950, fixes ocaml/dune#7905, @rgrinberg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Can't find Coq plugin cmxs on loadpath error
3 participants