adeeb10abbas / outdoor_ros2

A ROS2 based repository for outdoor SLAM and navigation at DWSL and Zhou Robotics, Drexel
MIT License
6 stars 3 forks source link

Should avoid using unstable commits for repositories #3

Closed EricCousineau-TRI closed 1 year ago

EricCousineau-TRI commented 1 year ago

FYI @adeeb10abbas from Drake Slack post, I saw following: https://github.com/Zhourobotics/outdoor_slam_ros2/blob/74706d4d37566ebe03847ce54a9aebf66fdd6012/WORKSPACE#L75-L78

This will hurt reproducibility as users who did not fetch the given sha256 at that time will get cache miss errors from Bazel fetching. I strongly recommend using full git SHA1's or version tags.

$ git diff -U1
diff --git a/WORKSPACE b/WORKSPACE
index 115be6c..07bde80 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -76,4 +76,4 @@ add_default_workspace()
 ## Adding Bazel_ROS2_Rules for drake-ros stuff to work ##
-DRAKE_ROS_commit = "main"
-DRAKE_ROS_sha256 = "b819c470da68e525201585524479bd42bd79daacfaa2729cb2f32757fc62052c"
+DRAKE_ROS_commit = "9171963955936ed2fbc853f1f2ae8ede1836e92d"
+DRAKE_ROS_sha256 = "08b08027afb06a55e9f1b3aa14186e9e48f24fb58332d8b7b8018eeeb2db70e6"

If it helps, here's how I fetch: https://github.com/EricCousineau-TRI/repro/blob/50c3f52c6b745f686bef9567568437dc609a7f91/bazel/bazel_hash_and_cache.py (be sure to also use fake_bazel_workspace)

$ cd drake-ros
$ git rev-parse HEAD
9171963955936ed2fbc853f1f2ae8ede1836e92d
$ bazel_hash_and_cache.py RobotLocomotion/drake-ros@9171963955936ed2fbc853f1f2ae8ede1836e92d
...
sha256: 08b08027afb06a55e9f1b3aa14186e9e48f24fb58332d8b7b8018eeeb2db70e6
adeeb10abbas commented 1 year ago

Thanks a lot, @EricCousineau-TRI That script is very helpful :D!