Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
jrl-cmakemodulesv2 = inputs.jrl-cmakemodulesv2.packages.${prev.system}.default;
jrl-cmakemodulesv2-test = inputs.jrl-cmakemodulesv2-test.packages.${prev.system}.default;
})
(import ./overlay-ccache.nix {})
];
pkgs = import inputs.nixpkgs {
inherit system overlays;
Expand Down Expand Up @@ -127,10 +128,22 @@
# Creates a custom devShell with all dependencies required to build mc_mujoco as defined in its derivation,
# but without actually building the derivation
# This can be used to test building the mc_mujoco app manually with all dependencies available (and a working find_pacakge)
mc-rtc = pkgs.mkShell {
inputsFrom = [ pkgs.mc-rtc ];
buildInputs = [ pkgs.ninja ];
};
mc-mujoco = pkgs.mkShell {
inputsFrom = [ pkgs.mc-mujoco ];
buildInputs = [ pkgs.ninja ];
};
mc-panda = pkgs.mkShell {
inputsFrom = [ pkgs.mc-panda ];
buildInputs = [ pkgs.ninja ];
};
mc-panda-lirmm = pkgs.mkShell {
inputsFrom = [ pkgs.mc-panda-lirmm ];
buildInputs = [ pkgs.ninja ];
};
mc-rtc-imgui = pkgs.mkShell {
inputsFrom = [ pkgs.mc-rtc-imgui ];
buildInputs = [ pkgs.ninja ];
Expand Down
69 changes: 69 additions & 0 deletions overlay-ccache.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{}:

final: prev:
let
withCCache = packages: with builtins; listToAttrs (map
(name: {
inherit name; value = (getAttr name prev).override { stdenv = prev.ccacheStdenv; };
})
packages);
in
{
ccacheWrapper = prev.ccacheWrapper.override {
extraConfig = ''
export CCACHE_COMPRESS=1
export CCACHE_DIR="/var/cache/ccache"
export CCACHE_UMASK=007
# export CCACHE_SLOPPINESS=random_seed
export CCACHE_SLOPPINESS=time_macros,include_file_mtime,file_macro,locale,pch_defines,random_seed
# - `time_macros`: Ignore changes in __DATE__ and __TIME__ macros.
# - `include_file_mtime`: Ignore changes in the mtime of included files.
# - `file_macro`: Ignore changes in the __FILE__ macro.
# - `locale`: Ignore locale differences.
# - `pch_defines`: Ignore differences in precompiled header defines.
# - mandatory: `random_seed`: Ignore random seed differences (already in your config).
if [ ! -d "$CCACHE_DIR" ]; then
echo "====="
echo "Directory '$CCACHE_DIR' does not exist"
echo "Please create it with:"
echo " sudo mkdir -m0770 '$CCACHE_DIR'"
echo " sudo chown root:nixbld '$CCACHE_DIR'"
echo "====="
exit 1
fi
if [ ! -w "$CCACHE_DIR" ]; then
echo "====="
echo "Directory '$CCACHE_DIR' is not accessible for user $(whoami)"
echo "Please verify its access permissions"
echo "====="
exit 1
fi
'';
};
} // withCCache [
"spacevecalg"
"rbdyn"
"sch-core"
"eigen-qld"
"eigen-quadprog"
"tasks"
"tvm"
"mc-rtc-magnum"
"mc-rtc-magnum-standalone"
"mc-panda"
"mc-panda-lirmm"
"libpoco"
"libfranka"
"mc-franka"
"panda-prosthesis"

"mc-force-shoe-plugin"

"magnum"
"magnum-integration"
"magnum-plugins"
"mc_rtc-imgui"

# "mc-rtc-rviz-panel" # how to make it work for buildRosPackage?
# "mc-rtc"
]
2 changes: 1 addition & 1 deletion pkgs/mc-rtc-magnum/standalone.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ stdenv.mkDerivation {
# fetchsubmodules = true;
# };
src = if useLocal then
builtins.trace "Using local workspace for mc_rtc-magnum: ${localWorkspace}/mc_rtc-magnum"
builtins.trace "Using local workspace for mc_rtc-magnum: ${localWorkspace}/mc_rtc-magnum-standalone"
(builtins.path {
path = "${localWorkspace}/mc_rtc-magnum-standalone";
name = "mc_rtc-magnum-src";
Expand Down
3 changes: 3 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ pkgs.mkShell {
# FIXME this flag gets too huge and gcc fails
export NIX_CFLAGS_COMPILE=""

# FIXME we might need to run ros2 daemon stop && ros2 daemon start
export ROS_DOMAIN_ID=100

echo "======================================="
echo " mc-rtc-superbuild interactive shell "
echo "======================================="
Expand Down