10
10
@test startswith (pathof (Distributed), sharedir)
11
11
end
12
12
13
+ pathsep = Sys. iswindows () ? " ;" : " :"
14
+
13
15
@test cluster_cookie () isa String
14
16
15
17
include (joinpath (Sys. BINDIR, " .." , " share" , " julia" , " test" , " testenv.jl" ))
@@ -1818,9 +1820,11 @@ let julia = `$(Base.julia_cmd()) --startup-file=no`; mktempdir() do tmp
1818
1820
project = mkdir (joinpath (tmp, " project" ))
1819
1821
depots = [mkdir (joinpath (tmp, " depot1" )), mkdir (joinpath (tmp, " depot2" ))]
1820
1822
load_path = [mkdir (joinpath (tmp, " load_path" )), " @stdlib" , " @" ]
1821
- pathsep = Sys. iswindows () ? " ;" : " :"
1823
+ shipped_depots = DEPOT_PATH [2 : end ] # stdlib caches
1824
+
1822
1825
env = Dict (
1823
- " JULIA_DEPOT_PATH" => join (depots, pathsep),
1826
+ # needs a trailing pathsep to access the stdlib depot
1827
+ " JULIA_DEPOT_PATH" => join (depots, pathsep) * pathsep,
1824
1828
" JULIA_LOAD_PATH" => join (load_path, pathsep),
1825
1829
# Explicitly propagate `TMPDIR`, in the event that we're running on a
1826
1830
# CI system where `TMPDIR` is special.
@@ -1874,8 +1878,14 @@ let julia = `$(Base.julia_cmd()) --startup-file=no`; mktempdir() do tmp
1874
1878
@test success (pipeline (cmd; stdout , stderr ))
1875
1879
# JULIA_(LOAD|DEPOT)_PATH
1876
1880
shufflecode = """
1877
- d = reverse(DEPOT_PATH)
1878
- append!(empty!(DEPOT_PATH), d)
1881
+ function reverse_first_two(depots)
1882
+ custom_depots = depots[1:2]
1883
+ standard_depots = depots[3:end]
1884
+ custom_depots = reverse(custom_depots)
1885
+ return append!(custom_depots, standard_depots)
1886
+ end
1887
+ new_depots = reverse_first_two(DEPOT_PATH)
1888
+ append!(empty!(DEPOT_PATH), new_depots)
1879
1889
l = reverse(LOAD_PATH)
1880
1890
append!(empty!(LOAD_PATH), l)
1881
1891
"""
@@ -1886,7 +1896,7 @@ let julia = `$(Base.julia_cmd()) --startup-file=no`; mktempdir() do tmp
1886
1896
extracode = """
1887
1897
for w in workers()
1888
1898
@test remotecall_fetch(load_path, w) == $(repr (reverse (load_path)))
1889
- @test remotecall_fetch(depot_path, w) == $(repr (reverse (depots)))
1899
+ @test remotecall_fetch(depot_path, w) == $(repr (vcat ( reverse (depots), shipped_depots )))
1890
1900
end
1891
1901
"""
1892
1902
cmd = setenv (` $(julia) -e $(shufflecode * addcode * testcode * extracode) ` , env)
@@ -1895,7 +1905,7 @@ let julia = `$(Base.julia_cmd()) --startup-file=no`; mktempdir() do tmp
1895
1905
failcode = shufflecode * setupcode * """
1896
1906
for w in workers()
1897
1907
@test remotecall_fetch(load_path, w) == reverse(LOAD_PATH) == $(repr (load_path))
1898
- @test remotecall_fetch(depot_path, w) == reverse (DEPOT_PATH) == $(repr (depots))
1908
+ @test remotecall_fetch(depot_path, w) == reverse_first_two (DEPOT_PATH) == $(repr (vcat ( depots, shipped_depots) ))
1899
1909
end
1900
1910
"""
1901
1911
cmd = setenv (` $(julia) -p1 -e $(failcode) ` , env)
@@ -1906,15 +1916,15 @@ let julia = `$(Base.julia_cmd()) --startup-file=no`; mktempdir() do tmp
1906
1916
project = mktempdir()
1907
1917
env = Dict(
1908
1918
"JULIA_LOAD_PATH" => string(LOAD_PATH[1], $(repr (pathsep)) , "@stdlib"),
1909
- "JULIA_DEPOT_PATH" => DEPOT_PATH[1],
1919
+ "JULIA_DEPOT_PATH" => DEPOT_PATH[1] * $( repr (pathsep)) ,
1910
1920
"TMPDIR" => ENV["TMPDIR"],
1911
1921
)
1912
1922
addprocs(1; env = env, exeflags = `--project=\$ (project)`)
1913
1923
env["JULIA_PROJECT"] = project
1914
1924
addprocs(1; env = env)
1915
1925
""" * setupcode * """
1916
1926
for w in workers()
1917
- @test remotecall_fetch(depot_path, w) == [ DEPOT_PATH[1]]
1927
+ @test remotecall_fetch(depot_path, w) == vcat( DEPOT_PATH[1], $( repr (shipped_depots)) )
1918
1928
@test remotecall_fetch(load_path, w) == [LOAD_PATH[1], "@stdlib"]
1919
1929
@test remotecall_fetch(active_project, w) == project
1920
1930
@test remotecall_fetch(Base.active_project, w) == joinpath(project, "Project.toml")
0 commit comments