Skip to content

Breaking relpath change on Windows with Julia 1.6 #40237

@rofinn

Description

@rofinn

I realize I should have been testing on nightly to catch things like this earlier, but it looks like a breaking relpath change was introduced in Julia 1.6 for Windows. The following test now fails:

rel_str = joinpath("..", "src", "FilePathsBase.jl")
rel_fp = Path(rel_str)
@test relpath(abspath(rel_str)) == rel_str
@test string(relpath(absolute(rel_fp))) == rel_str

with

relpath: Test Failed at D:\a\FilePathsBase.jl\FilePathsBase.jl\test\system.jl:224
  Expression: relpath(abspath(rel_str)) == rel_str
   Evaluated: "D:\\a\\FilePathsBase.jl\\FilePathsBase.jl\\src\\FilePathsBase.jl" == "..\\src\\FilePathsBase.jl"

I'm guessing this was introduced by #38259 because the default startpath of . doesn't have a drive letter? I'm guessing we probably want to special case relative path arguments? I can make a PR, but I just wanted to confirm that we want to maintain the old behaviour first.

https://github.com/rofinn/FilePathsBase.jl/runs/2206524503?check_suite_focus=true#step:7:86

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions