orocos-toolchain / utilrb

A small set of useful Ruby classes and extensions
Other
2 stars 13 forks source link

[toolchain-2.9] Invalid RUBYOPT causing further cmake errors #41

Closed mjbogusz closed 5 years ago

mjbogusz commented 6 years ago

When building utilrb in a catkin workspace (using branch toolchain-2.9), utilrb/env-hooks/00.utilrb.sh.in sets RUBYOPT to -rubygems while it should set it to rubygems or rrubygems (- is implied and ubygems module is deprecated).

With current value it breaks ruby detection during cmake's configure stage in packages depending on both utilrb and ruby - e.g. orogen.

meyerj commented 6 years ago

The option has been copied from the original orocos_toolchain env-script at https://github.com/orocos-toolchain/orocos_toolchain/blob/master/env.sh#L4.

From the ruby man page:

RUBYOPT    Additional Ruby options.

                e.g.
                      RUBYOPT="-w -Ke"

                Note that RUBYOPT can contain only -d, -E, -I, -K, -r, -T, -U,
                -v, -w, -W, --debug, --disable-FEATURE and --enable-FEATURE.

Also found this older thread: https://www.ruby-forum.com/topic/63352

So for me it looks like -rrubygems (including the hyphen) would be the correct setting for RUBYOPT that does not depend on the deprecated ubygems library removed in Ruby 2.5.

Is the option required at all with Ruby 1.9+? What is the minimum supported Ruby version?

mjbogusz commented 6 years ago

You're right, -rrubygems would be the correct one, though according to https://guides.rubygems.org/patterns/#requiring-rubygems it may be even better to skip it altogether.

meyerj commented 5 years ago

Fixed in #42.