@@ -1006,34 +1006,47 @@ end
1006
1006
try
1007
1007
proj = joinpath (@__DIR__ , " project" , " Extensions" , " HasDepWithExtensions.jl" )
1008
1008
1009
- function gen_extension_cmd (compile)
1010
- ``` $(Base. julia_cmd ()) $compile --startup-file=no -e '
1011
- begin
1012
- push!(empty!(DEPOT_PATH), '$(repr (depot_path)) ')
1013
- using HasExtensions
1014
- Base.get_extension(HasExtensions, :Extension) === nothing || error("unexpectedly got an extension")
1015
- HasExtensions.ext_loaded && error("ext_loaded set")
1016
- using HasDepWithExtensions
1017
- Base.get_extension(HasExtensions, :Extension).extvar == 1 || error("extvar in Extension not set")
1018
- HasExtensions.ext_loaded || error("ext_loaded not set")
1019
- HasExtensions.ext_folder_loaded && error("ext_folder_loaded set")
1020
- HasDepWithExtensions.do_something() || error("do_something errored")
1021
- using ExtDep2
1022
- HasExtensions.ext_folder_loaded || error("ext_folder_loaded not set")
1023
- end
1024
- '
1025
- ```
1009
+ function gen_extension_cmd (compile, distr= false )
1010
+ load_distr = distr ? " using Distributed; addprocs(1)" : " "
1011
+ ew = distr ? " @everywhere" : " "
1012
+ cmd = """
1013
+ $load_distr
1014
+ begin
1015
+ $ew push!(empty!(DEPOT_PATH), $(repr (depot_path)) )
1016
+ using HasExtensions
1017
+ $ew using HasExtensions
1018
+ $ew Base.get_extension(HasExtensions, :Extension) === nothing || error("unexpectedly got an extension")
1019
+ $ew HasExtensions.ext_loaded && error("ext_loaded set")
1020
+ using HasDepWithExtensions
1021
+ $ew using HasDepWithExtensions
1022
+ $ew Base.get_extension(HasExtensions, :Extension).extvar == 1 || error("extvar in Extension not set")
1023
+ $ew HasExtensions.ext_loaded || error("ext_loaded not set")
1024
+ $ew HasExtensions.ext_folder_loaded && error("ext_folder_loaded set")
1025
+ $ew HasDepWithExtensions.do_something() || error("do_something errored")
1026
+ using ExtDep2
1027
+ $ew using ExtDep2
1028
+ $ew HasExtensions.ext_folder_loaded || error("ext_folder_loaded not set")
1029
+ end
1030
+ """
1031
+ return ` $(Base. julia_cmd ()) $compile --startup-file=no -e $cmd `
1026
1032
end
1027
1033
1028
1034
for compile in (` --compiled-modules=no` , ` ` , ` ` ) # Once when requiring precompilation, once where it is already precompiled
1029
1035
cmd = gen_extension_cmd (compile)
1030
1036
cmd = addenv (cmd, " JULIA_LOAD_PATH" => proj)
1031
1037
cmd = pipeline (cmd; stdout , stderr )
1038
+ @show compile
1032
1039
@test success (cmd)
1033
1040
end
1034
1041
1035
1042
sep = Sys. iswindows () ? ' ;' : ' :'
1036
1043
1044
+ cmd = gen_extension_cmd (` ` , true )
1045
+ cmd = addenv (cmd, " JULIA_LOAD_PATH" => join ([proj, " @stdlib" ], sep))
1046
+ str = read (cmd, String)
1047
+ @test ! occursin (" Error during loading of extension" , str)
1048
+ @test ! occursin (" ConcurrencyViolationError" , str)
1049
+
1037
1050
# 48351
1038
1051
cmd = gen_extension_cmd (` ` )
1039
1052
cmd = addenv (cmd, " JULIA_LOAD_PATH" => join ([mktempdir (), proj], sep))
0 commit comments