Skip to content

Commit 896fe2f

Browse files
committed
rust: handle targets
1 parent 452cd90 commit 896fe2f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/modules/languages/rust.nix

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,24 @@ in
209209
)
210210
cfg.components;
211211

212+
# Add target components (rust-std for different architectures)
213+
targetComponents = lib.map
214+
(target:
215+
let targetStdName = "rust-std-${target}";
216+
in cfg.toolchain.${targetStdName} or toolchainComponents.${targetStdName} or (throw "Target '${target}' not available. rust-std-${target} component not found.")
217+
)
218+
cfg.targets;
219+
220+
allSelectedComponents = resolvedComponents ++ targetComponents;
221+
212222
# Create aggregated profile with user overrides
213223
# TODO: this is private API. We're doing this to retain API compatibility with the previous fenix implementation.
214224
# TODO: the final toolchain derivation/package should be overridable
215225
# TODO: profiles should be exposed as an option. 99% of uses should be covered by the pre-built profiles with overrides.
216226
profile = mkAggregated {
217227
pname = "rust-${cfg.channel}-${toolchain._manifest.version}";
218228
inherit (toolchain._manifest) version date;
219-
selectedComponents = resolvedComponents;
229+
selectedComponents = allSelectedComponents;
220230
};
221231
in
222232
{

0 commit comments

Comments
 (0)