Skip to content

Commit

Permalink
🐛 Fix C platform output
Browse files Browse the repository at this point in the history
Previously, setting `output` would make the derivation
end up on the correct component attribute but when splicing happened
it would look for the target named by `name` in other components.
  • Loading branch information
abbec committed Sep 12, 2024
1 parent 3b87f2c commit dec1bcf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Fixed
- Overriding the factory of a C platform caused the 'override' function
to disappear from the resulting set.
- `output` now works as expected on C platforms. Previously, setting
output to a different value than `name` created a broken
configuration.

## [4.1.4] - 2024-06-03

Expand Down
8 changes: 4 additions & 4 deletions c/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ let
{ name
, pkgs
, stdenv ? pkgs.stdenv
, output ? null
, output ? name
, platformOverrides ? _: { }
}@args:
let
factory = pkgs.callPackage (import ./make-derivation.nix platformOverrides)
{
inherit base stdenv components;
targetName = name;
targetName = output;
mathjax = mathjax';
};

Expand All @@ -55,7 +55,7 @@ let
mkPlatform (args // overrides);
overrideFactory = overrides:
finalPlatform (factory.override overrides);
} // lib.optionalAttrs (output != null) { inherit output; };
} // { inherit output; };
in
finalPlatform factory;

Expand All @@ -69,7 +69,7 @@ let
createPlatformTargets = attrsOrFn:
lib.mapAttrs'
(name: platform: {
name = platform.output or name;
name = platform.output;
value = platform attrsOrFn;
})
platforms';
Expand Down

0 comments on commit dec1bcf

Please sign in to comment.