Commit graph

101 commits

Author SHA1 Message Date
Michal Sojka
cf9ca51f69 Update comments describing head optimization 2025-04-18 13:48:14 +02:00
Michal Sojka
81c4e3656b Create directories for git cache if needed 2025-04-18 13:48:14 +02:00
Michal Sojka
a6c2ff98fb Use URL and prefix (directory) as git cache keys
Using URL instead of git revisions should ensure that the cache
doesn't grow indefinitely. With git revisions, the cache would be soon
full of mostly old revisions. The advantage using git revision is
that, for example, different branches of a repo can be cached
simultaneously. I hope, this is not the common usage pattern. And if
it is, one can always set XDG_CACHE_HOME variable to use different
caches for different branches.
2025-04-18 13:48:14 +02:00
Michal Sojka
c619c573f2 Use git cache by default 2025-04-18 13:48:14 +02:00
Max Beutelspacher
c309f53ac9 feat: add the option to store sha256 cache in a file
cache is also used for per package source checkouts and
<git-rev>-<package-prefix> is used as a key
2025-02-25 21:24:23 +01:00
Michal Sojka
c35b0dc7aa Fix merge_base_to_upstream()
The parameter was unused.
2025-02-10 08:39:35 +01:00
Michal Sojka
12a9d8de83 Update test/ros2nix to set correct argv[0] 2025-02-10 08:39:10 +01:00
Michal Sojka
6b1e2ed106
Merge pull request #18 from mbeutelspacher/feat/package_local_hash
feat: option for package local hash
2025-02-09 11:26:31 +01:00
Michal Sojka
83c13b8209 Add test for --use-per-package-src 2025-02-09 10:55:46 +01:00
Michal Sojka
5053709228 Use "non-cone mode" for --use-per-package-src
In cone mode (before this commit), the fetched sources contained not
only the specified subdirectory, but also the files in all its parent
directories. Non-cone mode means, that only the specified subdirectory
is fetched.
2025-02-09 10:55:46 +01:00
Max Beutelspacher
3567e9e85a Improve argument name for per-package-src
Co-authored-by: Michal Sojka <michal.sojka@cvut.cz>
2025-02-09 10:55:46 +01:00
Michal Sojka
f2893e44b9 Don't generate extra empty lines in src expressions 2025-02-09 10:55:46 +01:00
Michal Sojka
e523ecb7f5 Fix formatting and typos 2025-02-09 10:55:46 +01:00
Max Beutelspacher
2b569c35f0 feat: use sparse checkout if --use-package-git-hash is provided 2025-02-05 18:47:04 +01:00
github-actions[bot]
9ad84a3d7e rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/14382641c4cdf8d5c3249d2013edac9246a053b3?narHash=sha256-ik9WzB4J3zreeouP8dPRlEzhcsmGusDL00DWCUoAGjI%3D' (2025-01-24)
  → 'github:ros/rosdistro/c4b40f54befd0a6f1b4a1f9b9d233defe461e99a?narHash=sha256-QvkLNWdC%2BKwvg5UQ3KCHHtiwVEd319aA8lwXDYaB/dk%3D' (2025-02-04)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index dc80ce0..9c2c329 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -392,0 +393 @@
+  nixos: [python3Packages.py-ubjson]
2025-02-05 13:31:14 +01:00
Max Beutelspacher
72a061c8c1 feat: option for package local hash 2025-02-03 22:16:08 +01:00
github-actions[bot]
56677a3cbc rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/2c52cb3a4a23febbc5316f4950a2fd20928a2ac9?narHash=sha256-1TOROAuMOvgAi1C4vZD9CnnqLrkfpoj4yUPuzUdiif0%3D' (2025-01-23)
  → 'github:ros/rosdistro/14382641c4cdf8d5c3249d2013edac9246a053b3?narHash=sha256-ik9WzB4J3zreeouP8dPRlEzhcsmGusDL00DWCUoAGjI%3D' (2025-01-24)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index 5095fec..dc80ce0 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -161,0 +162 @@
+  nixos: [python3Packages.antlr4-python3-runtime]
@@ -199,0 +201 @@
+  nixos: [python3Packages.expiringdict]
@@ -204,0 +207 @@
+  nixos: [python3Packages.flake8-blind-except]
@@ -205,0 +209 @@
+  nixos: [python3Packages.flake8-class-newline]
@@ -206,0 +211 @@
+  nixos: [python3Packages.flake8-deprecated]
@@ -281,0 +287 @@
+  nixos: [python3Packages.pexpect]
@@ -286,0 +293 @@
+  nixos: [pre-commit]
@@ -332,0 +340 @@
+  nixos: [python3Packages.rich]
2025-01-24 22:04:18 +01:00
Michal Sojka
655e6a1cb4 github: Remove deprecated DeterminateSystems/magic-nix-cache-action 2025-01-23 16:37:14 +01:00
github-actions[bot]
e9b1c50f33 rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/75e54def2805272c98baf57126914655c7641ca0?narHash=sha256-K6kDCcXBFSVUpNjQ8Cj2p9Ai45FhmxzWqj4CtG5GO9E%3D' (2024-12-30)
  → 'github:ros/rosdistro/2c52cb3a4a23febbc5316f4950a2fd20928a2ac9?narHash=sha256-1TOROAuMOvgAi1C4vZD9CnnqLrkfpoj4yUPuzUdiif0%3D' (2025-01-23)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index 0d7b0e6..5095fec 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -382,0 +383 @@
+  nixos: [python3Packages.typing-extensions]
2025-01-23 16:29:00 +01:00
github-actions[bot]
546ade5de0 rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/555ea36685bebdb5929517593e2da5fce8a46fc9?narHash=sha256-CdLG91HOG9dJ2q9VnhFNAQAA2ToBPNB6qriCYDCPSJU%3D' (2024-12-04)
  → 'github:ros/rosdistro/75e54def2805272c98baf57126914655c7641ca0?narHash=sha256-K6kDCcXBFSVUpNjQ8Cj2p9Ai45FhmxzWqj4CtG5GO9E%3D' (2024-12-30)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index fd6e80c..604f57a 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -5 +5 @@
-  nixos: [pythonPackages.black]
+  nixos: [python3Packages.black]
@@ -275,0 +276 @@
+  nixos: [python3Packages.omniorb]
@@ -311,0 +313 @@
+  nixos: [python3Packages.pyside2]
@@ -315 +317 @@
-  nixos: [pythonPackages.pytest]
+  nixos: [python3Packages.pytest]
@@ -1086 +1088 @@
-  nixos: [pythonPackages.pybind11]
+  nixos: [python3Packages.pybind11]
2024-12-31 17:08:56 +01:00
Michal Sojka
239cee8bcb Don't add git version to generated patches 2024-12-29 15:48:58 +01:00
Michal Sojka
99af052d22 README: Document --patches 2024-12-28 17:08:45 +01:00
Michal Sojka
9406815aba Fix generating patches of independent packages in a single repo 2024-12-28 16:38:02 +01:00
Michal Sojka
c06d6087d3 Generate overlay with final and prev parameters
Otherwise `nix flake check` complains with:

    error: overlay does not take an argument named 'final'

This also changes which callPackage is called. Previously, we used
"super" (now prev), but we changed it to "final", because this seems
to be more correct (i.e. used in nixpkgs).
2024-12-28 11:14:23 +01:00
Michal Sojka
2ba5146201 Run tests during CI 2024-12-23 01:35:04 +01:00
Michal Sojka
6c5663f3c9 Allow manually triggering CI 2024-12-23 00:23:57 +01:00
Michal Sojka
773c31d355 Improve --patches documentation and regenerate README.md 2024-12-23 00:16:08 +01:00
Michal Sojka
dc3de1f289 Add experimental option --patches
This generates Nix expressions which include local patches (additional
commits in local git repositories).
2024-12-22 23:00:49 +01:00
Michal Sojka
9193811bfc Add autoware test 2024-12-22 22:38:39 +01:00
Michal Sojka
68126a4b82 Add test for --fetch 2024-12-22 22:24:58 +01:00
Michal Sojka
2669f6e7d9 Add more tests for --compare 2024-12-22 22:09:20 +01:00
Michal Sojka
6afabdfe02 Fix __main__ to exit with correct exit code 2024-12-22 22:02:11 +01:00
Michal Sojka
70a0703a0e Add initial version of test suite 2024-12-22 21:58:19 +01:00
Michal Sojka
b2de70cc66 Add ROS workspace that will be used by our planned test suite 2024-12-22 21:38:45 +01:00
Michal Sojka
a850550783 Don't fail with --compare when a .nix file is missing on disk
The switch --compare is typically used during CI, to check whether all
automatically generated files are up to date. When some files are
missing (e.g. a ROS package was added but its Nix expression was not
generated), ros2nix would fail with "FileNotFoundError" and would not
return exit code 2 as it should.

This commit fixes that. Missing files are reported with an error
message and execution continues. Exit code 2 is correctly reported.
2024-12-18 09:39:55 +01:00
github-actions[bot]
c42d7ecaa1 rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/00de49f5efa7b1060598d6e079193f2eed1d11ca?narHash=sha256-GU7ADCGL/zUVL6q7gz3LcB4sVwkqDYq2IQDcZMIfWto%3D' (2024-11-22)
  → 'github:ros/rosdistro/555ea36685bebdb5929517593e2da5fce8a46fc9?narHash=sha256-CdLG91HOG9dJ2q9VnhFNAQAA2ToBPNB6qriCYDCPSJU%3D' (2024-12-04)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index 81bc49a..1b486ab 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -281,0 +282 @@
+  nixos: [python3Packages.pillow]
2024-12-05 13:41:12 +01:00
github-actions[bot]
2657ec7c20 rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/b53353abe6d376416c00d41818219fa9467214ef?narHash=sha256-c20Tf6IvDiCKTpHGLKg7negZxpl/PfNs%2BbBKNZJiBIc%3D' (2024-11-21)
  → 'github:ros/rosdistro/00de49f5efa7b1060598d6e079193f2eed1d11ca?narHash=sha256-GU7ADCGL/zUVL6q7gz3LcB4sVwkqDYq2IQDcZMIfWto%3D' (2024-11-22)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index 0edc5e8..81bc49a 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -368,0 +369 @@
+  nixos: [python311Packages.textual]
2024-11-23 13:13:55 +01:00
github-actions[bot]
600e071f6c rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/a24be1af4d7449eb50c4eea5fe3debe16dbb1771?narHash=sha256-sj/mfhaabnJ4cxjtdVOBS48KD6fvn1/yApuo9J2YlHA%3D' (2024-11-18)
  → 'github:ros/rosdistro/b53353abe6d376416c00d41818219fa9467214ef?narHash=sha256-c20Tf6IvDiCKTpHGLKg7negZxpl/PfNs%2BbBKNZJiBIc%3D' (2024-11-21)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index 4475958..0edc5e8 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -200,0 +201 @@
+  nixos: [Fabric]
@@ -717,0 +719 @@
+  nixos: [fcl]
2024-11-21 13:22:23 +01:00
github-actions[bot]
4d23a0404b rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/5d3c90ee3df34578fcf0e93a6026dc1df852fb9e?narHash=sha256-UTKoYkXeGXx2erqaQAyiZDrxY4IFaLm4CopN%2BYxDbkk%3D' (2024-11-15)
  → 'github:ros/rosdistro/a24be1af4d7449eb50c4eea5fe3debe16dbb1771?narHash=sha256-sj/mfhaabnJ4cxjtdVOBS48KD6fvn1/yApuo9J2YlHA%3D' (2024-11-18)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index 9f843b7..4475958 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -7 +7 @@
-  nixos: [jupyter]
+  nixos: [python3Packages.notebook]
@@ -714,0 +715 @@
+  nixos: [exiv2]
@@ -1072,0 +1074 @@
+  nixos: [psmisc]
2024-11-19 13:29:34 +01:00
github-actions[bot]
6cac56645b rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/3b0cf448df6f53dc36496590c3f485edeb86aa75?narHash=sha256-dCopFR0sorpEAQYaQwfU3HCkHwKhpxS0kJzDQY9nhOc%3D' (2024-11-08)
  → 'github:ros/rosdistro/5d3c90ee3df34578fcf0e93a6026dc1df852fb9e?narHash=sha256-UTKoYkXeGXx2erqaQAyiZDrxY4IFaLm4CopN%2BYxDbkk%3D' (2024-11-15)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index 2c8aebb..9f843b7 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -242,0 +243 @@
+  nixos: [lensfun]
@@ -624,0 +626,2 @@
+  nixos: [lensfun]
+  nixos: [lensfun]
@@ -709,0 +713,2 @@
+  nixos: [libexif]
+  nixos: [libexif]
2024-11-16 13:35:04 +01:00
github-actions[bot]
1e7f2255d2 rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/54b5ed3529185302288f8c956942312791f7e32c?narHash=sha256-D8zTJ9YoTvjsVKCQ0FLB3IX1YFSkNsbqAlAMPrmiJHw%3D' (2024-10-30)
  → 'github:ros/rosdistro/3b0cf448df6f53dc36496590c3f485edeb86aa75?narHash=sha256-dCopFR0sorpEAQYaQwfU3HCkHwKhpxS0kJzDQY9nhOc%3D' (2024-11-08)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index c52799f..2c8aebb 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -239,0 +240 @@
+  nixos: [python3Packages.pyjwt]
@@ -462,0 +464 @@
+  nixos: [cli11]
2024-11-09 15:39:55 +01:00
github-actions[bot]
1e8383dbbf rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/1316fadf563b210ea096fa480eef63d362a7af3d?narHash=sha256-v3Dfmr67dPb/P9LNHBQj2Nb/A5qCQGwak4x4qQlehXU%3D' (2024-10-18)
  → 'github:ros/rosdistro/54b5ed3529185302288f8c956942312791f7e32c?narHash=sha256-D8zTJ9YoTvjsVKCQ0FLB3IX1YFSkNsbqAlAMPrmiJHw%3D' (2024-10-30)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index 462e25a..c52799f 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -310,0 +311 @@
+  nixos: [python3Packages.pytest-order]
2024-10-31 17:30:31 +01:00
github-actions[bot]
ee1e33fe36 rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/d7014cf14d8a1f9883ee0f8f2c85b7dba4d09670?narHash=sha256-Wsp7x8fTVYCIunL9HFLCOI4WbeUau/kYLCss1VWrJMI%3D' (2024-10-03)
  → 'github:ros/rosdistro/1316fadf563b210ea096fa480eef63d362a7af3d?narHash=sha256-v3Dfmr67dPb/P9LNHBQj2Nb/A5qCQGwak4x4qQlehXU%3D' (2024-10-18)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index adbcea5..462e25a 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -460,0 +461 @@
+  nixos: [clang]
2024-10-18 16:41:46 +02:00
github-actions[bot]
a5789a4e72 rosdistro update
Flake lock file updates:

• Updated input 'rosdistro':
    'github:ros/rosdistro/719a24cd571df99dcbf059d0b26ff6129877440a?narHash=sha256-aC4fmpKW5l6jva7sTM6msR%2BOT4NRg1xE46UUeLn8ddY%3D' (2024-09-23)
  → 'github:ros/rosdistro/d7014cf14d8a1f9883ee0f8f2c85b7dba4d09670?narHash=sha256-Wsp7x8fTVYCIunL9HFLCOI4WbeUau/kYLCss1VWrJMI%3D' (2024-10-03)

diff --git a/tmp/rosdistro-old.txt b/tmp/rosdistro-new.txt
index 1317c1c..ec1b8c0 100644
--- a/tmp/rosdistro-old.txt
+++ b/tmp/rosdistro-new.txt
@@ -30,0 +31 @@
+  nixos: [bandit]
@@ -45,0 +47 @@
+  nixos: [castxml]
@@ -66,0 +69,2 @@
+  nixos: [collectd]
+  nixos: [comedilib]
@@ -77,0 +82 @@
+  nixos: [dcraw]
@@ -78,0 +84 @@
+  nixos: [debian-devscripts]
@@ -106,0 +113 @@
+  nixos: [flawfinder]
@@ -110,0 +118 @@
+  nixos: [fluidsynth]
@@ -111,0 +120,2 @@
+  nixos: [noto-fonts]
+  nixos: [fping]
@@ -116,0 +127 @@
+  nixos: [fxload]
@@ -122,0 +134 @@
+  nixos: [gcovr]
@@ -135,0 +148 @@
+  nixos: [gitFull]
@@ -137,0 +151 @@
+  nixos: [glpk]
@@ -146,0 +161 @@
+  nixos: [gperf]
@@ -167,0 +183 @@
+  nixos: [haproxy]
@@ -186,0 +203 @@
+  nixos: [inxi]
@@ -205,0 +223 @@
+  nixos: [alglib]
@@ -281,0 +300 @@
+  nixos: [libepoxy]
@@ -284,0 +304,2 @@
+  nixos: [libevent]
+  nixos: [e2fsprogs]
@@ -298,0 +320 @@
+  nixos: [ftgl]
@@ -304,0 +327 @@
+  nixos: [geographiclib]
@@ -311,0 +335 @@
+  nixos: [glm]
@@ -574,0 +599 @@
+  nixos: [mpfr]
@@ -577,0 +603 @@
+  nixos: [msr-tools]
@@ -578,0 +605 @@
+  nixos: [nanoflann]
@@ -579,0 +607 @@
+  nixos: [nbtscan]
@@ -592,0 +621 @@
+  nixos: [nvidia_cg_toolkit]
@@ -593,0 +623 @@
+  nixos: [libodb]
@@ -595,0 +626 @@
+  nixos: [opencascade-occt]
@@ -613,0 +645 @@
+  nixos: [pigz]
@@ -619,0 +652,2 @@
+  nixos: [postfix]
+  nixos: [postgresql]
@@ -620,0 +655,2 @@
+  nixos: [postgresqlPackages.postgis]
+  nixos: [potrace]
@@ -668,0 +705 @@
+  nixos: [rsyslog]
@@ -682,0 +720 @@
+  nixos: [SDL2_image]
@@ -686,0 +725 @@
+  nixos: [emacsPackages.slime]
@@ -694,0 +734 @@
+  nixos: [speechd]
@@ -703,0 +744 @@
+  nixos: [swiProlog]
@@ -706,0 +748 @@
+  nixos: [systemd]
2024-10-04 15:52:13 +02:00
Michal Sojka
af42011236 Update nixpkgs and nix-ros-overlay
This fixes zsh CLI completion. For some magic reason, previously used
combination of versions produced completion file _ros2nix without
"#compdef ros2nix" on its first line, which breaks zsh completion
autoloading.

Switching of both nixpkgs and nix-ros-overlay to the latest versions
fixes the problem. Switching only one of these led to various other
problems, so we do both.
2024-10-03 00:24:28 +02:00
Michal Sojka
8a9f703575 Make ros2nix version (date-time) more human readable 2024-10-03 00:24:28 +02:00
Michal Sojka
8736e74512 Add FilesCompleter for package.xml parameter 2024-10-01 20:32:35 +02:00
Michal Sojka
0fd819b4a2 Add shell completion scripts 2024-10-01 13:01:16 +02:00
Michal Sojka
8528f3558f Fix errors when package.xml is in the current directory 2024-10-01 12:08:22 +02:00
Michal Sojka
2595123e12 Ignore --compare in the "Automatically generated" comment 2024-09-26 23:31:48 +02:00