@@ -18,6 +18,8 @@ static DEFAULT_SANDBOX_IMAGE: &str = "rustops/crates-build-env";
18
18
const DEFAULT_COMMAND_TIMEOUT : Option < Duration > = Some ( Duration :: from_secs ( 15 * 60 ) ) ;
19
19
const DEFAULT_COMMAND_NO_OUTPUT_TIMEOUT : Option < Duration > = None ;
20
20
21
+ static DEFAULT_RUSTUP_PROFILE : & str = "minimal" ;
22
+
21
23
/// Builder of a [`Workspace`](struct.Workspace.html).
22
24
pub struct WorkspaceBuilder {
23
25
user_agent : String ,
@@ -28,6 +30,7 @@ pub struct WorkspaceBuilder {
28
30
fetch_registry_index_during_builds : bool ,
29
31
running_inside_docker : bool ,
30
32
fast_init : bool ,
33
+ rustup_profile : String ,
31
34
}
32
35
33
36
impl WorkspaceBuilder {
@@ -45,6 +48,7 @@ impl WorkspaceBuilder {
45
48
fetch_registry_index_during_builds : true ,
46
49
running_inside_docker : false ,
47
50
fast_init : false ,
51
+ rustup_profile : DEFAULT_RUSTUP_PROFILE . into ( ) ,
48
52
}
49
53
}
50
54
@@ -125,6 +129,12 @@ impl WorkspaceBuilder {
125
129
self
126
130
}
127
131
132
+ /// Name of the rustup profile used when installing toolchains. The default is `minimal`.
133
+ pub fn rustup_profile ( mut self , profile : & str ) -> Self {
134
+ self . rustup_profile = profile. into ( ) ;
135
+ self
136
+ }
137
+
128
138
/// Initialize the workspace. This will create all the necessary local files and fetch the rest from the network. It's
129
139
/// not unexpected for this method to take minutes to run on slower network connections.
130
140
pub fn init ( self ) -> Result < Workspace , Error > {
@@ -157,6 +167,7 @@ impl WorkspaceBuilder {
157
167
command_no_output_timeout : self . command_no_output_timeout ,
158
168
fetch_registry_index_during_builds : self . fetch_registry_index_during_builds ,
159
169
current_container : None ,
170
+ rustup_profile : self . rustup_profile ,
160
171
} ) ,
161
172
} ;
162
173
@@ -179,6 +190,7 @@ struct WorkspaceInner {
179
190
command_no_output_timeout : Option < Duration > ,
180
191
fetch_registry_index_during_builds : bool ,
181
192
current_container : Option < CurrentContainer > ,
193
+ rustup_profile : String ,
182
194
}
183
195
184
196
/// Directory on the filesystem containing rustwide's state and caches.
@@ -272,6 +284,10 @@ impl Workspace {
272
284
self . inner . current_container . as_ref ( )
273
285
}
274
286
287
+ pub ( crate ) fn rustup_profile ( & self ) -> & str {
288
+ & self . inner . rustup_profile
289
+ }
290
+
275
291
fn init ( & self , fast_init : bool ) -> Result < ( ) , Error > {
276
292
info ! ( "installing tools required by rustwide" ) ;
277
293
crate :: tools:: install ( self , fast_init) ?;
0 commit comments