Skip to content

Conversation

@axel7083
Copy link

Description

When trying to investigate #38 I find out that the problem was only occurring on Windows.

The problem is occurring in the code below, the is_absolute is platform specific.

if path.as_ref().is_absolute() {
Ok(Self(path.into()))
} else {
Err(AbsolutePathError)
}

Quoting the rust documentation

Returns true if the Path is absolute, i.e., if it is independent of the current directory.

  • On Unix, a path is absolute if it starts with the root, so is_absolute and has_root are equivalent.
  • On Windows, a path is absolute if it has a prefix and starts with the root: c:\windows is absolute, while c:temp and \temp are not.

Source https://doc.rust-lang.org/std/path/struct.Path.html

The ContainerPath is always POSIX, so the is_absolute cannot be used on it, since on windows it would fails

Context

This PR does not fix the problem, as I am not familiar with the code, and with the numerous usage of the AbsolutePath struct I don't want to risk to break everything!

This PR is adding an os-matrix for testing. (Today it fails, but if #38 is fixed, a simple rebase should be enough)

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant