rnpgp / rnp

RNP: high performance C++ OpenPGP library used by Mozilla Thunderbird
https://www.rnpgp.org
Other
194 stars 55 forks source link

Please add a way to disable installation of ruby bindings, and cloning ruby bindings for the tests #1267

Closed teythoon closed 3 years ago

teythoon commented 4 years ago

Description

When I do make, some ruby installer magic asks me to use sudo to install the gem. There are two problems with this. First, this is the build phase, not the install phase. Second, this disregards CMAKE_INSTALL_PREFIX.

Furthermore, when invoking the tests, cmake clones the ruby bindings to run its tests. There should be a way to disable this, because this won't work in build environments without network access. I guess the cloning of the ruby bindings happens now in the build phase too, and it is unacceptable for the same reasons.

Steps to Reproduce

  1. clone rnp
  2. cmake -DCMAKE_INSTALL_PREFIX=/tmp -DBUILD_SHARED_LIBS=on .
  3. make

Expected Behavior

RNP is built.

Actual Behavior

RNP is built, then I'm asked for my password to install the gem into locations unwritable for my user:

% make
[  3%] Built target rnp-common
[ 34%] Built target librnp-obj
[ 35%] Built target librnp
[ 37%] Built target encrypt
[ 38%] Built target decrypt
[ 40%] Built target sign
[ 42%] Built target verify
[ 44%] Built target dump
[ 45%] Built target generate
[ 46%] Built target librnp-static
[ 51%] Built target rnp
[ 56%] Built target rnpkeys
[ 57%] Performing update step for 'ruby-rnp'
Current branch master is up to date.
[ 57%] No configure step for 'ruby-rnp'
[ 58%] Performing build step for 'ruby-rnp'
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.........
Following files may not be writable, so sudo is needed:
  /usr/local/bin
  /var/lib/gems/2.5.0
Fetching rake 13.0.1

Your user account isn't allowed to install to the system RubyGems.
  You can cancel this installation and run:

      bundle install --path vendor/bundle

  to install the gems into ./vendor/bundle/, or you can enter your password
  and install the bundled gems to RubyGems using sudo.

  Password: 
ni4 commented 3 years ago

@dewyatt As I understand, ruby-rnp is installed only to run tests via CI/and/or locally? What about separation of rnp and ruby-rnp, moving all ruby-related things to CI in separate (or updated) workflows? Or, as a simpler solution, build with ruby-rnp only if specific option is given to cmake, like DBUILD_RUBY_RNP

dkg commented 3 years ago

Options in order of preference from my perspective: