Skip to content

Commit f4989b1

Browse files
authored
Merge pull request #14590 from NixOS/fix-win-shell
packaging: Unbork win shells with unavailable dependencies
2 parents 09d6847 + 2de7421 commit f4989b1

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

packaging/dev-shell.nix

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,19 @@ pkgs.nixComponents2.nix-util.overrideAttrs (
130130
havePerl = stdenv.buildPlatform == stdenv.hostPlatform && stdenv.hostPlatform.isUnix;
131131
ignoreCrossFile = flags: builtins.filter (flag: !(lib.strings.hasInfix "cross-file" flag)) flags;
132132

133+
availableComponents = lib.filterAttrs (
134+
k: v: lib.meta.availableOn pkgs.hostPlatform v
135+
) allComponents;
136+
133137
activeComponents = buildInputsClosureCond isInternal (
134-
lib.attrValues (finalAttrs.passthru.config.getComponents allComponents)
138+
lib.attrValues (finalAttrs.passthru.config.getComponents availableComponents)
135139
);
136140

137141
allComponents = lib.filterAttrs (k: v: lib.isDerivation v) pkgs.nixComponents2;
138142
internalDrvs = byDrvPath (
139143
# Drop the attr names (not present in buildInputs anyway)
140-
lib.attrValues allComponents
141-
++ lib.concatMap (c: lib.attrValues c.tests or { }) (lib.attrValues allComponents)
144+
lib.attrValues availableComponents
145+
++ lib.concatMap (c: lib.attrValues c.tests or { }) (lib.attrValues availableComponents)
142146
);
143147

144148
isInternal =
@@ -187,19 +191,19 @@ pkgs.nixComponents2.nix-util.overrideAttrs (
187191
);
188192

189193
small =
190-
(finalAttrs.finalPackage.withActiveComponents (c: {
191-
inherit (c)
192-
nix-cli
193-
nix-util-tests
194-
nix-store-tests
195-
nix-expr-tests
196-
nix-fetchers-tests
197-
nix-flake-tests
198-
nix-functional-tests
199-
# Currently required
200-
nix-perl-bindings
201-
;
202-
})).overrideAttrs
194+
(finalAttrs.finalPackage.withActiveComponents (
195+
c:
196+
lib.intersectAttrs (lib.genAttrs [
197+
"nix-cli"
198+
"nix-util-tests"
199+
"nix-store-tests"
200+
"nix-expr-tests"
201+
"nix-fetchers-tests"
202+
"nix-flake-tests"
203+
"nix-functional-tests"
204+
"nix-perl-bindings"
205+
] (_: null)) c
206+
)).overrideAttrs
203207
(o: {
204208
mesonFlags = o.mesonFlags ++ [
205209
# TODO: infer from activeComponents or vice versa

src/kaitai-struct-checks/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ mkMesonDerivation (finalAttrs: {
6565
'';
6666

6767
meta = {
68-
platforms = lib.platforms.all;
68+
platforms = lib.platforms.unix;
6969
};
7070
})

src/perl/package.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,9 @@ perl.pkgs.toPerlModule (
7474
];
7575

7676
strictDeps = false;
77+
78+
meta = {
79+
platforms = lib.platforms.unix;
80+
};
7781
})
7882
)

0 commit comments

Comments
 (0)