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

[get_depends] when a dependency is missing, 1st run returns no pkgs, but 2nd run returns some pkgs (re-open #142). #214

Open
130s opened this issue Dec 12, 2020 · 0 comments

Comments

@130s
Copy link
Contributor

130s commented Dec 12, 2020

#142 was closed but I confirmed I still see the same issue happens.

Problem

See #142 (comment) for the detail of the issue.

Potential impact

Related log

I re-ran the repro scenario
docker run -it ros:melodic-ros-core /bin/bash
root@427239906dca:/# apt-get update && apt-get install -y ipython3
root@427239906dca:/# apt-get purge ros-melodic-roslang && apt-get autoremove
      Reading package lists... Done
      Building dependency tree
      Reading state information... Done
      The following packages were automatically installed and are no longer required:
:
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  ros-melodic-ros* ros-melodic-ros-comm* ros-melodic-ros-core* ros-melodic-roslang* ros-melodic-roslisp*
  0 upgraded, 0 newly installed, 5 to remove and 7 not upgraded.
  After this operation, 647 kB disk space will be freed.
  Do you want to continue? [Y/n]
:
The following packages will be REMOVED:
:
0 upgraded, 0 newly installed, 363 to remove and 4 not upgraded.

:
root@427239906dca:/# rospack profile && rospack find roslang
:
[rospack] Error: package 'roslang' not found

root@427239906dca:/# rospack find roscpp
/opt/ros/melodic/share/roscpp

root@427239906dca:/# apt install -y python-rosdep && rosdep init && rosdep update
root@427239906dca:/# apt install -y ipython && ipython
:
In [1]: import rospkg
In [2]: rp = rospkg.RosPack()
In [3]: rp.get_depends("roscpp")
---------------------------------------------------------------------------
ResourceNotFound                          Traceback (most recent call last)
<ipython-input-3-b793dd583b6b> in <module>()
----> 1 rp.get_depends("roscpp")

/usr/lib/python2.7/dist-packages/rospkg/rospack.pyc in get_depends(self, name, implicit)
    242
        243             for p in names:
--> 244                 s.update(self.get_depends(p, implicit))
    245             # add in our own deps
        246             s.update(names)

/usr/lib/python2.7/dist-packages/rospkg/rospack.pyc in get_depends(self, name, implicit)
    242
        243             for p in names:
--> 244                 s.update(self.get_depends(p, implicit))
    245             # add in our own deps
        246             s.update(names)

/usr/lib/python2.7/dist-packages/rospkg/rospack.pyc in get_depends(self, name, implicit)
    236
        237             # take the union of all dependencies
--> 238             names = [p.name for p in self.get_manifest(name).depends]
    239
        240             # assign key before recursive call to prevent infinite case

/usr/lib/python2.7/dist-packages/rospkg/rospack.pyc in get_manifest(self, name)
    169             return self._manifests[name]
        170         else:
--> 171             return self._load_manifest(name)
    172
        173     def _update_location_cache(self):

/usr/lib/python2.7/dist-packages/rospkg/rospack.pyc in _load_manifest(self, name)
    213         :raises: :exc:`ResourceNotFound`
        214         """
--> 215         retval = self._manifests[name] = parse_manifest_file(self.get_path(name), self._manifest_name, rospack=self)
    216         return retval
    217

/usr/lib/python2.7/dist-packages/rospkg/rospack.pyc in get_path(self, name)
    205         self._update_location_cache()
    206         if name not in self._location_cache:
--> 207             raise ResourceNotFound(name, ros_paths=self._ros_paths)
    208         else:
    209             return self._location_cache[name]

ResourceNotFound: rosunit
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/opt/ros/melodic/share

In [4]: rp.get_depends("roscpp")
Out[4]: 
{'catkin',
 'cpp_common',
 'gencpp',
 'geneus',
 'genlisp',
 'genmsg',
 'gennodejs',
 'genpy',
 'message_generation',
 'message_runtime',
 'roscpp_serialization',
 'roscpp_traits',
 'rostime',
 'std_msgs'}
root@427239906dca:/# apt-cache policy python-rosdep
python-rosdep:
  Installed: 0.20.0-1
  Candidate: 0.20.0-1
  Version table:
 *** 0.20.0-1 500
        500 http://packages.ros.org/ros/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant