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

perform environment calculation in Python #89

Merged
merged 2 commits into from
Oct 4, 2019

Conversation

dirk-thomas
Copy link
Contributor

Changes the prefix-level local_setup files in a similar way as colcon/colcon-core#209.

Related to ros2/ros2#764.

@dirk-thomas dirk-thomas added enhancement New feature or request in progress Actively being worked on (Kanban column) labels Sep 27, 2019
@dirk-thomas dirk-thomas self-assigned this Sep 27, 2019
@dirk-thomas dirk-thomas added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Sep 27, 2019
@dirk-thomas
Copy link
Contributor Author

Ready for review.

To test this you need a workspace built with --merge-install since the ament_package setup files don't support isolation (as they are only used for the Debian packages). A nightly archive should work too.

  1. Measure the time the following command takes in fresh shell: time . <ws>/install/local_setup.<ext> (also convince yourself that the environment is setup correctly).

  2. Two steps:

    • This needs the workspace being sourced. Clone ros_workspace somewhere and switch to the dirk-thomas/support-develop-ament_package branch. Create a build diretory within and build and install into the workspace from 1.:

      cmake .. -DCMAKE_INSTALL_PREFIX=<ws>/install
      make install
      

      This will overwrite the setup files with the state is available in the Dashing Debian packages.

    • Now time again in a fresh shell (again convince yourself that the environment is setup correctly).

  3. Two steps again:

    • Switch the ament_package in the workspace to the branch of this PR. If you are not using symlink install build the package with colcon.
    • Repeat the cmake / make install step from 2.
    • Check the timing again in a fresh shell (and as always convince yourself that the environment is setup correctly).

When sharing results please include the platform, the # of packages in your workspace, the extension you sourced as well as the three timings. Thanks.


Ubuntu Bionic, ~100 pkgs, bash:

real	0m0.283s
user	0m0.244s
sys	0m0.040s
real	0m0.987s
user	0m0.860s
sys	0m0.188s
real	0m0.163s
user	0m0.131s
sys	0m0.031s

@clalancette
Copy link
Contributor

Ubuntu Bionic, ~300 packages, bash:

real	0m0.625s
user	0m0.344s
sys	0m0.088s
real	0m1.570s
user	0m0.476s
sys	0m0.136s
real	0m0.342s
user	0m0.300s
sys	0m0.032s

@cottsay
Copy link
Contributor

cottsay commented Oct 4, 2019

Fedora 30, ~300 packages, bash:

real	0m0.173s
user	0m0.142s
sys	0m0.030s
real	0m0.292s
user	0m0.246s
sys	0m0.048s
real	0m0.169s
user	0m0.134s
sys	0m0.035s

After step 2, I got a bunch of "Failed to load entry point" messages running the ros2 command. After completing step 3, the messages were no longer present and ros2 functioned as expected.

Failed to load entry point 'run': No module named 'ros2pkg'
Failed to load entry point 'test': No module named 'domain_coordinator'
Failed to load entry point 'security': No module named 'ament_index_python'
Failed to load entry point 'launch': No module named 'ament_index_python'
Failed to load entry point 'info': No module named 'ament_index_python'
...

@jacobperron
Copy link
Contributor

Ubuntu Bionic, ~280 packages, zsh:

I'm re-doing parts 1 and 2 (since I think I messed it up the first time).

For 3. I get an error when sourcing, but the environment seems okay:

$ time (. install/local_setup.zsh;)
_opensplice_prepend_unique_value:14: command not found: ament_zsh_to_array
( . install/local_setup.zsh; )  0.19s user 0.03s system 91% cpu 0.244 total

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
@dirk-thomas
Copy link
Contributor Author

For 3. I get an error when sourcing, but the environment seems okay:

Please see ros2/rosidl_typesupport_connext#36 and ros2/rosidl_typesupport_opensplice#43 which should fix this by not relying on the presence of the ament_zsh_to_array function.

@jacobperron
Copy link
Contributor

Please see ros2/rosidl_typesupport_connext#36 and ros2/rosidl_typesupport_opensplice#43 which should fix this by not relying on the presence of the ament_zsh_to_array function.

Resolves the error for me.

( . install/local_setup.zsh; )  0.15s user 0.09s system 41% cpu 0.593 total
( . install/local_setup.zsh; )  0.74s user 0.23s system 89% cpu 1.087 total
( . install/local_setup.zsh; )  0.16s user 0.05s system 87% cpu 0.247 total

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request in review Waiting for review (Kanban column)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants