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

Consider binaries to implement the functionality offered by gz #7

Open
osrf-migration opened this issue Nov 20, 2019 · 6 comments
Open
Assignees
Labels
proposal Windows Windows support

Comments

@osrf-migration
Copy link

Original report (archived issue) by Carlos Agüero (Bitbucket: caguero, GitHub: caguero).


Right now, ign is a ruby script that offers several subcommands (topic, msg, etc.). Each subcommand is implemented by a function inside a versioned Ignition shared library. ign also keeps track of multiple versions of the same library. This approach has some issues, in particular we have detected:

  1. Difficulty for using gdb when running ign. Imagine for example running ign gazebo …
  2. Portability issues. E.g.: On Windows, there are ABI problems interacting from Ruby (compiled with MinGW) and an Ignition shared library (compiled with Visual Studio).

An idea for mitigating these issues might be to move the functionality from a shared library to a binary (e.g.: igntopic). In this case, ign should invoke the right external binary. The solution to (1) is to run gdb with the binary directly without using ign. (2) probably won’t happen again as we wouldn’t need to interact with a shared library anymore, just executing an external binary which looks less involved.

On the other hand, each Ignition library should do some refactor and expose a binary (or a collection of binaries) that capture all functionality to be executed from the command line.

@chapulina
Copy link
Contributor

ign-tools itself should not be limited to loading shared libraries right now. This is being done at each library's Ruby file, for example cmdtransport.rb.in.

To use executables in ign-transport for example, one would need to:

  • Install executables that provide the command line functionality, like topic and service
  • Call those from the Ruby script instead of loading a shared lib
  • It may be interesting to move the command line argument parsing from Ruby to the executables

@scpeters
Copy link
Member

ign-tools itself should not be limited to loading shared libraries right now. This is being done at each library's Ruby file, for example cmdtransport.rb.in.

To use executables in ign-transport for example, one would need to:

  • Install executables that provide the command line functionality, like topic and service
  • Call those from the Ruby script instead of loading a shared lib
  • It may be interesting to move the command line argument parsing from Ruby to the executables

we are doing this in gazebosim/gz-transport#216 using the cli component of ign-utils

@chapulina
Copy link
Contributor

Let's close this issue once all libraries have migrated to binaries.

@traversaro
Copy link
Contributor

2\. Portability issues. E.g.: On Windows, there are ABI problems interacting from Ruby (compiled with MinGW) and an Ignition shared library (compiled with Visual Studio).

I guess anyone that tried this on Windows know this, but just to record this for future readers: another problem that is present in Windows when using shell such as Command Prompt or Powershell is that bash-based shebangs do not work, so even if ign.rb is part of the path, just typing ign does not execute any command, and you need to run ruby %CONDA_PREFIX%\Library\bin\ign.rb or something like that.

@traversaro
Copy link
Contributor

2\. Portability issues. E.g.: On Windows, there are ABI problems interacting from Ruby (compiled with MinGW) and an Ignition shared library (compiled with Visual Studio).

I guess anyone that tried this on Windows know this, but just to record this for future readers: another problem that is present in Windows when using shell such as Command Prompt or Powershell is that bash-based shebangs do not work, so even if ign.rb is part of the path, just typing ign does not execute any command, and you need to run ruby %CONDA_PREFIX%\Library\bin\ign.rb or something like that.

For historical reference, that was eventually fixed in #73 .

@azeey azeey changed the title Consider binaries to implement the functionality offered by ign Consider binaries to implement the functionality offered by gz May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Windows Windows support
Projects
Status: In progress
Core development
In progress
Development

No branches or pull requests

5 participants