@@ -13,6 +13,12 @@ Stage0Info = provider(
13
13
},
14
14
)
15
15
16
+ CiArtifactInfo = provider (
17
+ fields = {
18
+ "component" : str ,
19
+ },
20
+ )
21
+
16
22
def _stage0_parse_impl (
17
23
actions : AnalysisActions ,
18
24
stage0_artifact : ArtifactValue ) -> list [Provider ]:
@@ -284,7 +290,10 @@ def _ci_artifact_impl(ctx: AnalysisContext) -> list[Provider]:
284
290
),
285
291
)
286
292
287
- return [DefaultInfo (default_output = download )]
293
+ return [
294
+ DefaultInfo (default_output = download ),
295
+ CiArtifactInfo (component = ctx .attrs .component ),
296
+ ]
288
297
289
298
ci_artifact = rule (
290
299
impl = _ci_artifact_impl ,
@@ -300,14 +309,15 @@ ci_artifact = rule(
300
309
301
310
def _ci_llvm_impl (ctx : AnalysisContext ) -> list [Provider ]:
302
311
rust_dev = ctx .attrs .rust_dev [DefaultInfo ].default_outputs [0 ]
312
+ component = ctx .attrs .rust_dev [CiArtifactInfo ].component
303
313
304
314
contents , _ = unarchive (
305
315
ctx = ctx ,
306
316
archive = rust_dev ,
307
317
output_name = "ci-llvm" ,
308
318
ext_type = "tar.xz" ,
309
319
excludes = [],
310
- strip_prefix = "rust-dev-nightly- {}/rust-dev" .format (targets .exec_triple (ctx )),
320
+ strip_prefix = "{}- {}/rust-dev" .format (component , targets .exec_triple (ctx )),
311
321
exec_deps = ctx .attrs ._exec_deps [HttpArchiveExecDeps ],
312
322
prefer_local = False ,
313
323
sub_targets = {},
@@ -318,7 +328,7 @@ def _ci_llvm_impl(ctx: AnalysisContext) -> list[Provider]:
318
328
ci_llvm = rule (
319
329
impl = _ci_llvm_impl ,
320
330
attrs = {
321
- "rust_dev" : attrs .dep (),
331
+ "rust_dev" : attrs .dep (providers = [ DefaultInfo , CiArtifactInfo ] ),
322
332
"_exec_deps" : attrs .default_only (attrs .exec_dep (providers = [HttpArchiveExecDeps ], default = "//platforms/exec:http_archive" )),
323
333
"_exec_os_type" : attrs .default_only (attrs .dep (providers = [OsLookup ], default = "//platforms/exec:os_lookup" )),
324
334
},
0 commit comments