Yes, that is roughly what I am proposing.
Thanks, that is much more clear.
I really appreciate the boldness, but I guess the only realistic way in which you can reach consensus on moving from package.xml
to a turing-complete nix
-specific DSL is that the vast majority of ROS users switch to use nix
. Note that “reaching consensus” also means convince people/companies in the ROS community to contribute work and/or fund work in that direction.
So I guess that improving documentation on how to already use ROS with Nix right now is both useful in the short term, and a prerequisite to convince everyone in the ROS community that they should stop using package.xml
.
To clarify one thing we’re thinking differently about, I don’t believe ROS was designed to be build system agnostic. package.xml
is a standard that is only used by ros-specific build tools,
I am not sure I got what you were trying to convey he. In particular, it is not clear what you mean with “build system” and “build tools”. Unfortunately there are not universal definition for these terms, but if we use the definitions mentioned in the article A universal build tool (that you already linked), we could define more and less as:
- build system: what is used to transform a source code of a package to a version of the package that can be used, like
cmake
, meson
, bazel
, autotools
, setuptools
- build tools: tool that is used to take many package, and call their build system to ensure that the packages can be used. This is what
colcon
is, but also build systems such as CMake
(via FetchContent
or ExternalProject
) or bazel
or other systems like nix
or Debian or Red Hat software to build apt or dnf packages can also fill that role when combined with bloom
or superflore
.
If we agree with these definition, I am not sure what you mean with “I don’t believe ROS was designed to be build system agnostic”. “build systems” do not consume package.xml
files, so I am not sure why build system play a role here.
so parsing nix expressions to port packages over to other package distribution methods would be logically equivalent to what is currently done using superflore and metadata within package.xml
files. And yes, ros-nix-overlay
currently is built using superflore and the data within package.xml
files. Admittedly parsing nix is a bit harder than xml or toml because nix is turing complete, so you’d probably need to write a function in nix that returns’ a set of all a package’s dependencies and write them somewhere.
“logically” equivalent does not mean that they are “pratically” equivalent. As you correctly point out, extracting metadata from turing complete DSL that require custom parsing is not exactly practical as just reading them from a simple package.xml
. Furthermore, not controlling the abstraction but using an existing format is problematic also as it is tricky to extend. Let’s say I want to declare a dependency on a package that is not available in nixos ? With package.xml
/rosdep
it is possible to define a custom key that is only resolved on a single distribution. Clearly, I can imagine you can define somehow find hacks and/or extensions to permit to do that on nix
flakes, but again I doubt you can find consensus on that until a large part of ROS users switches to use nix.