Move path operations to backends - #913
Merged
Merged
Conversation
Contributor
|
Thanks as always for the review!
This was because I wasn't entirely sure if that was part of the frontend Eio guarantee or not (as #907 was going on). It is cleaner to have them all in the backend as long. |
avsm
reviewed
Jul 31, 2026
This is to allow Windows paths to behave differently in future (but in this commit the behaviour is the same as before). Co-authored-by: Anil Madhavapeddy <anil@recoil.org>
avsm
pushed a commit
to ocaml/opam-repository
that referenced
this pull request
Aug 20, 2026
CHANGES: New features: - Windows paths support (@avsm @kentookura @talex5 @dra27 ocaml-multicore/eio#913 ocaml-multicore/eio#916). Previously, an `Eio.Path.t` always used POSIX-style paths, using `/` as the separator, but this didn't work well on Windows, especially with absolute paths. - Pre-connect socket options (@avsm @art-w @talex5 ocaml-multicore/eio#875). `Eio.Net.connect` now has `?bind_to` and `?options` arguments for pre-connect configuration. Allows an outbound socket to be configured before connect or listen. - Add `Eio.Path.of_dir` (@talex5 ocaml-multicore/eio#919). Just a convenience function. Bug fixes: - Fix handling of empty paths when using `fs` unconfined (@talex5 ocaml-multicore/eio#907, reported by @samoht, reviewed by @avsm). Some path operations could end up using a path of "" which resulted in an error. This was breaking `Path.mkdirs` if only the base directory already existed. Code cleanups and performance: - eio_posix: fix build on 32-bit platforms (@talex5 ocaml-multicore/eio#917, reported by @glondu). - unix: optimise the POSIX path split to allocate much less by scanning (@avsm ocaml-multicore/eio#915, reviewed by @talex5). - eio_linux: use a bigger stack buffer for `getdents` to speed up bigger dirs (@avsm ocaml-multicore/eio#910). - Add some more tests for POSIX paths (@avsm @talex5 ocaml-multicore/eio#918). - Add "available" to opam files (@talex5 ocaml-multicore/eio#921). - Clean up `dir_path` handling (@talex5 @avsm ocaml-multicore/eio#920).
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.
This is split off from @avsm's #908 to make reviewing easier. This PR just moves the existing code without changing the logic or adding Windows support or new tests.
Compared to #908:
PATHimplementsplitandjoinand all the existing logic moves there. The original PR had some handling of.in the frontend, which seemed odd.DIRnow hasmodule Path : PATH, notinclude PATH, as that seemed a bit cleaner.posix_path.mlinow just doesinclude Eio.Fs.Pi.PATH.tests/fs.mdjust testsPosix_pathdirectly. There doesn't seem any point running a main loop and a backend now that the frontend is just calling the functions directly, and the tests really are checking POSIX syntax, not the host syntax.