Skip to content

Rework mc-rtc-superbuild devshell#44

Open
arntanguy wants to merge 21 commits into
mainfrom
superbuild-shell
Open

Rework mc-rtc-superbuild devshell#44
arntanguy wants to merge 21 commits into
mainfrom
superbuild-shell

Conversation

@arntanguy

@arntanguy arntanguy commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This PR is attempting to simplify how devShells for mc-rtc-superbuild environments are built. In particular, the goal is to support:

  1. creating a devShell with:
  • all inputs inputsFrom required to build the chosen controller/plugins/observers/robots/states/...
  • a valid configuration of mc_rtc.yaml to load them
  1. from the same configuration generate a devShell containing every dependency built by nix (e.g "release")

The goal of 1. is local development, and 2. can be used to simply run the project from the binary cache.

In the spirit of flakoboros, I am (slowly) converging towards a flake module with a configuration like (in a consumer's flake)

        imports = [
          inputs.mc-rtc-nix.flakeModule
          {
            mc-rtc-superbuild =
              { pkgs, ... }:
              {
                enable = true;
                pname = "panda-prosthesis-superbuild";
                traceRuntimeDependencies = true;

                # Pass a function that takes pkgs!
                robots = [
                  pkgs.mc-panda-lirmm
                  pkgs.mc-panda
                ];

                apps = [
                  pkgs.mc-franka
                  pkgs.mc-rtc-magnum
                ];

                config = "lib/mc_controller/etc/panda_prosthesis/mc_rtc.yaml";

                devel = {
                  controllers = [ pkgs.panda-prosthesis ];
                  plugins = [ pkgs.panda-prosthesis ];
                  robots = [ pkgs.panda-prosthesis ];
                  config = "lib64/mc_controller/etc/panda_prosthesis/mc_rtc.yaml";
                };
              };

            flakoboros = {
              overrideAttrs.mc-panda = {
                src = inputs.mc-panda;
              };
              overrideAttrs.mc-panda-lirmm = {
                src = inputs.mc-panda-lirmm;
              };

              overrideAttrs.panda-prosthesis =
                { drv-prev, pkgs-final, ... }:
                {
                  src = lib.cleanSource ./.;
                  nativeBuildInputs = drv-prev.nativeBuildInputs ++ [ pkgs-final.pkg-config ];
                };
            };
          }
        ];

where:

  • attributes directly under mc-rtc-superbuild.<attrName> as used for both devel and release shells
  • attributes under mc-rtc-superbuild.devel.<attrName> are used as inputFrom in the devel shell, and merged with attributes in mc-rtc-superbuild.<attrName> for the release shell.

As-is it works and generates ${pname} and ${pname}-release devShells, but the implementation could be improved.

TODO:

  • Rework CI for public/private/ccache variants

@arntanguy arntanguy marked this pull request as ready for review June 12, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant