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

leaf_sources out of bounds error #45

Closed
furgalep opened this issue May 17, 2014 · 5 comments · Fixed by #276
Closed

leaf_sources out of bounds error #45

furgalep opened this issue May 17, 2014 · 5 comments · Fixed by #276

Comments

@furgalep
Copy link

I'm on OSX Mavericks. I have a workspace with many packages and I'm debugging the build of one or two. When I delete the build and devel folders and try to build a single package with very few dependencies, I get an out of bounds error when writing the setup.bash script:

catkin build glog_catkin
-----------------------------------------------------------------------------------
Workspace:                   /Users/ptf/Work/ethz/code/ros_hydro_overlay_ws
Buildspace:                  /Users/ptf/Work/ethz/code/ros_hydro_overlay_ws/build
Develspace:                  /Users/ptf/Work/ethz/code/ros_hydro_overlay_ws/devel
Installspace:                /Users/ptf/Work/ethz/code/ros_hydro_overlay_ws/install
DESTDIR:                     None
-----------------------------------------------------------------------------------
Merge Develspaces:           False
Install Packages:            False
Isolate Installs:            False
-----------------------------------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
----------------------------------------------------------------------------------- 
Found '73' packages in 0.1 seconds. 
Starting ==> catkin_simple                                                                              
Finished <== catkin_simple [ 0.1 seconds ]                                                              
Starting ==> gflags_catkin                                                                              
Finished <== gflags_catkin [ 0.4 seconds ]                                                              
Starting ==> glog_catkin                                                                                
Finished <== glog_catkin   [ 0.7 seconds ]                                                              
[build] Runtime: 1.9 seconds                                               [0/0 Active | 3/3 Completed] 
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
/usr/local/bin/catkin in <module>()
      7 if __name__ == '__main__':
      8     sys.exit(
----> 9         load_entry_point('catkin-tools==0.0.0', 'console_scripts', 'catkin')()
     10     )

/Library/Python/2.7/site-packages/catkin_tools-0.0.0-py2.7.egg/catkin_tools/commands/catkin.pyc in main(sysargs)
    190     # Finally call the subparser's main function with the processed args
    191     # and the extras which the preprocessor may have returned
--> 192     sys.exit(args.main(args) or 0)

/Library/Python/2.7/site-packages/catkin_tools-0.0.0-py2.7.egg/catkin_tools/verbs/catkin_build/cli.pyc in main(opts)
    181             interleave_output=opts.interleave_output,
    182             no_status=opts.no_status,
--> 183             lock_install=not opts.no_install_lock
    184         )
    185     finally:

/Library/Python/2.7/site-packages/catkin_tools-0.0.0-py2.7.egg/catkin_tools/verbs/catkin_build/build.pyc in build_isolated_workspace(context, packages, start_with, no_deps, jobs, force_cmake, force_color, quiet, interleave_output, no_status, lock_install)
    539         if not context.merge_devel:
    540             if not context.install:
--> 541                 _create_unmerged_devel_setup(context)
    542             else:
    543                 _create_unmerged_devel_setup_for_install(context)

/Library/Python/2.7/site-packages/catkin_tools-0.0.0-py2.7.egg/catkin_tools/verbs/catkin_build/build.pyc in _create_unmerged_devel_setup(context)
    231 {run_depends_sources}
    232 """.format(
--> 233         first_source=leaf_sources[0],
    234         leaf_sources='\n'.join(leaf_sources[1:]),
    235         run_depends_sources='\n'.join(run_depends_sources)

IndexError: list index out of range

If I run this in ipython and call debug, it looks like leaf_packages has a lot of packages from my src folder

leaf_packages
['rviz_animated_view_controller', 'aslam_vcharge_python', 'imu_camera_calibration', 'sm_doc', 'libsnappy', 'zeromq_catkin', 'aslam_python', 'aslam_camera_calibration', 'aslam_install', 'ceres_catkin', 'sm_matlab', 'protobuf_catkin', 'rviz_pyplot', 'aslam_vo_python', 'aslam_backend_bsplines_tutorial', 'aslam_cv_ros', 'aslam_simulation_python']

but as none of those are built, the setup.sh files are not there and leaf_sources ends up empty.

The same problem doesn't happen when I build with the --merge-devel option.

@wjwwood
Copy link
Member

wjwwood commented May 17, 2014

Thanks for the report, looks like it needs some extra logic to catch the scenario where there are leafs but none of them have setup files? As I write that it sounds dubious, there should be setup files for those packages.

But I see that you are only building part of the workspace and that the package you picked is not a leaf. I think the logic needs to consider the whole workspace of packages and figure out the actual set of leaves not just the leaves which would be if the whole workspace was built and then prune by existence. If a leave package's setup.sh file does not exist, then I should consider its non-leaf dependencies recursively until I run out of packages in the workspace or until I find one with a setup.sh.

@furgalep
Copy link
Author

Thanks William, I'm hoping to be able to contribute at some point but this is a bit beyond a beginner's task. Let me know if you need more info.

Paul

@jbohren
Copy link
Contributor

jbohren commented Oct 2, 2014

Is this still a problem when using the no longer default --isolate-devel option?

@wjwwood
Copy link
Member

wjwwood commented Oct 2, 2014

Probably, I need to look into this, it has been in my inbox for quite some time.

@jbohren jbohren added the bug label Jun 11, 2015
@jbohren jbohren modified the milestone: Recommend Switch from CM / CMI Jun 11, 2015
jbohren added a commit that referenced this issue Jan 25, 2016
jbohren added a commit that referenced this issue Jan 25, 2016
@jbohren
Copy link
Contributor

jbohren commented Jan 25, 2016

I took a moment to look into this. Now that catkin build computes a list of "unbuilt" packages, it makes it easy to avoid the leaf-sources error. See #276 for the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants