rbenv / ruby-build

A tool to download, compile, and install Ruby on Unix-like systems.
https://rbenv.org/man/ruby-build.1
MIT License
3.89k stars 785 forks source link

CONFIGURE_OPTS='--disable-install-doc' is passed to the openssl build which fails #2413

Closed bughit closed 5 months ago

bughit commented 5 months ago

Steps to reproduce the behavior

on Ubuntu 24.04 with the latest rbenv and ruby-build run CONFIGURE_OPTS='--disable-install-doc' rbenv install -v 2.6.10

Expected vs. actual behavior

Logs

-> ./config "--prefix=$HOME/.rbenv/versions/2.6.10/openssl" "--openssldir=$HOME/.rbenv/versions/2.6.10/openssl/ssl" zlib-dynamic no-ssl3 shared --disable-install-doc

gcc  -I. -Iinclude -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 --disable-install-doc -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/home/user1/.rbenv/versions/2.6.10/openssl/ssl\"" -DENGINESDIR="\"/home/user1/.rbenv/versions/2.6.10/openssl/lib/engines-1.1\"" -DZLIB -DZLIB_SHARED -DNDEBUG  -MMD -MF apps/s_socket.d.tmp -MT apps/s_socket.o -c -o apps/s_socket.o apps/s_socket.c

cc1: error: unknown pass install-doc specified in '-fdisable'
mislav commented 5 months ago

Hello, when setting CONFIGURE_OPTS, the flags specified will be passed to compilation of any software within ruby-build, not just Ruby itself. In your case, --disable-install-doc is being passed to the compilation of OpenSSL, which naturally fails because its build mechanism doesn't recognize the flag.

To make sure your configure flags are passed only to Ruby and not anything else, use RUBY_CONFIGURE_OPTS. See https://github.com/rbenv/ruby-build#custom-build-configuration

Alternatively, you may pass ruby configure flags as arguments to rbenv install:

rbenv install -v 2.6.10 -- --disable-install-doc