Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pixi support in the robotology-superbuild #1683

Merged
merged 5 commits into from
Aug 10, 2024
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
51 changes: 51 additions & 0 deletions .github/workflows/pixi-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Pixi CI Workflow

on:
# on demand
workflow_dispatch:
inputs:
delete_pixi_lock:
description: 'If true, delete pixi.lock, to test against the latest version of dependencies.'
required: true
default: 'false'
pull_request:
schedule:
# * is a special character in YAML so you have to quote this string
# Execute a "nightly" build twice a week 2 AM UTC
- cron: '0 2 * * 2,5'

jobs:
build-with-pixi:
name: '[pixi:${{ matrix.os }}]'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build_type: [Release]
os: [ubuntu-22.04, macos-13, macos-14, windows-2019]

steps:
- uses: actions/checkout@v4

# On periodic jobs and when delete_pixi_lock option is true, delete the pixi.lock to check that the project compiles with latest version of dependencies
- name: Delete pixi.lock on scheduled jobs or if delete_pixi_lock is true
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.delete_pixi_lock == 'true')
shell: bash
run: |
rm pixi.lock

- name: Print used environment
shell: bash
run: |
env

- uses: prefix-dev/[email protected]

- name: Build
shell: bash -l {0}
run: |
# Avoid YCM complaining that the git user is not set
# Eventually we could consider removing that check in YCM
git config --global user.name PixiGHA User
git config --global user.email [email protected]
pixi run build-all
28 changes: 28 additions & 0 deletions .github/workflows/pixi-update-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Update pixi lock file

on:
# on demand
workflow_dispatch:

jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: prefix-dev/[email protected]
with:
pixi-version: "latest"
cache: false
- name: Update pixi lock file
run: |
rm pixi.lock
pixi install
- uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pixi-lock
title: Update pixi lock file
commit-message: "Update `pixi.lock`"
body: Update pixi dependencies to the latest version.
author: "GitHub <[email protected]>"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ CTestTestfile.cmake
*kdev*
/src/
*.user
# pixi environments
.pixi
*.egg-info
# build directory used by pixi
/.build/
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ For the list of actually available tags, see the [GitHub's releases page](https:

Once you cloned the repo, to go forward you can follow the different instructions on how to install robotology-superbuild from the source code, depending on your operating system and the package manager you want to use to install the required dependencies:
* [**Linux with dependencies provided by apt**](#linux-from-source-with-dependencies-provided-by-apt): use the superbuild on Debian/Ubuntu distributions installing the dependencies with apt,
* [**Linux, macOS or Windows with dependencies provided by conda-forge**](#linux-macos-or-windows-from-source-with-dependencies-provided-by-conda-forge): use the superbuild on any supported operating system, installing the dependencies with conda package manager,
* [**Linux, macOS or Windows with dependencies provided by conda-forge**](#linux-macos-or-windows-from-source-with-dependencies-provided-by-conda-forge): use the superbuild on any supported operating system, installing the dependencies with conda or pixi package manager,
* [**Windows Subsystem For Linux**](#windows-subsystem-for-linux-from-source): use the superbuild on [Windows Subsystem For Linux](https://docs.microsoft.com/en-us/windows/wsl/about).

The exact versions of the operating systems supported by the robotology-superbuild follow the one supported by the YARP library, that are documented in https://github.com/robotology/yarp/blob/master/.github/CONTRIBUTING.md#supported-systems .
Expand Down Expand Up @@ -203,7 +203,9 @@ If for any reason you do not want to use the provided `setup.sh` script and you

## Linux, macOS or Windows from source with dependencies provided by conda-forge

Please refer to [`doc/conda-forge.md`](doc/conda-forge.md) document for instruction on how to compile the superbuild from source using the conda-forge provided dependencies, in particular the [`Source Installation`](doc/conda-forge.md#source-installation) section.
If you want to use the `conda` package manager refer to [`doc/conda-forge.md`](doc/conda-forge.md) document for instruction on how to compile the superbuild from source using the conda-forge provided dependencies, in particular the [`Source Installation`](doc/conda-forge.md#source-installation) section.

Otherwise, if you want to use the `pixi` package manager to install and build the superbuild, refer to the [`doc/pixi.md`](doc/pixi.md) document.

## Windows Subsystem for Linux from source

Expand Down
2 changes: 1 addition & 1 deletion doc/conda-forge.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ For some [profile](doc/cmake-options.md#profile-cmake-options) or [dependency](d

To install python and the other required dependencies when using `conda-forge` provided dependencies, use:
~~~
conda install -c conda-forge python numpy swig pybind11 pyqt matplotlib h5py tornado u-msgpack-python pyzmq ipython gst-plugins-good gst-plugins-bad pyqtwebengine qtpy pyyaml
conda install -c conda-forge python pip numpy swig pybind11 pyqt matplotlib h5py tornado u-msgpack-python pyzmq ipython gst-plugins-good gst-plugins-bad pyqtwebengine qtpy pyyaml
~~~

#### `ROBOTOLOGY_USES_PCL_AND_VTK`
Expand Down
41 changes: 41 additions & 0 deletions doc/pixi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# pixi

Pixi is a package management tool for developers, tt allows the developer to install libraries and applications in a reproducible way. For more information about pixi a, check [pixi's website](https://pixi.sh/).

IF you have pixi installed, to compile the superbuild with all options enabled, just run the following commands:

~~~
git clone https://github.com/robotology/robotology-superbuild/
cd robotology-superbuild
pixi run build-all
~~~

This creates a CMake build of the superbuild in the `robotology-superbuild/.build` folder.

> [!IMPORTANT]
> All the dependencies of the superbuild are automatically downloaded and installed in the `robotology-superbuild/.pixi` directory by pixi itself. If you are on Windows, the only additional dependency that you need to install manually is the VS2019 C++ compiler installed in your system.

> [!WARNING]
> Due to the high number of threads created by robotology-superbuild's project for compilation, it can happen that the build stops as the system run out of memory. In that case, run again `pixi run build-all` and the build will resume from the point at which it halted.


After this process completly successfully, you can access all the software compiled by the superbuild by moving in the `robotology-superbuild` directory and run `pixi run <command>` (to launch a single command) or `pixi shell` (to open a terminal in which the superbuild software is available).

For example, to run the `idyntree-model-info` program, you can run:

~~~
pixi run idyntree-model-info
~~~

or:

~~~
pixi shell
idyntree-model-info
~~~

If you want to customize the CMake options of the superbuild, you can modify them by running `pixi run build` (that will not enable any specific option), and then modify the cmake options of the superbuild via the command:

~~~
pixi run ccmake -B.build
~~~
Loading
Loading