Skip to content

Commit

Permalink
release-lib: build packages without meta.platforms on all platforms (
Browse files Browse the repository at this point in the history
  • Loading branch information
RossComputerGuy authored Oct 30, 2024
2 parents 2c3dde0 + 9f36206 commit fb01d57
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ let
cuSPARSE, cuSOLVER, cuFFT, cuRAND, NPP and nvJPEG.
'';
license = lib.licenses.bsd3;
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ obsidian-systems-maintenance ] ++ lib.teams.cuda.members;
};
};
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/cuda-modules/cuda-samples/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ backendStdenv.mkDerivation (finalAttrs: {
description = "Samples for CUDA Developers which demonstrates features in CUDA Toolkit";
# CUDA itself is proprietary, but these sample apps are not.
license = lib.licenses.bsd3;
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ obsidian-systems-maintenance ] ++ lib.teams.cuda.members;
};
})
40 changes: 34 additions & 6 deletions pkgs/test/build-environment-info/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
{ runCommand }:
{
lib,
stdenv,
runCommand,
getent,
xcbuild,
}:

# Prints information about the state of the build environment for
# assistance debugging Hydra. Feel free to add anything you would find
# useful to this.
runCommand "build-environment-info" { } ''
ulimit -a
runCommand "build-environment-info"
{
nativeBuildInputs = [ getent ] ++ lib.optionals stdenv.buildPlatform.isDarwin [ xcbuild ];
}
''
# It’s useful to get more info even if a command fails.
set +e
# Always fail so that this job can easily be restarted.
exit 1
''
run() {
echoCmd : "$@"
"$@"
}
run uname -a
${lib.optionalString stdenv.buildPlatform.isDarwin ''
run env SYSTEM_VERSION_COMPAT=0 plutil -p /System/Library/CoreServices/SystemVersion.plist
''}
run id
run getent passwd "$(id -un)"
run ulimit -a
# Always fail so that this job can easily be restarted.
run exit 1
''
18 changes: 8 additions & 10 deletions pkgs/test/nixos-functions/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ let
versionSuffix = "test";
label = "test";
};
in lib.optionalAttrs stdenv.hostPlatform.isLinux (
pkgs.recurseIntoAttrs {
in pkgs.recurseIntoAttrs {

nixos-test = (pkgs.nixos {
system.nixos = dummyVersioning;
boot.loader.grub.enable = false;
fileSystems."/".device = "/dev/null";
system.stateVersion = lib.trivial.release;
}).toplevel;
nixos-test = (pkgs.nixos {
system.nixos = dummyVersioning;
boot.loader.grub.enable = false;
fileSystems."/".device = "/dev/null";
system.stateVersion = lib.trivial.release;
}).toplevel;

}
)
}
5 changes: 5 additions & 0 deletions pkgs/tools/typesetting/tex/texlive/build-texlive-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ let
'';
# discourage nix-env from matching this package
priority = 10;
platforms = lib.platforms.all;
# These create a large number of jobs, which puts load on Hydra
# without any appreciable benefit (as the combined packages already
# cause them all to be built and cached anyway).
hydraPlatforms = [ ];
} // lib.optionalAttrs (args ? shortdesc) {
description = args.shortdesc;
};
Expand Down
28 changes: 13 additions & 15 deletions pkgs/top-level/php-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ in {

meta = {
description = "PHP upstream extension: ${name}";
inherit (php.meta) maintainers homepage license;
};
inherit (php.meta) maintainers homepage license platforms;
} // args.meta or { };
}));

php = phpPackage;
Expand Down Expand Up @@ -461,13 +461,6 @@ in {
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { NIX_LDFLAGS = "-liconv"; };
doCheck = stdenv.hostPlatform.isLinux;
}
{
name = "imap";
buildInputs = [ uwimap openssl pam pcre2 libkrb5 ];
configureFlags = [ "--with-imap=${uwimap}" "--with-imap-ssl" "--with-kerberos" ];
# Using version from PECL on new PHP versions.
enable = lib.versionOlder php.version "8.3";
}
{
name = "intl";
buildInputs = [ icu73 ];
Expand Down Expand Up @@ -563,7 +556,7 @@ in {
internalDeps = [ php.extensions.pdo ];
configureFlags = [ "--with-pdo-dblib=${freetds}" ];
# Doesn't seem to work on darwin.
enable = (!stdenv.hostPlatform.isDarwin);
meta.broken = (!stdenv.hostPlatform.isDarwin);
doCheck = false;
}
{
Expand Down Expand Up @@ -658,7 +651,7 @@ in {
buildInputs = [ net-snmp openssl ];
configureFlags = [ "--with-snmp" ];
# net-snmp doesn't build on darwin.
enable = (!stdenv.hostPlatform.isDarwin);
meta.broken = (!stdenv.hostPlatform.isDarwin);
doCheck = false;
}
{
Expand Down Expand Up @@ -813,6 +806,13 @@ in {
"--with-zlib"
];
}
] ++ lib.optionals (lib.versionOlder php.version "8.3") [
# Using version from PECL on new PHP versions.
{
name = "imap";
buildInputs = [ uwimap openssl pam pcre2 libkrb5 ];
configureFlags = [ "--with-imap=${uwimap}" "--with-imap-ssl" "--with-kerberos" ];
}
];

# Convert the list of attrs:
Expand All @@ -821,14 +821,12 @@ in {
# [ { name = <name>; value = <extension drv>; } ... ]
#
# which we later use listToAttrs to make all attrs available by name.
#
# Also filter out extensions based on the enable property.
namedExtensions = builtins.map
(drv: {
name = drv.name;
value = mkExtension (builtins.removeAttrs drv [ "enable" ]);
value = mkExtension drv;
})
(builtins.filter (i: i.enable or true) extensionData);
extensionData;

# Produce the final attribute set of all extensions defined.
in
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/release-lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ let
if isDerivation value then
value.meta.hydraPlatforms
or (subtractLists (value.meta.badPlatforms or [])
(value.meta.platforms or [ "x86_64-linux" ]))
(value.meta.platforms or supportedSystems))
else if value.recurseForDerivations or false || value.recurseForRelease or false then
packagePlatforms value
else
Expand Down

0 comments on commit fb01d57

Please sign in to comment.