GithubHelp home page GithubHelp logo

catkin / catkin_tools Goto Github PK

View Code? Open in Web Editor NEW
163.0 24.0 146.0 2.29 MB

Command line tools for working with catkin

License: Apache License 2.0

Python 95.84% Objective-C 0.64% CMake 1.62% Shell 1.53% C++ 0.20% Rich Text Format 0.17% C 0.01%
python cmake build-tool

catkin_tools's Introduction

catkin_tools's People

Contributors

acxz avatar alexistm avatar davetcoleman avatar dirk-thomas avatar flixr avatar furushchev avatar iantheengineer avatar iwanders avatar jarvisschultz avatar jbohren avatar k-okada avatar kartikmohta avatar lucasw avatar matthew-reynolds avatar matthijsburgh avatar meyerj avatar mikaelarguedas avatar mikepurvis avatar nikolausdemmel avatar pseyfert avatar racko avatar rayman avatar rhaschke avatar roehling avatar scpeters avatar spurnvoj avatar timonegk avatar tkruse avatar wjwwood avatar wkentaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

catkin_tools's Issues

build: ctrl+c does not always work

I often get stuck in a terminal where the Python process is stuck (not killable with ctrl-c) if I interupt it with ctrl-c at an "unconvenient" time. In this case I hit ctrl+c just after Found '251' packages in 0.3 seconds. is displayed (but no package has started building). I get the following backtrace but am only left with the option to kill the python process manually.

$ catkin i -DCMAKE_BUILD_TYPE=Release
==> Expanding alias 'i' from 'catkin i -DCMAKE_BUILD_TYPE=Release' to 'catkin install -DCMAKE_BUILD_TYPE=Release'
==> Expanding alias 'install' from 'catkin install -DCMAKE_BUILD_TYPE=Release' to 'catkin build --install -DCMAKE_BUILD_TYPE=Release'
-----------------------------------------------------------------
Workspace:                   /Users/demmeln/work/hydro_ws
Buildspace:                  /Users/demmeln/work/hydro_ws/build
Develspace:                  /Users/demmeln/work/hydro_ws/devel
Installspace:                /Users/demmeln/work/hydro_ws/install
DESTDIR:                     None
-----------------------------------------------------------------
Isolate Develspaces:         False
Install Packages:            True
Isolate Installs:            False
-----------------------------------------------------------------
Additional CMake Args:       -DCMAKE_BUILD_TYPE=Release
Additional Make Args:        None
Additional catkin Make Args: None
-----------------------------------------------------------------
Found '251' packages in 0.3 seconds.
^C[build] Runtime: 2.8 seconds
Traceback (most recent call last):
  File "/usr/local/bin/catkin", line 9, in <module>
    load_entry_point('catkin-tools==0.0.0', 'console_scripts', 'catkin')()
  File "/Users/demmeln/work/catkin_tools/catkin_tools/commands/catkin.py", line 192, in main
    sys.exit(args.main(args) or 0)
  File "/Users/demmeln/work/catkin_tools/catkin_tools/verbs/catkin_build/cli.py", line 183, in main
    lock_install=not opts.no_install_lock
  File "/Users/demmeln/work/catkin_tools/catkin_tools/verbs/catkin_build/build.py", line 411, in build_isolated_workspace
    ready_packages = get_ready_packages(packages_to_be_built, running_jobs, completed_packages)
  File "/Users/demmeln/work/catkin_tools/catkin_tools/verbs/catkin_build/build.py", line 92, in get_ready_packages
    depends = get_cached_recursive_build_depends_in_workspace(package, workspace_packages)
  File "/Users/demmeln/work/catkin_tools/catkin_tools/verbs/catkin_build/common.py", line 341, in get_cached_recursive_build_depends_in_workspace
    cache[package.name] = get_recursive_build_depends_in_workspace(package, workspace_packages)
  File "/Users/demmeln/work/catkin_tools/catkin_tools/verbs/catkin_build/common.py", line 374, in get_recursive_build_depends_in_workspace
    dep_depends = dep_pkg.build_depends + dep_pkg.buildtool_depends + dep_pkg.run_depends
  File "/usr/local/lib/python2.7/site-packages/catkin_pkg/package.py", line 112, in __getattr__
    [run_depends.append(deepcopy(d)) for d in self.exec_depends + self.build_export_depends if d not in run_depends]
  File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 190, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 334, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 237, in _deepcopy_tuple
    y.append(deepcopy(a, memo))
  File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/local/Cellar/python/2.7.6_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.py", line 154, in deepcopy
    d = id(x)
KeyboardInterrupt

catkin build feedback

Hi William,

not sure where else to put this. Just discovered this project and I feel like giving feedback. You may close this issue without further comment.

Things I recommend for catkin_tools:

  • it should be announced early on Buildsystem SIG or https://groups.google.com/forum/#!forum/ros-usability-scripts
  • it should use ros/catkin#603 when that get's merged
  • a verb "install" seems more logical than a --install option (It is a verb to start with). Supporting multiple verbs with individual options is a pain, which is why modern verb-based command-line tools (e.g. in the java world) use files to configure the processes, and commands only to trigger them. I think that would be a wise choice for ROS workspace tools, if you intend to further integrate with wstool, rosdep, catkin_lint, etc.

new verb proposal: catkin info

In #63 (comment) I proposed that in addition to a "build summary" after each build, catkin could also display certain advisories. These advisories, however, could be useful even when the user isn't performing a build, so there should be some other way to access them.

Where catkin_lint is for checking catkin packages for mistake this would be the main entry point for debugging problems with a catkin environment.

Example of the proposed usage and output:

$> catkin info 
Context:
  Current directory appears to be a Catkin workspace.
  A run-space in the current directory is currently sourced.
  Workspace stack:
  - /home/liza/my_overlay/devel
  - /home/liza/my_ws/devel
  - /opt/ros/hydro

Workspace: /home/liza/my_overlay
  Source-space: /home/liza/my_overlay/src
  Build-space: /home/liza/my_overlay/build
  Run-spaces:
  - /home/liza/my_overlay/devel

Possible advisories:

  • Your source-space contains non-catkin packages, but you have not built into an install space.
  • You've loaded a devel run-space from a workspace which also has an install run-space. You might have meant to load the install run-space.

Additionally, you could alias catkin wtf to run catkin info.

verbs: workspace (ws) verb for managing multiple workspaces

Catkin tools is the perfect place to add tools for analyzing and managing one or more catkin workspaces. This verb could have sub-verbs for different workspace-management commands.

Rough sketch of ideas for the workspace or ws verb:

  • catkin ws create [<workspace-name>] Create a new workspace with default directories and an optional identifier
  • catkin ws create --extend <workspace-name> Create a new workspace that explicitly extends another workspace either by name or by path
  • catkin ws save [--default] <workspace-name> Save the current workspace to a persistent file with an identifier, or set an already saved workspace as the default.
  • catkin ws get <workspace-name> Print the path to the workspace identified by <workspace-name>
  • catkin ws load [<workspace-name>] Load either the default or a named workspace environment from a persistent file. This could go into your shell profile so each new shell gets the workspace that you're currently using.
  • catkin ws list List the saved workspaces
  • catkin ws clean Remove the appropriate build and devel directories (prevents people from having to use rm -rf in their workspaces
  • catkin ws info <workspace-name> Show a workspace's dependencies, which known workspaces depend on it, number of packages, if it's been built, etc
  • catkin ws discover <path> Find all catkin workspaces under some path (by looking for marker file introduced here ros-infrastructure/catkin_pkg#95)

For workspace names, there could be some defaults like ros-hydro for /opt/ros/hydro but people will also use project names for different workspaces.

The persistent file could look something like /.catkin_workspaces:

workspaces:
  hydro: '/opt/ros/hydro'
  indigo: '/opt/ros/indigo'
  overlay: '/home/jbohren/ws/overlay/devel'
  jhu: '/home/jbohren/ws/jhu/devel'
  nasa: '/home/jbohren/ITAR/nasa/devel'

A catkin ws command should be concerned solely with managing catkin workspaces as they pertain to the catkin buildsystem. It shouldn't be concerned with rosdep, wstool, or other external tools.

I'd love feedback on this idea / @davetcoleman @isucan

Make compiler warnings visible

First of all, catkin build is awesome!

That said, it would be nice if the user could see compiler warnings. I usually develop with a no-warnings policy, but avoid -Werror to be able to ignore warnings in certain situations (think demo/game/whatever in 10 mins). catkin build hides away the warnings and gives no indication that there were any, which kind of defeats the purpose of warnings.

buildone verb (or other verb aliases)

Would it fit with the catkin_tools philosophy to have a "buildone" verb which is equivalent to building a single package with the --no-deps flag?

build: --isolate-devel crashes when not building all packages

The following failiure occurs in a workspace with more than one package and no existing devel folder (the use of the "--space-suffix" and "--source" options is irrelevant to this issue I assume):

$ catkin build --space-suffix test --source srctest --isolate-devel catkin
Creating buildspace directory, '/Users/demmeln/work/indigo_ws/buildtest'
----------------------------------------------------------------------
Workspace:                   /Users/demmeln/work/indigo_ws
Buildspace:                  /Users/demmeln/work/indigo_ws/buildtest
Develspace:                  /Users/demmeln/work/indigo_ws/develtest
Installspace:                /Users/demmeln/work/indigo_ws/installtest
DESTDIR:                     None
----------------------------------------------------------------------
Isolate Develspaces:         True
Install Packages:            False
Isolate Installs:            False
----------------------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
----------------------------------------------------------------------
Found '2' packages in 0.0 seconds.
Starting ==> catkin
Finished <== catkin [ 3.3 seconds ]
[build] Runtime: 3.5 seconds                                                                                                                                                                                  [0/0 Active | 1/1 Completed]
Traceback (most recent call last):
  File "/usr/local/bin/catkin", line 9, in <module>
    load_entry_point('catkin-tools==0.0.0', 'console_scripts', 'catkin')()
  File "/Users/demmeln/work/catkin_tools/catkin_tools/commands/catkin.py", line 192, in main
    sys.exit(args.main(args) or 0)
  File "/Users/demmeln/work/catkin_tools/catkin_tools/verbs/catkin_build/cli.py", line 183, in main
    lock_install=not opts.no_install_lock
  File "/Users/demmeln/work/catkin_tools/catkin_tools/verbs/catkin_build/build.py", line 548, in build_isolated_workspace
    _create_unmerged_devel_setup(context)
  File "/Users/demmeln/work/catkin_tools/catkin_tools/verbs/catkin_build/build.py", line 233, in _create_unmerged_devel_setup
    first_source=leaf_sources[0],
IndexError: list index out of range

build: Add "--clear-cmake-cache" argument

Sometimes it's desirable to clear the CMakeCache of variables like the paths to found libraries. In the event that someone wants to switch a workspace to another environment, it would be useful to expose the option of clearing the CMakeCache to the user.

From the command line, this can be done by calling:

cmake -U * /path/to/src/pkg

So for a catkin build user, they could do this for one or more packages in the workspace by running:

catkin build --clear-cmake-cache

build: Change default behavior to --merge-devel

The consensus seems to be to change the default behavior of catkin build to be catkin build --merge-devel, as discussed here: #28 (comment)

This means that a new option called --isolate-devel should be made. This will fit well with the currently-existing --isolate-install.

Release to pypi

What is needed to release catkin_tools to pypi?

It seems that quite a few people are using it successfully and having it installable with pip would be a big plus, even if it is only alpha/beta grade software.

catkin build should error on -p0

A minor usability improvement:

Just did this typo when I wanted -p1. catkin simply claimed everything was built successfully instead of giving a meaningful error.

build: Add marker file to workspace root

re: ros/catkin#603 (comment)

@jbohren as I pointed out, catkin_tools should not use this implementation unless it is relocated because otherwise catkin_tools would need to depend on catkin, which would make it where it could not be installed from pip and I really would like to avoid that.

So then if we a marker file to be used with catkin build, should it create its own?

build: prevent mixing catkin_make and catkin build on same build folder

There should be some sort of marker file in the build and devel spaces which prevents mixing the use of catkin_make, catkin_make_isolated, and catkin build on the same folders.

To be clear, it should prevent this:

$ ls
src
$ catkin_make
...
$ ls
src build devel
$ catkin build
Error: build space was created by caktin_make
       the usage of these two commands should not be mixed

build: install and develspace interplay

I just noticed these issues following a discussion in #64 (comment):

Calling catkin build --install after catkin build is broken for pure cmake packages. After the first call they will have been installed into the devel space and the second call will not install them to the source space.

Edit: I moved the second issue to #70

build: discussion of workspace "extending" behavior

Currently, catkin build performs the workspace auto-extension behavior that catkin_make also does by default. I think it would be really helpful to people to be able to create a clean workspace without having to messily unset various environment variables. This could be related to #47

build: allow for building of cmake projects which do not have package.xml

The idea is that you can have a folder of plain CMake projects, which will all get built first, in parallel and in no particular order before trying to build any catkin packages. This allows you to easily build CMake projects as part of your workspace without creating package.xml's for them.

build: ui stuck in "calculating new jobs..."

Sometimes it seems the build command ui gets stuck with the line

[build] Calculating new jobs...

for a long time. It seems like the command is actually still building packages in the background, just not updating the display. I have a hard time reproducing this reliably, so I'm not sure.

catkin: should not fail if cmake is not available

Currently if you run any catkin command without cmake you get this:

Traceback (most recent call last):
  File "/usr/local/bin/catkin", line 8, in <module>
    load_entry_point('catkin-tools==0.1.0', 'console_scripts', 'catkin')()
  File "/Library/Python/2.7/site-packages/catkin_tools/commands/catkin.py", line 94, in main
    argument_preprocessors = create_subparsers(parser, verbs)
  File "/Library/Python/2.7/site-packages/catkin_tools/commands/catkin.py", line 61, in create_subparsers
    desc = load_verb_description(verb)
  File "/Library/Python/2.7/site-packages/catkin_tools/commands/catkin.py", line 41, in load_verb_description
    return entry_point.load()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 1954, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/Library/Python/2.7/site-packages/catkin_tools/verbs/catkin_build/__init__.py", line 15, in <module>
    from .cli import argument_preprocessor
  File "/Library/Python/2.7/site-packages/catkin_tools/verbs/catkin_build/cli.py", line 33, in <module>
    from .build import build_isolated_workspace
  File "/Library/Python/2.7/site-packages/catkin_tools/verbs/catkin_build/build.py", line 61, in <module>
    from .job import CatkinJob
  File "/Library/Python/2.7/site-packages/catkin_tools/verbs/catkin_build/job.py", line 30, in <module>
    raise RuntimeError("Executable 'cmake' could not be found in PATH.")
RuntimeError: Executable 'cmake' could not be found in PATH.

This should probably only be raised when catkin build is being used and should be caught and more politely reported.

build: whitespace in folder names causes CMake failure

Like this:

% catkin i -p1
==> Expanding alias 'i' from 'catkin i -p1' to 'catkin install -p1'
==> Expanding alias 'install' from 'catkin install -p1' to 'catkin build --install -p1'
Creating buildspace directory, '/Users/william/hydro with spaces/build'
---------------------------------------------------------------------
Workspace:                   /Users/william/hydro with spaces
Buildspace:                  /Users/william/hydro with spaces/build
Develspace:                  /Users/william/hydro with spaces/devel
Installspace:                /Users/william/hydro with spaces/install
DESTDIR:                     None
---------------------------------------------------------------------
Merge Develspaces:           False
Install Packages:            True
Isolate Installs:            False
---------------------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
---------------------------------------------------------------------
Found '250' packages in 0.3 seconds.
Starting ==> catkin
[catkin] ==> '/Users/william/hydro with spaces/build/catkin/cmi_env.sh /usr/local/bin/cmake /Users/william/hydro with spaces/src/catkin -DCATKIN_DEVEL_PREFIX=/Users/william/hydro with spaces/devel/catkin -DCMAKE_INSTALL_PREFIX=/Users/william/hydro with spaces/install' in '/Users/william/hydro with spaces/build/catkin'
CMake Error: The source directory "/Users/william/hydro with spaces/build/catkin/spaces/install" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
[catkin] <== '/Users/william/hydro with spaces/build/catkin/cmi_env.sh /usr/local/bin/cmake /Users/william/hydro with spaces/src/catkin -DCATKIN_DEVEL_PREFIX=/Users/william/hydro with spaces/devel/catkin -DCMAKE_INSTALL_PREFIX=/Users/william/hydro with spaces/install' failed with return code '1'
[cmi] There were errors:

Failed to build package 'catkin' because the following command:

    # Command run in directory: /Users/william/hydro with spaces/build/catkin
    /Users/william/hydro with spaces/build/catkin/cmi_env.sh /usr/local/bin/cmake /Users/william/hydro with spaces/src/catkin -DCATKIN_DEVEL_PREFIX=/Users/william/hydro with spaces/devel/catkin -DCMAKE_INSTALL_PREFIX=/Users/william/hydro with spaces/install

Exited with return code: 1
[cmi] Runtime: 1.3 seconds

catkin tools broken with 10cfef4

commit 10cfef4
Author: William Woodall [email protected]
Date: Tue Apr 1 23:56:28 2014 -0700

remove old references to cmi

It looks like this broke catkin:

[yavin:~/ws/hydro/underlay]$ catkin -h
Traceback (most recent call last):
  File "/usr/local/bin/catkin", line 9, in <module>
    load_entry_point('catkin-tools==0.0.0', 'console_scripts', 'catkin')()
  File "/usr/local/lib/python2.7/dist-packages/catkin_tools-0.0.0-py2.7.egg/catkin_tools/commands/catkin.py", line 94, in main
    argument_preprocessors = create_subparsers(parser, verbs)
  File "/usr/local/lib/python2.7/dist-packages/catkin_tools-0.0.0-py2.7.egg/catkin_tools/commands/catkin.py", line 61, in create_subparsers
    desc = load_verb_description(verb)
  File "/usr/local/lib/python2.7/dist-packages/catkin_tools-0.0.0-py2.7.egg/catkin_tools/commands/catkin.py", line 41, in load_verb_description
    return entry_point.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/lib/python2.7/dist-packages/catkin_tools-0.0.0-py2.7.egg/catkin_tools/verbs/catkin_build/__init__.py", line 15, in <module>
    from .cli import argument_preprocessor
  File "/usr/local/lib/python2.7/dist-packages/catkin_tools-0.0.0-py2.7.egg/catkin_tools/verbs/catkin_build/cli.py", line 33, in <module>
    from .build import build_isolated_workspace
  File "/usr/local/lib/python2.7/dist-packages/catkin_tools-0.0.0-py2.7.egg/catkin_tools/verbs/catkin_build/build.py", line 48, in <module>
    from .common import generate_bash_and_zsh_files
ImportError: cannot import name generate_bash_and_zsh_files

No Debian in Precise

I followed the instructions from the catkin_tools docs:

Installing on Ubuntu with apt-get

First you must have the ROS repositories which contain the .deb for catkin_tools:

$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list'
$ wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
Once you have added that repository, run these commands to install catkin_tools:

$ sudo apt-get update
$ sudo apt-get install python-catkin-tools

And I get

E: Unable to locate package python-catkin-tools

Installed libraries reference devel space

I split of the second half of #69, since it was really two separate issues.

When calling catkin build --install some of the installed libraries still reference linked libraries in the develspace. However, the install space is supposed to be self contained, right? I don't know if the same issue arises with cm/cmi or on platforms other than OS X (where shared library linking is a bit different than on Linux).

Notice the reference to the devel space for librospack:

$ otool -L installtest/lib/libroslib.dylib
installtest/lib/libroslib.dylib:
    libroslib.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libboost_thread-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /Users/demmeln/work/hydro_ws/develtest/lib/librospack.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libtinyxml.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
    /usr/local/lib/libboost_filesystem-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libboost_program_options-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/local/lib/libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)```

Opinionated code review

Hi William, so I took some time today to look over catkin_tools to see what good use of a marker file could be integrated. I took down notes of things i noticed that I would have done differently. Those are not not defects, just opinions, so feel free to just disagree, I will be happy to agree to disagree.

  • missing contributor docs (how to set up local environment to run catkin_tools main without having to install after each change. I don't know how you do it, I put "if name=='main'... in catkin.py)
  • Define custom Exception that is printed without StackTrace for normal failure cases(anything that does not look like a bug in the code), ValueError is for lazy-bodies in such cases.
    E.g. Could not find source space: ...
    StackTraces are scary, they scare users, they should only be printed where a bug is likely, e.g. the user has to contact the issue tracker or answers.ros.org to find help.
  • unit test coverage... nuf said
  • I like colors as much as the next guy, but seriously: Don't use colors. Unless for exceptional cases (failure = red). catkin_tools should later be maintainable by anyone who has no interest whatsoever in learning the syntax rules of ansi. Every minute spend on fixing some ansi related issue is a minute lost on serious stuff that advances mankind. On demo day, 3 minutes before the demo, you do not want a build to fail mysteriously due to a bug with the ansi formatting. It's just not worth it.
  • color.py:_color_translation_map: No. If you write such code, that's when you know you are using colors too much. Since most of the items in the map seem to do modular replacements, e.g. ([{package}] -> [@{cf}{package}@|], [ {time} ] -> [ @{yf}{time}@| ]), maybe you could just write def format_packagename(), or have a DSL for formatting special blocks of text. Else just use plain black and white, really.
  • def fmt(), def clr(): use meaningful names. Meaningful to the uninitiated reader, not you. I know, you use those often, typing causes finger strain, etc. Still, use meaningful names, no exception.
  • build.py:build_isolated_workspace(): function too long. cut it down for unit testing. also see point "unit test coverage" above. unit testing long functions is much more of a pain than small functions.
  • catkin.py:main(): function too long. Also do not both use argparse and manually check arguments in a for loop, or place a code comment explaining why you do it.
  • context.py: if self.__locked:... : duplicate code, maybe use def check_lock()...?

Else do not consider this as criticism, I like the initiative behind catkin_tools, so keep up the good work.

build: Overlay package isn't used by a dependent package if the dependent package has already been configured against system package

Observed:

If I run catkin build once with a package which depends on a package installed to the system (or an underlay workspace), and then add a source checkout of that package to my workspace, the dependent package is still configured against the system/underlay package, and not the source checkout in the same workspace.

Fix:

Force a re-configuration of packages which depend on packages which were added to this workspace since the last build.

build: Some packages are not inlcuded in ROS package path

When I build with --merge-devel sometimes packages which are built don't actually get put onto $ROS_PACKAGE_PATH after sourcing the setup.zsh file in the develspace. Have you seen this at all? I'm having a hard time reproducing it on anything but my giant 60+ package workspace.

build: Display chained workspaces in preamble

Currently, when running catkin build, a bunch of status/config information is printed to the console. It would also be really useful if it listed the chained workspaces against which the current workspace is built.

This would just be the paths listed in $CMAKE_PREFIX_PATH which contain a setup file right?

build: When using catkin build with packages that have executable scripts, rosrun finds two versions (which are actually the same file)

I'm not sure why this is happening with catkin build, but it doesn't happen with normal catkin_make. The effect is shown below. This might actually be a problem with rosrun:

[moldy-crow:~]$ rosrun rtt_gazebo_console console 
[rosrun] You have chosen a non-unique executable, please pick one of the following:
1) /home/jbohren/ws/hydro/underlay/src/orocos/rtt_gazebo/rtt_gazebo_console/./scripts/console
2) /home/jbohren/ws/hydro/underlay/src/orocos/rtt_gazebo/rtt_gazebo_console/scripts/console

build: include build summary at the end of the build

This summary should include things like workspaces being extended and compiler being used and stuff like that.

The idea is that having this at the end of the build would better notify users of their build environment.

leaf_sources out of bounds error

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.

build: speed up setup.sh for non-merged devel spaces

Currently the setup.sh file which is generated by catkin build is very slow because it must execute setup.sh --extend for each leaf package and each of those leaf package's run depends recursively (excluding overlap from build depends). On a large workspace, like hydro-desktop_full, 250 packages means sourcing ~188 setup files.

Because of the way the devel space is created we can theoretically create a faster single setup.sh which builds the combined devel space in one invocation.

Related: #24

build: detect and report on build warnings when not verbose

I switched the default behavior to be quiet (hiding the output from build commands unless there is an error). The remaining concern is that warnings will go unnoticed by users.

To alleviate this we should find and report warnings from cmake and gcc/clang and report them. This shouldn't be too hard because we are already capturing all of the output from commands and rosmake did the same kind of parsing in order to collect and report on the warnings in a similar fashion. In fact, I plan on stealing the code from rosmake and refactoring it to work for the build verb.

build: prettify time display

This is super-low-priority, but I thought I'd write it down anyway.

Since the names of all packages are known at the beginning, we could prettify the time display like the following:

Starting ==> gazebo_msgs                                                                                                                                                                                                                                                        
Finished <== conman [ 1.8 seconds ]                                                                                                                                                                                                                                             
Starting ==> gazebo_ros_pkgs                                                                                                                                                                                                                                                    
Finished <== conman_msgs [ 1.9 seconds ]                                                                                                                                                                                                                                        
Starting ==> joint_state_publisher                                                                                                                                                                                                                                              
Finished <== fanuc_s430if_support [ 1.2 seconds ]                                                                                                                                                                                                                               
Starting ==> lcsr_camera_models                                                                                                                                                                                                                                                 
Finished <== joint_state_publisher [ 1.4 seconds ]                                                                                                                                                                                                                              
Starting ==> lcsr_tf_tools                                                                                                                                                                                                                                                      
Finished <== gazebo_ros_pkgs [ 1.8 seconds ]                                                                                                                                                                                                                                    
Starting ==> oro_barrett_gazebo                                                                                                                                                                                                                                                 
Finished <== gazebo_msgs [ 2.4 seconds ]                                                                                                                                                                                                                                        
Starting ==> oro_barrett_msgs                                                                                                                                                                                                                                                   

to...

Starting ==> gazebo_msgs                                                                                                                                                                                                                                                        
Finished <== conman                 [ 1.8 seconds ]                                                                                                                                                                                                                                             
Starting ==> gazebo_ros_pkgs                                                                                                                                                                                                                                                    
Finished <== conman_msgs            [ 1.9 seconds ]                                                                                                                                                                                                                                        
Starting ==> joint_state_publisher                                                                                                                                                                                                                                              
Finished <== fanuc_s430if_support   [ 1.2 seconds ]                                                                                                                                                                                                                               
Starting ==> lcsr_camera_models                                                                                                                                                                                                                                                 
Finished <== joint_state_publisher  [ 1.4 seconds ]                                                                                                                                                                                                                              
Starting ==> lcsr_tf_tools                                                                                                                                                                                                                                                      
Finished <== gazebo_ros_pkgs        [ 1.8 seconds ]                                                                                                                                                                                                                                    
Starting ==> oro_barrett_gazebo                                                                                                                                                                                                                                                 
Finished <== gazebo_msgs            [ 2.4 seconds ]                                                                                                                                                                                                                                        
Starting ==> oro_barrett_msgs                                                                                                                                                                                                                                                   

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.