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

extconf.rb fails with ruby 3.2.0preview3 and onwards #30

Open
mtasaka opened this issue Dec 1, 2022 · 0 comments · May be fixed by #31
Open

extconf.rb fails with ruby 3.2.0preview3 and onwards #30

mtasaka opened this issue Dec 1, 2022 · 0 comments · May be fixed by #31

Comments

@mtasaka
Copy link

mtasaka commented Dec 1, 2022

For ruby-shadow 2.5.1, $ ruby extconf.rb with ruby 3.2.0preview3 and onwards fails like:

[mockbuild@6df3d7ad097f49839ba1c83ed9e69826 ruby-shadow-2.5.1]$ ruby extconf.rb
checking for ruby/io.h... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib64
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/bin/$(RUBY_BASE_NAME)
	--with-ruby-dir
	--without-ruby-dir
	--with-ruby-include
	--without-ruby-include=${ruby-dir}/include
	--with-ruby-lib
	--without-ruby-lib=${ruby-dir}/lib64
extconf.rb:68:in `<main>': You are missing some of the required functions from either shadow.h on Linux/Solaris, or pwd.h on FreeBSD/MirBSD/NetBSD/OpenBSD/OS X. (RuntimeError)

Note that with ruby3.2.0preview3 p CONFIG['host_os'] returns "$(target_os)". This is due to ruby/ruby@ed9d761 . In mkmf.rb, CONFIG is defined as RbConfig::MAKEFILE_CONFIG and RbConfig::MAKEFILE_CONFIG is almost same as RbConfig::CONFIG except that RbConfig::MAKEFILE_CONFIG uses reference for other variables.

mtasaka added a commit to mtasaka/ruby-shadow that referenced this issue Dec 1, 2022
In mkmf.rb CONFIG is defined as CONFIG is defined as RbConfig::MAKEFILE_CONFIG
and RbConfig::MAKEFILE_CONFIG is almost same as RbConfig::CONFIG
except that RbConfig::MAKEFILE_CONFIG uses reference for other variables.

Using CONFIG in extconf.rb causes error with ruby3.2 because now
CONFIG['host_os'] uses reference for target_os variable, and extconf.rb
expects that this variable is all expanded. So instead, use RbConfig::CONFIG .

Closes apalmblad#30
@mtasaka mtasaka linked a pull request Dec 1, 2022 that will close this issue
64kramsystem pushed a commit to ticketsolve/ruby-shadow-ruby32 that referenced this issue May 2, 2023
In mkmf.rb CONFIG is defined as CONFIG is defined as RbConfig::MAKEFILE_CONFIG
and RbConfig::MAKEFILE_CONFIG is almost same as RbConfig::CONFIG
except that RbConfig::MAKEFILE_CONFIG uses reference for other variables.

Using CONFIG in extconf.rb causes error with ruby3.2 because now
CONFIG['host_os'] uses reference for target_os variable, and extconf.rb
expects that this variable is all expanded. So instead, use RbConfig::CONFIG .

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

Successfully merging a pull request may close this issue.

1 participant