Skip to content

Commit

Permalink
Update lockfile formating (#2402)
Browse files Browse the repository at this point in the history
* Use dpkg --list to format stdout to lockfile
to make list of installed package more readable

* Line formating
space new line after each lockfile checksum

* Specify ROS distro for rosdep update

* Strip ros distro install fom AMENT_PREFIX_PATH
to force rosdep to resolve and list apt installed package dependencies
and to not skip them as if they are in the catkin workspace

* Prevent dpkg from listing all installed pacakge
when set of dependencies happens to be empty

* Account single entry case AMENT_PREFIX_PATH

* Unset AMENT_PREFIX_PATH if only ros install path
to prevent rosdep from erroring out on empty var
  • Loading branch information
ruffsl authored Jun 9, 2021
1 parent d2cf200 commit 4486a5c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,20 @@ _commands:
working_directory: << parameters.workspace >>
command: |
. << parameters.underlay >>/install/setup.sh
AMENT_PREFIX_PATH=$(echo "$AMENT_PREFIX_PATH" | \
sed -e 's|:/opt/ros/'$ROS_DISTRO'$||')
if [ "$AMENT_PREFIX_PATH" == "/opt/ros/$ROS_DISTRO" ]
then
unset AMENT_PREFIX_PATH
fi
cat << parameters.underlay >>/lockfile.txt > lockfile.txt
vcs export --exact << parameters.underlay >>/src | \
(echo vcs_export && cat) >> lockfile.txt
sha256sum $PWD/lockfile.txt >> lockfile.txt
apt-get update
rosdep update
apt-get update
rosdep update --rosdistro $ROS_DISTRO
dependencies=$(
rosdep install -q -y \
--from-paths src \
Expand All @@ -99,7 +106,7 @@ _commands:
awk '$1 ~ /^resolution\:/' | \
awk -F'[][]' '{print $2}' | \
tr -d \, | xargs -n1 | sort -u | xargs)
dpkg -s $dependencies | \
dpkg --list dpkg $dependencies | \
(echo workspace_dependencies && cat) >> lockfile.txt
sha256sum $PWD/lockfile.txt >> lockfile.txt
setup_workspace:
Expand Down Expand Up @@ -287,12 +294,15 @@ _steps:
command: |
mkdir -p $ROS_WS/src && cd $ROS_WS
ln -s /opt/ros/$ROS_DISTRO install
echo $CACHE_NONCE | \
(echo cache_nonce && cat) >> lockfile.txt
sha256sum $PWD/lockfile.txt >> lockfile.txt
TZ=utc stat -c '%y' /ros_entrypoint.sh | \
(echo ros_entrypoint && cat) >> lockfile.txt
sha256sum $PWD/lockfile.txt >> lockfile.txt
rm -rf $OVERLAY_WS/*
on_checkout: &on_checkout
checkout:
Expand Down

0 comments on commit 4486a5c

Please sign in to comment.