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

Giving multiple optflags raises unrecognized option error. #2332

Closed
k0i opened this issue Jan 5, 2024 · 3 comments
Closed

Giving multiple optflags raises unrecognized option error. #2332

k0i opened this issue Jan 5, 2024 · 3 comments
Labels

Comments

@k0i
Copy link

k0i commented Jan 5, 2024

Steps to reproduce the behavior

It can be reproduced by executing the following command:

RUBY_CONFIGURE_OPTS='optflags="-O0 -fno-omit-frame-pointer"' ruby-build 3.3.0 ./

Expected vs. actual behavior

Expected

Although I found the same issue in the past, the problem was regarded as fixed then.
So, this command should also be successful.
(If ruby-build doesn't support taking optflags as its argument, please kindly close this issue.)

Actual

It raises the following error:

-> ./configure "--prefix=$HOME/.rbenv/versions/3.3.0" --enable-shared --with-ext=openssl,psych,+ optflags="-O0 -fno-omit-frame-pointer"
configure: error: unrecognized option: `-fno-omit-frame-pointer"'

It succeeds if I attempt to configure manually in the ruby repository.
(I attached the truncated manual build result in this section just in case 🙇 )

Manual Build Success Log(Truncate)

$ ./configure "--prefix=$HOME/.rbenv/versions/3.3.0" --enable-shared --with-ext=openssl,psych,+ optflags="-O0 -fno-omit-frame-pointer"
checking for ruby... /home/ec2-user/.rbenv/shims/ruby

...

---
Configuration summary for ruby version 3.4.0

   * Installation prefix: /home/ec2-user/.rbenv/versions/3.3.0
   * exec prefix:         ${prefix}
   * arch:                x86_64-linux
   * site arch:           ${arch}
   * RUBY_BASE_NAME:      ruby
   * enable shared:       yes
   * ruby lib prefix:     ${libdir}/${RUBY_BASE_NAME}
   * site libraries path: ${rubylibprefix}/${sitearch}
   * vendor path:         ${rubylibprefix}/vendor_ruby
   * target OS:           linux
   * compiler:            gcc
   * with thread:         pthread
   * with coroutine:      amd64
   * enable shared libs:  yes
   * dynamic library ext: so
   * CFLAGS:              ${optflags} ${debugflags} ${warnflags}
   * LDFLAGS:             -L. -fstack-protector-strong -rdynamic \
                          -Wl,-export-dynamic -Wl,--no-as-needed
   * DLDFLAGS:            -Wl,--compress-debug-sections=zlib
   * optflags:            -O0 -fno-omit-frame-pointer -fno-fast-math
   * debugflags:          -ggdb3
   * warnflags:           -Wall -Wextra -Wdeprecated-declarations \
                          -Wdiv-by-zero -Wduplicated-cond \
                          -Wimplicit-function-declaration -Wimplicit-int \
                          -Wpointer-arith -Wwrite-strings \
                          -Wold-style-definition -Wimplicit-fallthrough=0 \
                          -Wmissing-noreturn -Wno-cast-function-type \
                          -Wno-constant-logical-operand -Wno-long-long \
                          -Wno-missing-field-initializers \
                          -Wno-overlength-strings \
                          -Wno-packed-bitfield-compat \
                          -Wno-parentheses-equality -Wno-self-assign \
                          -Wno-tautological-compare -Wno-unused-parameter \
                          -Wno-unused-value -Wsuggest-attribute=format \
                          -Wsuggest-attribute=noreturn -Wunused-variable \
                          -Wmisleading-indentation -Wundef
   * strip command:       strip -S -x
   * install doc:         rdoc
   * YJIT support:        no
   * RJIT support:        yes
   * man page type:       doc
   * BASERUBY -v:         ruby 3.0.0p0 (2020-12-25 revision 95aff21468) \
                          [x86_64-linux]

Logs

Execution Log

$ RUBY_CONFIGURE_OPTS='optflags="-O0 -fno-omit-frame-pointer"' rbenv install 3.3.0
==> Downloading ruby-3.3.0.tar.gz...
-> curl -q -fL -o ruby-3.3.0.tar.gz https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 21.0M  100 21.0M    0     0  99.5M      0 --:--:-- --:--:-- --:--:-- 99.7M
==> Installing ruby-3.3.0...
-> ./configure "--prefix=$HOME/.rbenv/versions/3.3.0" --enable-shared --with-ext=openssl,psych,+ optflags="-O0 -fno-omit-frame-pointer"

BUILD FAILED (Amazon Linux 2 on x86_64 using ruby-build 20231225-2-g3b79c29)

You can inspect the build directory at /tmp/ruby-build.20240105075441.17243.qCq5KW
See the full build log at /tmp/ruby-build.20240105075441.17243.log

Build Log(/tmp/ruby-build.20240105075441.17243.log)

cd /tmp/ruby-build.20240105075441.17243.qCq5KW
==> Downloading ruby-3.3.0.tar.gz...
-> curl -q -fL -o ruby-3.3.0.tar.gz https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz
-> tar xzf ruby-3.3.0.tar.gz
cd /tmp/ruby-build.20240105075441.17243.qCq5KW/ruby-3.3.0
==> Installing ruby-3.3.0...
-> ./configure "--prefix=$HOME/.rbenv/versions/3.3.0" --enable-shared --with-ext=openssl,psych,+ optflags="-O0 -fno-omit-frame-pointer"
configure: error: unrecognized option: `-fno-omit-frame-pointer"'
Try `./configure --help' for more information
external command failed with status 1
@k0i k0i added the bug label Jan 5, 2024
@k0i
Copy link
Author

k0i commented Jan 6, 2024

I will close this issue as I can solve this is not a bug.
Sorry for disturbing you.

@k0i k0i closed this as completed Jan 6, 2024
@mislav
Copy link
Member

mislav commented Jan 7, 2024

RUBY_CONFIGURE_OPTS is not able to pass configure values that have spaces, even if those values are quoted like in your example.

However, you may pass those values as arguments to ruby-build after a -- argument separator:

ruby-build 3.3.0 ./ -- optflags="-O0 -fno-omit-frame-pointer"

@k0i
Copy link
Author

k0i commented Jan 7, 2024

Thank you for your kind explanation! 🙇 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants