File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -3123,6 +3123,9 @@ mutable struct CacheHeaderIncludes
3123
3123
end
3124
3124
3125
3125
function replace_depot_path (path:: AbstractString )
3126
+ @static if Sys. iswindows ()
3127
+ path = replace (path, Filesystem. path_separator_re=> Filesystem. pathsep ())
3128
+ end
3126
3129
for depot in DEPOT_PATH
3127
3130
! isdir (depot) && continue
3128
3131
@@ -3131,6 +3134,10 @@ function replace_depot_path(path::AbstractString)
3131
3134
depot = dirname (depot)
3132
3135
end
3133
3136
3137
+ @static if Sys. iswindows ()
3138
+ depot = replace (depot, Filesystem. path_separator_re=> Filesystem. pathsep ())
3139
+ end
3140
+
3134
3141
if startswith (path, string (depot, Filesystem. pathsep ())) || path == depot
3135
3142
path = replace (path, depot => " @depot" ; count= 1 )
3136
3143
break
Original file line number Diff line number Diff line change @@ -70,6 +70,21 @@ if !test_relocated_depot
70
70
@test Base. replace_depot_path (jlrc) != " @depot-rc2"
71
71
@test Base. replace_depot_path (jlrc) == jlrc
72
72
end
73
+ if Sys. iswindows ()
74
+ # windows accepts '\\' and '/' as path separators
75
+ mktempdir () do dir
76
+ jlrc = string (dir, " /" , " julia-rc2" )
77
+ jl = string (dir, " /" , " julia" )
78
+ mkdir (jl)
79
+ push! (DEPOT_PATH , jl)
80
+ @test Base. replace_depot_path (jl) == " @depot"
81
+ @test Base. replace_depot_path (string (jl," /" )) == string (" @depot" ," \\ " )
82
+ @test Base. replace_depot_path (string (jl," \\ " )) == string (" @depot" ," \\ " )
83
+ @test Base. replace_depot_path (jlrc) != " @depot-rc2"
84
+ @test Base. replace_depot_path (jlrc) ==
85
+ replace (jlrc, Base. Filesystem. path_separator_re=> " \\ " )
86
+ end
87
+ end
73
88
end
74
89
75
90
end
You can’t perform that action at this time.
0 commit comments