Fix path representations that are causing expect-like tests to fail in dune 3.24 - #482
Open
shonfeder wants to merge 3 commits into
Open
Fix path representations that are causing expect-like tests to fail in dune 3.24#482shonfeder wants to merge 3 commits into
shonfeder wants to merge 3 commits into
Conversation
shonfeder
marked this pull request as draft
July 22, 2026 16:24
shonfeder
commented
Jul 22, 2026
shonfeder
force-pushed
the
fix-path-represtation
branch
from
July 22, 2026 16:42
2a9e585 to
cc2579a
Compare
Strip off current directory prefix, if its present in a file name This avoids use of String.starts_with to support ocaml =< 4.13 since String.starts_with was only added in 4.13, but this project supports ocaml >= 4.08. The string prefix logic her duplicates code that can already be found in lib/label.ml, but reusing it here would require a change to the public API of the library, which would then be a breaking change rather than a purely internal fix.
shonfeder
force-pushed
the
fix-path-represtation
branch
from
July 22, 2026 16:43
cc2579a to
5aed4bd
Compare
This reverts part of commit bee52bd Since the breaking changes to dune's file path representation have been accounted for, there shouldn't be a need for this conflict any more.
shonfeder
marked this pull request as ready for review
July 22, 2026 16:55
Contributor
Author
|
Not sure if a changelog entry is actually wanted for this, but it could be user-visible so I've offered one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In ocaml/dune#15156 , release in dune 3.24, the representation of paths was change so that paths would always include their local directory prefix. Test fixtures that depend on the unnormalized representation of paths coming from dune start breaking as a result.
The two changes offered here fix the test breakage reported at #478 (comment) and should make #479 unnecessary for new release.
An alternative approach would be just promote the changes to the file representation into the test fixtures. However, normalizing and fully specifying path representations is the more robust choice if they get printed into text fixtures, IMO.