0
$\begingroup$

Rosanswers logo

Dear all,

I recently faced with the following error whenever I run rosmake * to build a set of packages using rosbuild

Exception in thread 6:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosmake/parallel_build.py", line 161, in run
    (result, result_string) = self.rosmakeall.build(pkg, self.argument, self.build_queue.robust_build)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosmake/engine.py", line 436, in build
    warning_dict = warnings.analyze()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosmake/gcc_output_parse.py", line 41, in analyze
    return {(t, self.byType(t)) for t, p in self._warning_pattern_map.items()}
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosmake/gcc_output_parse.py", line 41, in <setcomp>
    return {(t, self.byType(t)) for t, p in self._warning_pattern_map.items()}
TypeError: unhashable type: 'list'

I am using ROS melodic in Ubuntu 18.04 :

ROS_ETC_DIR=/opt/ros/melodic/etc/ros
ROS_ROOT=/opt/ros/melodic/share/ros
ROS_MASTER_URI=http://localhost
ROS_VERSION=1
ROS_PYTHON_VERSION=2
ROSLISP_PACKAGE_DIRECTORIES=/home/hamidreza/universal_robot_ws/devel/share/common-lisp:/home/hamidreza/catkin_ws/devel/share/common-lisp
ROS_DISTRO=melodic

It should be noted that I can make the packages if I do roscd to the package and then "make" it.
I even installed fresh ubuntu but it was not helpful. Does anyone encounter this issue before?

*** [update] I confirmed that it happened after updating the ubuntu by sudo apt-get update && sudo apt-get dist-upgrade

Thanks,

Hamidreza


Originally posted by hamidreza on ROS Answers with karma: 26 on 2020-08-22

Post score: 0


Original comments

Comment by jarvisschultz on 2020-08-24:
As a quick sanity check... why are you using rosmake with melodic and Ubuntu 18.04? Rosmake was deprecated a long time ago in favor of catkin. Rather than debugging some strange issue with a long-deprecated tool, just want to understand why you are even attempting rosmake.

Comment by hamidreza on 2020-08-24:
@jarvisschultz, we have a very big cognitive robotic system, most of the packages have been developed based on the catkin building system, while there are still several rosbuild-based tool packages.

Comment by jarvisschultz on 2020-08-24:
Sounds good. Just wanted to make sure you really needed to debug the rosmake problem

Comment by jarvisschultz on 2020-08-25:
Glad you were able to fix it! The ros/ros GitHub repo would be the proper place to submit a bug report, or preferably, a PR to fix the issue.

Comment by jarvisschultz on 2020-08-25:
BTW, I updated your comment to be an answer so that this question now shows up as answered. If you do submit a bug or a PR, it would be good to add a comment here linking that issue/PR

Comment by akihiko on 2021-10-20:
@jarvisschultz Where is the evidence that rosmake was deprecated? In its official ROS Wiki, the status is maintained, and no mention about the deprecation. Of course I know catkin_make is much more popular, though.

Comment by jarvisschultz on 2021-10-21:
@akihiko Maybe deprecation is too strong of a word, but referring to catkin as merely "popular" seems too weak. I suppose you are correct that rosmake could still potentially work because under-the-hood it uses rospack which works with both rosbuild and catkin packages. It would have been more correct for me to say rosbuild is deprecated. I tend to think of rosmake as a rosbuild-specific tool, but thinking about it more that is not quite right. All that said, I'm still of the opinion that you would want a compelling reason to use rosmake over catkin_make in a ROS1 distribution newer than Indigo.

Comment by gvdhoorn on 2021-10-21:
rosmake cannot build Catkin packages.

That immediately makes it unusable on any recent ROS distribution.

It's certainly deprecated -- perhaps if only already de facto.

Comment by akihiko on 2021-10-22:
@jarvisschultz Thanks for the comments. Yes, deprecation is too strong, if there is no agreements. I understand the advantages of catkin especially for deployment, but I still prefer to use rosmake for its simplicity and rapid R&D. The discussion of catkin vs rosbuild would be a different topic. Anyway, I just wanted to confirm that deprecation is inaccurate.

Comment by gvdhoorn on 2021-10-22:
Please consider rosmake deprecated. It has not been updated nor tested in the past 8 years or something.

It cannot build packages for newer ROS releases, nor will it ever be able to.

That by itself makes it worthless, and thus deprecated de facto.

The discussion of catkin vs rosbuild would be a different topic.

no, not really I believe. The inability to build Catkin packages is exactly the reason why it is deprecated (note: this is Catkin the CMake infrastructure, not catkin_make, which is a different Catkin).

I still prefer to use rosmake for its simplicity and rapid R&D

I'm not sure what you mean by this.

If you'd like, you could just cd /path/to/your/catkin_ws/build/your_pkg and run make from there -- after you've ran catkin_make once. It will not always work, but if you know what you're doing, you don't need to run catkin_make every time.

Comment by akihiko on 2021-10-24:
@gvdhoorn 1. rosmake cannot build catkin packages, of course. But packages build with rosmake can work with catkin-built packages. So practically using rosmake is not a big issue. 2. It is important if rosmake is deprecated officially or not. If not, we can consider to keep using it. 3. The discussion of rosmake vs catkin_make is different topic from this question. We should avoid doing that here.

Comment by gvdhoorn on 2021-10-25:
This will be my last comment here.

It is important if rosmake is deprecated officially or not. If not, we can consider to keep using it.

In a nutshell: you're free to use whatever you want. I just wanted to clarify the status of rosmake.

If you have some use-case where rosmake makes sense, please continue using it.

That does not change the fact it is actually deprecated.

Perhaps it's unclear what de facto means.

The discussion of rosmake vs catkin_make is different topic from this question.

no, it's very much part of the discussion, as the question "is rosmake deprecated?" can only be asked exactly because there is a catkin_make, and it can only be answered because there is catkin_make.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

@jarvisschultz, we found and solved the problem, The analyze() function in /opt/ros/melodic/lib/python2.7/dist-packages/rosmake/gcc_output_parse.py file causes the problem. It uses the { } in the return expression to unhash tuples, but the tuples should contain only strings, numbers, or tuples. In some cases, the tuples contain empty lists that are unhashable and therefore cause the problem.

    def analyze(self):
    """Get dictionary of classified warnings.

    @return A dictionary of lists of warning messages indexed by the warning type
    @rtype {str:[str]}
    """
    return {(t, self.byType(t)) for t, p in self._warning_pattern_map.items()}

We fixed it by updating the last line as:

  return dict((t, self.byType(t)) for t, p in self._warning_pattern_map.items())

all packages compiled without problems. should we mention this point somewhere to be corrected in the next update of melodic?

Thanks, Hamidreza


Originally posted by hamidreza with karma: 26 on 2020-08-25

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.