Jarvis is a build system optimized for MRover. It is designed to automate many tasks in assembling pieces of the rover software stack. It is implemented in Python 3 and uses a simple shell script to bootstrap itself.
From the root directory of this repository, run ./jarvis
, which will create
the Jarvis venv
, populate it, and display the list of Jarvis tasks.
NOTE: It is recommended to add an alias to your ~/.bashrc
or equivalent
to assist in invoking Jarvis. This has the benefit of being able to invoke
Jarvis from anywhere in the filesystem. This step is already done by our
Vagrant box.
Example for bash
:
# ~/.bashrc
alias jarvis='$HOME/mrover-workspace/jarvis'
Jarvis creates two virtual environments, one for Jarvis's own dependencies
(called the "Jarvis venv
"), and one for products of the build, called the
"product venv
". The product venv
is used as the target destination for
all parts of build -- C/C++ output executables are installed into the product
venv
as well as Python executables.
jarvis dep
:: Compile and install 3rd-party C/C++ dependencies (located in3rdparty/
) using instructions specified in thethird_party.py
file. After installing C/C++ dependencies, Jarvis will runpip-compile
on the contents ofexternal_requirements.in
to produceexternal_requirements.txt
, which will then be installed into the productvenv
.jarvis exec <command>
:: Runs a command in the productvenv
.jarvis clean
:: Wipes away the productvenv
, requiring a full re-build.jarvis implode
:: Wipes away the Jarvisvenv
, requiring a full re-bootstrap.jarvis build rover_msgs
:: Compiles the LCM descriptions inrover_msgs/
into both C++ and Python libraries and installs them into the productvenv
.jarvis build <target>
:: Lint, compile, test, then install<target>
into the productvenv
using the procedure described below.
All other Jarvis projects (anything with a project.ini
file) execute a lint,
then a compile, then a test, then an install into the product venv
.
In Python projects, the lint is carried out by flake8
, in C++, clang-tidy
is used.
Compiling Python is a no-op; compiling C++ will invoke the meson
build
system.
In Python, the testing system will run doctest
on all files located in the
src/
directory, and it will run pytest
on the test cases located in the
test/
directory. In C++, meson
has its own mechanism for registering test
cases, and that is used.
The products are then installed into the product venv
. In Python, an
executable is generated from the function main
located in src/__main__.py
,
and in C++, executables generated from meson
are installed into the
appropriate locations.
Technical documentation for the Jarvis build system is a work in progress. The
Python docstrings provided for the functions in buildsys/
ought to be
moderately useful for anyone who wishes to work on Jarvis, but improvements are
in the works.
Quality of life improvements, and a smaller, more orthogonal codebase.