Mike Purvis
DevOps Staff
https://github.com/mikepurvis

Better ROS Builds
with Nix

Ivor Wanders
Navigation Manager
https://github.com/iwanders

ROSCon 2022 | Kyoto, Japan

Mike Purvis
DevOps Staff

h
t
i
w
r
e
t
s
a
f
s
e
m
i
t
4.5
!
s
e
c
r
u
o
s
e
r
e
h
t
f
10% o
Better ROS Builds
with Nix

https://github.com/mikepurvis

Ivor Wanders
Navigation Manager
https://github.com/iwanders

ROSCon 2022 | Kyoto, Japan

Contents
1. ROS packaging
2. Nix terms & primer
3. Building ROS packages in Nix
4. Using ROS packages from Nix
5. Closing remarks

How Do You Package ROS?
bloom + ros_buildfarm

snapshot / bundles / containers● incremental builds / upgrades● version clarity, rollbacks possible● tagging required for binaries● high build, storage, transfer cost

● no full-system versioning● custom tooling, especially around delta builds● no rollback story

How Do You Package ROS?
bloom + ros_buildfarm

snapshot / bundles / containers● incremental builds / upgrades● version clarity, rollbacks possible● tagging required for binaries● high build, storage, transfer cost

● no full-system versioning● custom tooling, especially around delta builds● no rollback story

How Do You Package ROS?
bloom + ros_buildfarm

snapshot / bundles / containers● incremental builds / upgrades● version clarity, rollbacks possible● tagging required for binaries● high build, storage, transfer cost

● no full-system versioning● custom tooling, especially around delta builds● no rollback story

What is Nix?
A DSL for describing packages-> nix

A package manager / builder-> NixA repository of packages-> nixpkgs

An declarative operating system-> NixOS

What is Nix?

Patches, Metadata, etc
fancy-package_amd64_1.0-0.deb
Upstream Source

What is Nix?
Compiler
Headers, Libraries
Patches, Metadata, etc
fancy-package_amd64_1.0-0.deb

Tools / Helpers

Conﬁguration

Upstream Source

What is Nix?
Compiler
Headers, Libraries

Human-readable
name and version
Patches

Tools / Helpers
SourceConﬁguration/nix/store/mczz86ndimpcw9vwaqh9lks170acl0fa

Package Identiﬁcation● Packages are described asfunctions in the Nix language

stdenv.mkDerivation {pname = "canfestival";version = "3.0.4";
src = fetchFromClearpathGitLab {owner = "forks";
repo = "canfestival-3";
rev = "605fc6a2adf250d50dd22ac4f1d527e3a21a58a3";
hash = "sha256-os3qbS1Dbg2ya5McUlo0W8xcz8mealwgr90eZeErQzM=";};
propagatedNativeBuildInputs = [ python3 ];configurePhase = ''bash configure --prefix=$out --can=socket --wx=0'';}

Package Identiﬁcation● Packages are described asfunctions in the Nix language● Nix evaluates this into a
derivation structure which
captures the entire input forthe package build.

$ nix show-derivation clearpath#canfestival{"/nix/store/4pwklyajqgx61yqs0dl3q9xwfy3692y0-canfestival-3.0.4.drv": {"outputs": {"out": {"path": "/nix/store/rn9asxp3fjxyj9xwgdv36b92x1n8w33b-canfestival-3.0.4"}},"inputSrcs": ["/nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25b-default-builder.sh"],"inputDrvs": {"/nix/store/9nl7galmmj9n61jw6dkfv7w3zcqcf1j5-source.drv": ["out"],"/nix/store/bqfy8ydlxs0xhzqmy7rc3zjw60vwab6j-stdenv-linux.drv": [
"out"
],

Package Identiﬁcation● Packages are described asfunctions in the Nix language● Nix evaluates this into a
derivation structure which
captures the entire input forthe package build.
● Nix stores the result of thebuild in a path based on thehash of this structure.

$ nix path-info clearpath#canfestival/nix/store/rn9asxp3fjxyj9xwgdv36b92x1n8w33b-canfestival-3.0.4$ ll /nix/store/rn9asxp3fjxyj9xwgdv36b92x1n8w33b-canfestival-3.0.4/lib
total 96-r--r--r-- 1 root root 65380 Jan 1 1970 libcanfestival.a-r-xr-xr-x 1 root root 18200 Jan 1 1970 libcanfestival_can_socket.so-r--r--r-- 1 root root 12142 Jan 1 1970 libcanfestival_unix.a

Package Identiﬁcation● Packages are described asfunctions in the Nix language● Nix evaluates this into a
derivation structure which
captures the entire inputs forthe package build.
● Nix stores the result of the$ nix path-info clearpath#canfestival/nix/store/rn9asxp3fjxyj9xwgdv36b92x1n8w33b-canfestival-3.0.4$ ll /nix/store/rn9asxp3fjxyj9xwgdv36b92x1n8w33b-canfestival-3.0.4/lib
total 96-r--r--r-- 1 root root 65380 Jan 1 1970 libcanfestival.a-r-xr-xr-x 1 root root 18200 Jan 1 1970 libcanfestival_can_socket.so-r--r--r-- 1 root root 12142 Jan 1 1970 libcanfestival_unix.abuild in a path based on thehash of this structure.
If anything captured by the derivation changes, the hash changes andfrom Nix’s perspective, it becomes a completely different package.

Requirements● A frozen rosdistro distribution.yaml (all version attributes changed hashes)● The package.xml data from all packages (for dependency info)● The content hash of the source of every package (for nix purity)

A single package
canfestival_ros:source:type: git
url: git@gitlab.clearpathrobotics.com:software/canfestival_ros.git
version: 24db50db6626a0cac958590148347b66244a59d2
status_description: 'Branch: devel'
canopen_service:
source:type: git
url: git@gitlab.clearpathrobotics.com:clearpath-os/canopen_service.git
version: 6f410b7b35526cf087187c3ca36fb5fc327e34cd
status_description: 'Branch: devel'A single package
canfestival_ros:source:type: git
url: git@gitlab.clearpathrobotics.com:software/canfestival_ros.git
version: 24db50db6626a0cac958590148347b66244a59d2
status_description: 'Branch: devel'
canopen_service:
source:type: git
{ pkgSrc, fetchFromClearpathGitLab }:url: git@gitlab.clearpathrobotics.com:clearpath-os/canopen_service.git
letversion: 6f410b7b35526cf087187c3ca36fb5fc327e34cd
pkg = pkgSrc (fetchFromClearpathGitLab {status_description: 'Branch:owner
devel'= "software";repo = "canfestival_ros";rev = "24db50db6626a0cac958590148347b66244a59d2";
hash = "sha256-nnzpYHjgZuqFBVI3Jx3FycJptpF48HgA3ReILM+alL4=";
name = "software-canfestival_ros-24db50db6626a0cac958590148347b66244a59d2";});
in{canfestival_ros = pkg "sha256-nnzpYHjgZuqFBVI3Jx3FycJptpF48HgA3ReILM+alL4="".";}

A single package
canfestival_ros:source:type: git
url: git@gitlab.clearpathrobotics.com:software/canfestival_ros.git
version: 24db50db6626a0cac958590148347b66244a59d2
status_description: 'Branch: devel'<?xml version="1.0"?>
canopen_service:<package format="2">
source:<name>canfestival_ros</name>type: git<version>0.9.2</version>
url: git@gitlab.clearpathrobotics.com:clearpath-os/canopen_service.git<description>CANfestival library wrapper for ROS</description>version: 6f410b7b35526cf087187c3ca36fb5fc327e34cd
status_description: 'Branch: devel'<maintainer email="<>@clearpath.ai">Jeffrey G</maintainer><license>Proprietary</license><buildtool_depend>catkin</buildtool_depend><build_depend>boost</build_depend><depend>roscpp</depend><depend>canfestival-devel</depend><depend>canfestival-socket</depend><exec_depend>canfestival-objdictedit</exec_depend><test_depend>roslint</test_depend></package>

A single package{ pkgSrc, fetchFromClearpathGitLab }:{letboost, canfestival, catkin, roscpp, roslint,
pkg = pkgSrc (fetchFromClearpathGitLab {owner = "software";buildColconPackage, final, srcs,
repo = "canfestival_ros";}:rev = "24db50db6626a0cac958590148347b66244a59d2"; buildColconPackage {hash = "sha256-nnzpYHjgZuqFBVI3Jx3FycJptpF48HgA3ReILM+alL4=";
name = "canfestival_ros";name = "software-canfestival_ros-24db50db6626a0cac958590148347b66244a59d2";
pkgFinal = final.ros.canfestival_ros;});
src = srcs.canfestival_ros.canfestival_ros;in{canfestival_ros = pkg "sha256-nnzpYHjgZuqFBVI3Jx3FycJptpF48HgA3ReILM+alL4="
colconBuildDepends = [ ".";
boost canfestival catkin roscpp ];}colconRunDepends = [ canfestival roscpp ];<buildtool_depend>catkin</buildtool_depend><build_depend>boost</build_depend><depend>roscpp</depend><depend>canfestival-devel</depend><depend>canfestival-socket</depend><exec_depend>canfestival-objdictedit</exec_depend><test_depend>roslint</test_depend>colconTestDepends = [ roslint ];}Architecture
Freezedistribution

rosdistro repo
- distribution.yaml- snapshots

Hydra
Nix file generation

nix support repo
- buildColconPackage- buildColconWorkspace- overrides- other tooling

nix flake repo
- .nix files per snapshot

Developers
CI testingConsuming Nix built ROS$ nix build clearpath/2.28.0-20220913134929-0#ros.ros_base.ws.contents[0/119 built, 1/14/464 copied (141.7/1381.8 MiB), 146.3 MiB DL] fetching linux-headers-5.14 from http://172.17.0.1:5000[0/115 built, 1/46/464 copied (229.5/1381.8 MiB), 240.3 MiB DL] fetching glibc-2.33-50-bin from http://172.17.0.1:5000[0/103 built, 1/195/464 copied (582.1/1381.8 MiB), 610.4 MiB DL] fetching boost-1.73.0 from http://172.17.0.1:5000[0/102 built, 1/198/464 copied (732.3/1381.8 MiB), 763.5 MiB DL] fetching gcc-10.3.0 from http://172.17.0.1:5000[0/52 built, 1/391/464 copied (1254.5/1381.8 MiB), 1311.1 MiB DL] fetching cpp_common from http://172.17.0.1:5000[0/39 built, 1/410/464 copied (1271.8/1381.8 MiB), 1330.4 MiB DL] fetching nav_msgs from http://172.17.0.1:5000[1/2/4 built, 464 copied (1426.5 MiB), 1491.1 MiB DL] building ros_base-merged[1/3/4 built, 464 copied (1426.5 MiB), 1491.1 MiB DL] building ros_base-2.28.0-20220913134929-0

Consuming Nix built ROS$ nix build clearpath/2.28.0-20220913134929-0#ros.ros_base.ws.contents[0/119 built, 1/14/464 copied (141.7/1381.8 MiB), 146.3 MiB DL] fetching linux-headers-5.14 from http://172.17.0.1:5000[0/115 built, 1/46/464 copied (229.5/1381.8 MiB), 240.3 MiB DL] fetching glibc-2.33-50-bin from http://172.17.0.1:5000[0/103 built, 1/195/464 copied (582.1/1381.8 MiB), 610.4 MiB DL] fetching boost-1.73.0 from http://172.17.0.1:5000[0/102 built, 1/198/464 copied (732.3/1381.8 MiB), 763.5 MiB DL] fetching gcc-10.3.0 from http://172.17.0.1:5000[0/52 built, 1/391/464 copied (1254.5/1381.8 MiB), 1311.1 MiB DL] fetching cpp_common from http://172.17.0.1:5000[0/39 built, 1/410/464 copied (1271.8/1381.8 MiB), 1330.4 MiB DL] fetching nav_msgs from http://172.17.0.1:5000[1/2/4 built, 464 copied (1426.5 MiB), 1491.1 MiB DL] building ros_base-merged[1/3/4 built, 464 copied (1426.5 MiB), 1491.1 MiB DL] building ros_base-2.28.0-20220913134929-0$ ls -l result
lrwxrwxrwx 1 root root 76 Sep 22 17:06 result -> /nix/store/xvvrnam0mw724fkavngxs5zxs4cmf84i-ros_base-2.28.0-20220913134929-0

Consuming Nix built ROS$ nix build clearpath/2.28.0-20220913134929-0#ros.ros_base.ws.contents[0/119 built, 1/14/464 copied (141.7/1381.8 MiB), 146.3 MiB DL] fetching linux-headers-5.14 from http://172.17.0.1:5000[0/115 built, 1/46/464 copied (229.5/1381.8 MiB), 240.3 MiB DL] fetching glibc-2.33-50-bin from http://172.17.0.1:5000[0/103 built, 1/195/464 copied (582.1/1381.8 MiB), 610.4 MiB DL] fetching boost-1.73.0 from http://172.17.0.1:5000[0/102 built, 1/198/464 copied (732.3/1381.8 MiB), 763.5 MiB DL] fetching gcc-10.3.0 from http://172.17.0.1:5000[0/52 built, 1/391/464 copied (1254.5/1381.8 MiB), 1311.1 MiB DL] fetching cpp_common from http://172.17.0.1:5000[0/39 built, 1/410/464 copied (1271.8/1381.8 MiB), 1330.4 MiB DL] fetching nav_msgs from http://172.17.0.1:5000[1/2/4 built, 464 copied (1426.5 MiB), 1491.1 MiB DL] building ros_base-merged[1/3/4 built, 464 copied (1426.5 MiB), 1491.1 MiB DL] building ros_base-2.28.0-20220913134929-0$ ls -l result
lrwxrwxrwx 1 root root 76 Sep 22 17:06 result -> /nix/store/xvvrnam0mw724fkavngxs5zxs4cmf84i-ros_base-2.28.0-20220913134929-0$ls -lr result/merged/share/ | headtotal 296
xmlrpcpp -> /nix/store/jg8kgiwv7q3h101kx5ac12gqh0vb50gy-xmlrpcpp/share/xmlrpcpp
visualization_msgs -> /nix/store/nasbk2s7rzwfq6nzdn6ddxy4vwrzcr3x-visualization_msgs/share/visualization_msgs
trajectory_msgs -> /nix/store/8792xra049hlg6zcfwa1gy1a3ynmx3hj-trajectory_msgs/share/trajectory_msgs
topic_tools -> /nix/store/9f8f9ia6apvd3pv57yjmnnpnl0mm0ac3-topic_tools/share/topic_tools
stereo_msgs -> /nix/store/id9wgzl3bjk2z1f3c2knjnp0hnvbn9v2-stereo_msgs/share/stereo_msgs
std_srvs -> /nix/store/jb7igsh199zxcz69dlm23xspxc0j60rl-std_srvs/share/std_srvs

The environment/demo$ nix develop clearpath/2.28.0-20220913134929-0#ros.ros_base.ws
2.28.0-20220913134929-0#ros_base:/demo$

The environment/demo$ nix develop clearpath/2.28.0-20220913134929-0#ros.ros_base.ws
2.28.0-20220913134929-0#ros_base:/demo$

2.28.0-20220913134929-0#ros_base:/demo$ echo $ROS_PACKAGE_PATH/nix/store/wnyiwm73mm6arl606wjqxwvhi7kzx0sp-ros_base-merged/share

The environment/demo$ nix develop clearpath/2.28.0-20220913134929-0#ros.ros_base.ws
2.28.0-20220913134929-0#ros_base:/demo$

2.28.0-20220913134929-0#ros_base:/demo$ echo $ROS_PACKAGE_PATH/nix/store/wnyiwm73mm6arl606wjqxwvhi7kzx0sp-ros_base-merged/share

2.28.0-20220913134929-0#ros_base:/demo$ echo $COLCON_HOME/nix/store/dnncy2f99bvjfz5pm7m19hsvwyybk57c-colcon-home-0.0.1

The environment/demo$ nix develop clearpath/2.28.0-20220913134929-0#ros.ros_base.ws
2.28.0-20220913134929-0#ros_base:/demo$

2.28.0-20220913134929-0#ros_base:/demo$ echo $ROS_PACKAGE_PATH/nix/store/wnyiwm73mm6arl606wjqxwvhi7kzx0sp-ros_base-merged/share

2.28.0-20220913134929-0#ros_base:/demo$ echo $COLCON_HOME/nix/store/dnncy2f99bvjfz5pm7m19hsvwyybk57c-colcon-home-0.0.1

2.28.0-20220913134929-0#ros_base:/demo$ which gcc/nix/store/s5hkav7whndbfz0szshpb46h4idqdq9a-gcc-wrapper-10.3.0/bin/gcc

Building a workspace
2.28.0-20220913134929-0#ros_base:/demo/ws$ cd ws/
2.28.0-20220913134929-0#ros_base:/demo/ws$ colcon build[0.2s] [0/0 complete]
Starting >>> roscpp_tutorials[0.3s] [0/1 complete] [roscpp_tutorials:cmake - 0.1s][3.0s] [0/1 complete] [roscpp_tutorials:cmake - 2.8s][3.5s] [0/1 complete] [roscpp_tutorials:build 8% - 3.3s][8.0s] [0/1 complete] [roscpp_tutorials:build 37% - 7.7s][15.5s] [0/1 complete] [roscpp_tutorials:build 97% - 15.2s]
Finished <<< roscpp_tutorials [17.3s]
Summary: 1 package finished [17.6s]

Building a workspace
2.28.0-20220913134929-0#ros_base:/demo/ws$ cd ws/
2.28.0-20220913134929-0#ros_base:/demo/ws$ colcon build[0.2s] [0/0 complete]
Starting >>> roscpp_tutorials[0.3s] [0/1 complete] [roscpp_tutorials:cmake - 0.1s][3.0s] [0/1 complete] [roscpp_tutorials:cmake - 2.8s][3.5s] [0/1 complete] [roscpp_tutorials:build 8% - 3.3s][8.0s] [0/1 complete] [roscpp_tutorials:build 37% - 7.7s][15.5s] [0/1 complete] [roscpp_tutorials:build 97% - 15.2s]
Finished <<< roscpp_tutorials [17.3s]
Summary: 1 package finished [17.6s]
2.28.0-20220913134929-0#ros_base:/demo/ws$ source install/setup.bash
2.28.0-20220913134929-0#ros_base:/demo/ws$ echo $ROS_PACKAGE_PATH/demo/ws/install/share:/nix/store/wnyiwm73mm6arl606wjqxwvhi7kzx0sp-ros_base-merged/shareBuilding a workspace
2.28.0-20220913134929-0#ros_base:/demo/ws$ cd ws/
2.28.0-20220913134929-0#ros_base:/demo/ws$ colcon build[0.2s] [0/0 complete]
Starting >>> roscpp_tutorials[0.3s] [0/1 complete] [roscpp_tutorials:cmake - 0.1s][3.0s] [0/1 complete] [roscpp_tutorials:cmake - 2.8s][3.5s] [0/1 complete] [roscpp_tutorials:build 8% - 3.3s][8.0s] [0/1 complete] [roscpp_tutorials:build 37% - 7.7s][15.5s] [0/1 complete] [roscpp_tutorials:build 97% - 15.2s]
Finished <<< roscpp_tutorials [17.3s]
Summary: 1 package finished [17.6s]
2.28.0-20220913134929-0#ros_base:/demo/ws$ source install/setup.bash
2.28.0-20220913134929-0#ros_base:/demo/ws$ echo $ROS_PACKAGE_PATH/demo/ws/install/share:/nix/store/wnyiwm73mm6arl606wjqxwvhi7kzx0sp-ros_base-merged/share
2.28.0-20220913134929-0#ros_base:/demo/ws$ rosrun roscpp_tutorials talker[ INFO] [1663868287.133826774]: hello world 0[ INFO] [1663868287.233899760]: hello world 1[ INFO] [1663868287.333887589]: hello world 2[ INFO] [1663868287.434151743]: hello world 3[ INFO] [1663868287.533945368]: hello world 4[ INFO] [1663868287.633979542]: hello world 5[ INFO] [1663868287.733976728]: hello world 6[ INFO] [1663868287.833986026]: hello world 7

Versions and environments$ nix develop clearpath/2.28-devel#ros.ros_base.ws[0/1 built] querying info about missing paths
2.28.0-20220922164904-0#ros_base:/demo$
2.28.0-20220922164904-0#ros_base:/demo$ exit
$ nix develop clearpath/2.26-devel#ros.ros_base.ws[0/1 built] querying info about missing paths
2.26.2-20220921023444-0#ros_base:/demo$
2.26.2-20220921023444-0#ros_base:/demo$ exit

Versions and environments$ nix develop clearpath/2.28-devel#ros.ros_base.ws[0/1 built] querying info about missing paths
2.28.0-20220922164904-0#ros_base:/demo$
2.28.0-20220922164904-0#ros_base:/demo$ exit
$ nix develop clearpath/2.26-devel#ros.ros_base.ws[0/1 built] querying info about missing paths
2.26.2-20220921023444-0#ros_base:/demo$
2.26.2-20220921023444-0#ros_base:/demo$ exit
$ nix develop clearpath/devel#ros.roscpp.debugEnv[0/10 built, 1/1/8 copied (0.0/13.8 MiB), 0.0 MiB DL] fetching cpp_common-debug from http://172.17.0.1:5000[0/9 built, 1/2/8 copied (0.1/13.8 MiB), 0.1 MiB DL] fetching lndir-1.0.3 from http://172.17.0.1:5000[0/7 built, 1/4/8 copied (1.3/13.8 MiB), 1.4 MiB DL] fetching roscpp-debug from http://172.17.0.1:5000[0/7 built, 1/4/8 copied (1.3/13.8 MiB), 1.4 MiB DL] fetching roscpp-debug from http://172.17.0.1:5000[0/7 built, 1/4/8 copied (1.3/13.8 MiB), 1.4 MiB DL] fetching roscpp-debug from http://172.17.0.1:5000[1/2/3 built, 8 copied (13.3/13.8 MiB), 13.8 MiB DL] building roscpp-debugEnv-env
2.28.0-20220922164904-0#roscpp-debugEnv:/demo$
2.28.0-20220922164904-0#roscpp-debugEnv:/demo$ echo $NIX
$NIX_BUILD_CORES$NIX_BUNDLE_TAG$NIX_CFLAGS_COMPILE$NIX_ENFORCE_NO_NATIVE$NIX_INDENT_MAKE$NIX_LIB64_IN_SELF_RPATH $NIX_STORE$NIX_BUILD_TOP$NIX_BUNDLE_TYPE$NIX_DEBUG_INFO_DIRS$NIX_GCROOT$NIX_LDFLAGS
2.28.0-20220922164904-0#roscpp-debugEnv:/demo$ echo $NIX_DEBUG_INFO_DIRS/nix/store/s45z7glh9g0qf4appwnahww4lfisrlhj-roscpp-debug-dir/lib/debug/

Tests in Nix$ nix build clearpath/2.28.0-20220913134929-0#ros.svg_draw_tool.test[1/5 built, 1/11/13 copied (0.3/5.3 MiB), 0.4 MiB DL] fetching svg_draw_tool-build from http://172.17.0.1:5000[1/1/3 built, 13 copied (5.3/5.3 MiB), 5.5 MiB DL] building svg_draw_tool-testCompile (unpackPhase)[1/1/3 built, 13 copied (5.3/5.3 MiB), 5.5 MiB DL] building svg_draw_tool-testCompile (patchPhase)[1/1/3 built, 13 copied (5.3/5.3 MiB), 5.5 MiB DL] building svg_draw_tool-testCompile (buildPhase)
svg_draw_tool-testCompile> -- Using CATKIN_DEVEL_PREFIX: /tmp/nix-build-svg_draw_tool-testCompile.drv-0/build/svg_draw_tool/devel
svg_draw_tool-testCompile> -- This workspace overlays: /nix/store/1n1wylana68i3bnw66ggzk0dzy8rgfm4-catkinsvg_draw_tool-testCompile> -- Found gtest sources under '/nix/store/9fia6ynqsva9l0mjdfcv5s2jwim09mii-gtest-src': gtests will be b
svg_draw_tool-testCompile> [ 1%] Building CXX object gtest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.osvg_draw_tool-testCompile> [ 53%] Building CXX object CMakeFiles/draw_tool_test.dir/test/draw_tool_test.cpp.o
svg_draw_tool-testCompile> [ 84%] Linking CXX executable devel/lib/svg_draw_tool/draw_minimal
svg_draw_tool-testCompile> Finished <<< svg_draw_tool [17.9s][1/1/3 built, 13 copied (5.3/5.3 MiB), 5.5 MiB DL] building svg_draw_tool-testCompile (fixupPhase)[2/3 built, 13 copied (5.3/5.3 MiB), 5.5 MiB DL]

Tests in Nix$ nix build clearpath/2.28.0-20220913134929-0#ros.svg_draw_tool.test[1/5 built, 1/11/13 copied (0.3/5.3 MiB), 0.4 MiB DL] fetching svg_draw_tool-build from http://172.17.0.1:5000[1/1/3 built, 13 copied (5.3/5.3 MiB), 5.5 MiB DL] building svg_draw_tool-testCompile (unpackPhase)[1/1/3 built, 13 copied (5.3/5.3 MiB), 5.5 MiB DL] building svg_draw_tool-testCompile (patchPhase)[1/1/3 built, 13 copied (5.3/5.3 MiB), 5.5 MiB DL] building svg_draw_tool-testCompile (buildPhase)
svg_draw_tool-testCompile> -- Using CATKIN_DEVEL_PREFIX: /tmp/nix-build-svg_draw_tool-testCompile.drv-0/build/svg_draw_tool/devel
svg_draw_tool-testCompile> -- This workspace overlays: /nix/store/1n1wylana68i3bnw66ggzk0dzy8rgfm4-catkinsvg_draw_tool-testCompile> -- Found gtest sources under '/nix/store/9fia6ynqsva9l0mjdfcv5s2jwim09mii-gtest-src': gtests will be b
svg_draw_tool-testCompile> [ 1%] Building CXX object gtest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.osvg_draw_tool-testCompile> [ 53%] Building CXX object CMakeFiles/draw_tool_test.dir/test/draw_tool_test.cpp.o
svg_draw_tool-testCompile> [ 84%] Linking CXX executable devel/lib/svg_draw_tool/draw_minimal
svg_draw_tool-testCompile> Finished <<< svg_draw_tool [17.9s][1/1/3 built, 13 copied (5.3/5.3 MiB), 5.5 MiB DL] building svg_draw_tool-testCompile (fixupPhase)[2/3 built, 13 copied (5.3/5.3 MiB), 5.5 MiB DL][1/2/3 built, 13 copied (5.3/5.3 MiB), 5.5 MiB DL] building svg_draw_tool-test
svg_draw_tool-test> Starting >>> svg_draw_tool
svg_draw_tool-test> 1: [==========] Running 1 test from 1 test suite.
svg_draw_tool-test> 1: [ RUN] TestSVGDrawTool.test_minimal
svg_draw_tool-test> 1: [OK ] TestSVGDrawTool.test_minimal (1 ms)
svg_draw_tool-test> 1: [==========] 1 test from 1 test suite ran. (1 ms total)
svg_draw_tool-test> 1: [ PASSED ] 1 test.
svg_draw_tool-test> Finished <<< svg_draw_tool [1.33s]
svg_draw_tool-test> /nix/store/4zx9ib2yqd5r57d1b44759wvhi95kj4z-svg_draw_tool-test/test_results/svg_draw_tool/Testing/20220922-19
0 errors, 0 failures, 0 skipped
svg_draw_tool-test> Summary: 13 tests, 0 errors, 0 failures, 0 skippedOverrides
pcl = (prev.pcl.override {= final.ros.boost;● boost
Nix overrides
give superpowers.
withCuda = true;}).overrideAttrs(old: {propagatedBuildInputs = old.propagatedBuildInputs ++ [ final.xorg.libXt ];CXXFLAGS = "${toString final.clearpathCompileFlags} -std=c++11";
patches = [# https://jira.clearpathrobotics.com/browse/CORE-21988(final.fetchpatch {url = "https://github.com/PointCloudLibrary/pcl/commit/614e19d96bd8415dbfb52d86df0f3774a9f462fe.patch";sha256 = "sha256-mI4gPpoZdGA26ST8YLfeNUWTNCUoWeW61flc5f1BF9U=";
})
];
});

Closing remarks● True delta builds and downloads.
● All versions locked in and consistent, including the underlying system.
● Uniformity between ros1 and ros2.

Closing remarks● True delta builds and downloads.
● All versions locked in and consistent, including the underlying system.
● Uniformity between ros1 and ros2.
● Nix language can be a barrier.
● Conceptual leap relative to apt.
● Host-Nix interactions can be ﬁnicky (eg: CUDA, QT5, glibc modules).

Closing remarks● True delta builds and downloads.
● All versions locked in and consistent, including the underlying system.
● Uniformity between ros1 and ros2.
● Nix language can be a barrier.
● Conceptual leap relative to apt.
● Host-Nix interactions can be ﬁnicky (eg: CUDA, QT5, glibc modules).
● Old bundle builds took 144 cores, nix based builds take 12 cores.
● Daily updates are 10s-100s of megabytes vs several gigabytes.
● Pipelines are much faster (20 mins vs 1.5 hours).

Thanks● Our colleagues at Clearpath for tolerating all the disruption this change has brought,
and being willing to try out a new way of doing things, even when the beneﬁts to theindividuals were not immediately obvious.
● The Nix community for the immense work that has gone into Nix and nixpkgs since
the project’s inception in 2003.
● Ben Wolsieffer for his inspiring work packaging ROS for Nix— check it out on his
Github as a supplement to this talk: https://github.com/lopsided98/nix-ros-overlay

LinksSelf-Guided Demonstration- https://github.com/clearpathrobotics/nix-ros-base- https://github.com/clearpathrobotics/nix-ros- https://github.com/clearpathrobotics/rosdistro-snapshots
Tools- https://github.com/clearpathrobotics/colcon-distro- https://github.com/clearpathrobotics/colcon-nix