@@ -35,46 +35,10 @@ function UserNSRunner(workspace_root::String;
3535 # Check that our kernel is new enough to use this runner
3636 kernel_version_check ()
3737
38- # Check to make sure we're not going to try and bindmount within an
39- # encrypted directory, as that triggers kernel bugs
40- check_encryption (workspace_root; verbose= verbose)
41-
42- # Extract compilers argument
43- compilers = extract_kwargs (kwargs, (:compilers ,))
44-
45- # Construct environment variables we'll use from here on out
46- platform = get_concrete_platform (platform; compilers... , extract_kwargs (kwargs, (:preferred_gcc_version ,:preferred_llvm_version ))... )
47- envs = merge (platform_envs (platform, src_name; verbose, compilers... ), extra_env)
48-
49- # JIT out some compiler wrappers, add it to our mounts
50- generate_compiler_wrappers! (platform; bin_path= compiler_wrapper_path, compilers... , extract_kwargs (kwargs, (:allow_unsafe_flags ,:lock_microarchitecture ))... )
51- push! (workspaces, compiler_wrapper_path => " /opt/bin" )
52-
53- if isempty (bootstrap_list)
54- # Generate CMake and Meson files, only if we are not bootstrapping
55- generate_toolchain_files! (platform, envs, toolchains_path)
56- push! (workspaces, toolchains_path => " /opt/toolchains" )
57-
58- # Generate directory where to write Cargo config files
59- if isone (length (collect (compilers))) && :rust in collect (compilers)[1 ]. second
60- cargo_dir = mktempdir ()
61- cargo_config_file! (cargo_dir, platform)
62- # Add to the list of mappings a subdirectory of ${CARGO_HOME}, whose content
63- # will be put in ${CARGO_HOME}.
64- push! (mappings, cargo_dir => envs[" CARGO_HOME" ] * " /" * randstring ())
65- end
66- end
67-
68- # the workspace_root is always a workspace, and we always mount it first
69- insert! (workspaces, 1 , workspace_root => " /workspace" )
70-
71- # If we're enabling ccache, then mount in a read-writeable volume at /root/.ccache
72- if use_ccache
73- if ! isdir (ccache_dir ())
74- mkpath (ccache_dir ())
75- end
76- push! (workspaces, ccache_dir () => " /root/.ccache" )
77- end
38+ platform, envs, shards =
39+ runner_setup! (workspaces, mappings, workspace_root, verbose, kwargs,
40+ platform, src_name, extra_env, compiler_wrapper_path,
41+ toolchains_path, shards)
7842
7943 # If we are on a system that uses `/etc/resolv.conf` as a resolver
8044 # configuration file (mainly *BSD and Linux), check if a nameserver is
@@ -91,11 +55,6 @@ function UserNSRunner(workspace_root::String;
9155 end
9256 end
9357
94- if isnothing (shards)
95- # Choose the shards we're going to mount
96- shards = choose_shards (platform; compilers... , extract_kwargs (kwargs, (:preferred_gcc_version ,:preferred_llvm_version ,:bootstrap_list ))... )
97- end
98-
9958 # Construct sandbox command to look at the location it'll be mounted under
10059 mpath = mount_path (shards[1 ], workspace_root)
10160 sandbox_cmd = ` $(mpath) /sandbox`
@@ -163,7 +122,7 @@ function show(io::IO, x::UserNSRunner)
163122 p = x. platform
164123 # Displays as, e.g., Linux x86_64 (glibc) UserNSRunner
165124 write (io, " $(typeof (p). name. name) " , " " , arch (p), " " ,
166- Sys. islinux (p) ? " ($(p . libc) ) " : " " ,
125+ Sys. islinux (p) ? " ($(libc (p) ) ) " : " " ,
167126 " UserNSRunner" )
168127end
169128
0 commit comments