Skip to content

Commit

Permalink
ci: fully eval aarch64-linux (#482)
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroHLC authored Dec 12, 2023
1 parent 8961d94 commit e22c855
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 15 deletions.
4 changes: 3 additions & 1 deletion maintenance/dev-shells/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ let
pkgs = applyOverlay { inherit nyxPkgs; pkgs = nixPkgs; replace = true; merge = true; };
inherit (pkgs) callPackage mkShell;

nyxRecursionHelper = callPackage ../../shared/recursion-helper.nix { };
nyxRecursionHelper = callPackage ../../shared/recursion-helper.nix {
inherit (pkgs.stdenv) system;
};

# Matches build.yml and full-bump.yml
pinnedNix = pkgs.nixVersions.nix_2_19;
Expand Down
13 changes: 10 additions & 3 deletions maintenance/dev/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
{ flakes, nixConfig, utils, self ? flakes.self }: flakes.yafas.withAllSystems { }
(universals: { system, ... }:
let
pkgs = import flakes.nixpkgs {
nixPkgs = import flakes.nixpkgs {
inherit system;
config = {
allowUnfree = true;
allowUnsupportedSystem = true;
nvidia.acceptLicense = true;
};
};
nyxPkgs = utils.applyOverlay { pkgs = nixPkgs; };
in
with universals; {
packages = utils.applyOverlay { inherit pkgs; };
nixpkgs = pkgs;
packages = nyxPkgs;
nixpkgs = nixPkgs;
mergedPkgs = utils.applyOverlay {
pkgs = nixPkgs;
merge = true;
replace = true;
};
system = flakes.nixpkgs.lib.nixosSystem {
inherit system;
modules = [ self.nixosModules.default ];
Expand Down
1 change: 1 addition & 0 deletions maintenance/failures.aarch64-linux.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ }
File renamed without changes.
2 changes: 1 addition & 1 deletion maintenance/schemas/home-manager-modules/inventory.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
shared = import ../shared/options.nix;
inherit (shared) optionMap optionWarn;

nyxRecursionHelper = pkgs.callPackage ../../../shared/recursion-helper.nix { };
nyxRecursionHelper = pkgs.callPackage ../../../shared/recursion-helper.nix { inherit (pkgs.stdenv) system; };

loadedHomeManagerModule = homeManagerConfiguration {
modules = [
Expand Down
2 changes: 1 addition & 1 deletion maintenance/schemas/nixos-modules/inventory.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let
shared = import ../shared/options.nix;
inherit (shared) optionMap optionWarn;

nyxRecursionHelper = pkgs.callPackage ../../../shared/recursion-helper.nix { };
nyxRecursionHelper = pkgs.callPackage ../../../shared/recursion-helper.nix { inherit (pkgs.stdenv) system; };

nixosEval = nyxRecursionHelper.options optionWarn optionMap nyxosConfiguration.options.chaotic;

Expand Down
8 changes: 4 additions & 4 deletions maintenance/schemas/packages/inventory.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{ nixpkgs }: output:
let
mkPackages = nyxPkgs:
mkPackages = system: nyxPkgs:
let
inherit (nixpkgs) lib;

nyxRecursionHelper = import ../../../shared/recursion-helper.nix { inherit lib; };
nyxRecursionHelper = import ../../../shared/recursion-helper.nix { inherit lib system; };

derivationMap = k: v:
{
Expand Down Expand Up @@ -42,7 +42,7 @@ in
children = {
x86_64-linux.forSystems = [ "x86_64-linux" ];
x86_64-linux.children =
mkPackages output.x86_64-linux;
mkPackages "x86_64-linux" output.x86_64-linux;
aarch64-linux.forSystems = [ "aarch64-linux" ];
aarch64-linux.children =
let
Expand All @@ -59,6 +59,6 @@ in
"vkshade32_git"
];
in
mkPackages (remove32 output.aarch64-linux);
mkPackages "aarch64-linux" (remove32 output.aarch64-linux);
};
}
7 changes: 6 additions & 1 deletion maintenance/tools/builder/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let
builtins.map (xsx: xsx.drv)
(lib.lists.filter (xsx: xsx.drv != null) packagesEval);

brokenOutPaths = builtins.attrValues (import ../../failures.nix);
brokenOutPaths = builtins.attrValues (import "${flakeSelf}/maintenance/failures.${hostPlatform.system}.nix");

depVar = drv:
"_dep_${nyxUtils.drvHash drv}";
Expand Down Expand Up @@ -111,6 +111,11 @@ writeShellScriptBin "chaotic-nyx-build" ''
NYX_SOURCE="''${NYX_SOURCE:-${flakeSelf}}"
NYX_TARGET="''${NYX_TARGET:-${hostPlatform.system}}"
NYX_PREFIX=""
if [ -z "$NYX_PREFIX" ] && [ "$NYX_TARGET" != 'x86_64-linux' ]; then
NYX_PREFIX="''${NYX_TARGET%-linux}."
fi
# All the required functions
source ${./lib.sh}
Expand Down
2 changes: 1 addition & 1 deletion maintenance/tools/builder/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function cached() {
# Helper to zip-merge _ALL_OUT_KEYS and _ALL_OUT_PATHS
function zip_path() {
for (( i=0; i<${#_ALL_OUT_KEYS[*]}; ++i)); do
echo "${_ALL_OUT_KEYS[$i]}" "${_ALL_OUT_PATHS[$i]}"
echo "${NYX_PREFIX:-}${_ALL_OUT_KEYS[$i]}" "${_ALL_OUT_PATHS[$i]}"
done
}

Expand Down
2 changes: 1 addition & 1 deletion pkgs/linux-cachyos/kernel.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ in
extraMeta = {
maintainers = with lib.maintainers; [ dr460nf1r3 pedrohlc ];
# at the time of this writing, they don't have config files for aarch64
broken = stdenv.system == "aarch64-linux";
platforms = [ "x86_64-linux" ];
};
}
).overrideAttrs (prevAttrs: {
Expand Down
5 changes: 4 additions & 1 deletion pkgs/linux-cachyos/make.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@ let
basePackages = linuxPackagesFor kernel;
packagesWithZFS = basePackages.extend addZFS;
packagesWithoutUpdateScript = nyxUtils.dropAttrsUpdateScript packagesWithZFS;
packagesWithRightPlatforms = nyxUtils.setAttrsPlatforms supportedPlatforms packagesWithoutUpdateScript;

supportedPlatforms = [ (with lib.systems.inspect.patterns; isx86_64 // isLinux) "x86_64-linux" ];

versionSuffix = "+C${nyxUtils.shorter versions.config.rev}+P${nyxUtils.shorter versions.patches.rev}"
+ lib.strings.optionalString withBCacheFS "+bcachefs";
in
packagesWithoutUpdateScript // {
packagesWithRightPlatforms // {
_description = "Kernel and modules for ${description}";
_version = "${versions.linux.version}${versionSuffix}";
inherit (basePackages) kernel; # This one still has the updateScript
Expand Down
17 changes: 16 additions & 1 deletion shared/recursion-helper.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{ lib }:
{ lib, system }:
let
parsedSystem = lib.systems.parse.mkSystemFromString system;
in
rec {
join = namespace: current:
if namespace != "" then
Expand All @@ -21,6 +24,18 @@ rec {
(if lib.attrsets.isDerivation v then
(if (v.meta.broken or true) then
warnFn fullKey v "marked broken"
else if ((v.meta.platforms or [ ]) != [ ] &&
!(builtins.elem system v.meta.platforms ||
lib.systems.inspect.matchAnyAttrs
(builtins.filter builtins.isAttrs v.meta.platforms)
parsedSystem)) then
warnFn fullKey v "not marked compatible"
else if ((v.meta.badPlatforms or [ ]) != [ ] &&
(builtins.elem system v.meta.badPlatforms ||
lib.systems.inspect.matchAnyAttrs
(builtins.filter builtins.isAttrs v.meta.badPlatforms)
parsedSystem)) then
warnFn fullKey v "marked incompatible"
else if (v.meta.unfree or true && !(v.meta.nyx.bypassLicense or false) && v.meta.license != lib.licenses.unfreeRedistributable) then
warnFn fullKey v "unfree"
else
Expand Down
14 changes: 14 additions & 0 deletions shared/utils.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ rec {
x
);

# Helps when batch-overriding.
setAttrsPlatforms = platforms: builtins.mapAttrs (_k: v:
if (v ? "overrideAttrs") then
v.overrideAttrs
(prevAttrs: {
meta = (prevAttrs.meta or { }) // {
platforms = lib.lists.intersectLists (prevAttrs.meta.platforms or [ ]) platforms;
platformsOrig = prevAttrs.meta.platforms or [ ];
badPlatforms = [ ];
};
})
else v
);

# For revs
shorter = builtins.substring 0 7;

Expand Down

1 comment on commit e22c855

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All packages were built and cached successfully! (269 not suitable for building)

Please sign in to comment.