diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 3888180cb..8cf2d6cac 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -21,7 +21,21 @@ jobs: with: name: gepetto authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - run: nix build -L + - run: nix build -L .#proxsuite + + nix-eigen5: + runs-on: "${{ matrix.os }}" + strategy: + matrix: + os: ["ubuntu-24.04", "macos-15"] + steps: + - uses: actions/checkout@v5 + - uses: cachix/install-nix-action@v31 + - uses: cachix/cachix-action@v16 + with: + name: gepetto + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build -L .#proxsuite-eigen_5 check: if: always() @@ -29,6 +43,7 @@ jobs: needs: - nix + - nix-eigen5 runs-on: Ubuntu-latest diff --git a/flake.lock b/flake.lock index 1d82371db..0f5320e17 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1749398372, - "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", + "lastModified": 1760948891, + "narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", + "rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1750134718, - "narHash": "sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI=", + "lastModified": 1761373498, + "narHash": "sha256-Q/uhWNvd7V7k1H1ZPMy/vkx3F8C13ZcdrKjO7Jv7v0c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9e83b64f727c88a7711a2c463a7b16eedb69a84c", + "rev": "6a08e6bb4e46ff7fcbb53d409b253f6bad8a28ce", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1748740939, - "narHash": "sha256-rQaysilft1aVMwF14xIdGS3sj1yHlI6oKQNBRTF40cc=", + "lastModified": 1754788789, + "narHash": "sha256-x2rJ+Ovzq0sCMpgfgGaaqgBSwY+LST+WbZ6TytnT9Rk=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "656a64127e9d791a334452c6b6606d17539476e2", + "rev": "a73b9c743612e4244d865a2fdee11865283c04e6", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e16df8d7c..c40004f35 100644 --- a/flake.nix +++ b/flake.nix @@ -8,21 +8,16 @@ outputs = inputs: - inputs.flake-parts.lib.mkFlake { inherit inputs; } { - systems = inputs.nixpkgs.lib.systems.flakeExposed; - perSystem = - { pkgs, self', ... }: - { - apps.default = { - type = "app"; - program = pkgs.python3.withPackages (_: [ self'.packages.default ]); - }; - packages = { - default = self'.packages.proxsuite; - proxsuite = pkgs.python3Packages.proxsuite.overrideAttrs { - src = pkgs.lib.fileset.toSource { + inputs.flake-parts.lib.mkFlake { inherit inputs; } ( + { self, lib, ... }: + { + systems = inputs.nixpkgs.lib.systems.flakeExposed; + flake.overlays = { + default = final: prev: { + proxsuite = prev.proxsuite.overrideAttrs { + src = lib.fileset.toSource { root = ./.; - fileset = pkgs.lib.fileset.unions [ + fileset = lib.fileset.unions [ ./benchmark ./bindings ./cmake-external @@ -34,8 +29,65 @@ ./test ]; }; + postPatch = ""; + nativeCheckInputs = [ + final.ctestCheckHook + ]; + # ref. https://github.com/Simple-Robotics/proxsuite/issues/426 + preCheck = '' + disabledTests+=( + "ProxQP::dense: test primal infeasibility solving" + "dense maros meszaros using the api" + "sparse maros meszaros using the API" + ) + ''; }; }; + eigen5 = final: prev: { + eigen = prev.eigen.overrideAttrs (super: rec { + version = "5.0.0"; + src = final.fetchFromGitLab { + inherit (super.src) owner repo; + tag = version; + hash = "sha256-L1KUFZsaibC/FD6abTXrT3pvaFhbYnw+GaWsxM2gaxM="; + }; + patches = [ ]; + postPatch = ""; + }); + }; }; - }; + perSystem = + { + pkgs, + pkgs-eigen_5, + self', + system, + ... + }: + { + _module.args = { + pkgs = import inputs.nixpkgs { + inherit system; + overlays = [ self.overlays.default ]; + }; + pkgs-eigen_5 = import inputs.nixpkgs { + inherit system; + overlays = [ + self.overlays.eigen5 + self.overlays.default + ]; + }; + }; + apps.default = { + type = "app"; + program = pkgs.python3.withPackages (_: [ self'.packages.default ]); + }; + packages = { + default = self'.packages.proxsuite; + proxsuite = pkgs.python3Packages.proxsuite; + proxsuite-eigen_5 = pkgs-eigen_5.python3Packages.proxsuite; + }; + }; + } + ); }