passenger-config build-native-support

704 views
Skip to first unread message

Jay Howard

unread,
Oct 17, 2016, 4:19:21 PM10/17/16
to Phusion Passenger Discussions
I'm attempting to build native support for ruby 2.2.4 on Centos6 w/ Passenger 5.0.30 (from repo, not gem).  Applications is Rails under Apache.

When I run "passenger-config build-native-support" I get a failure that directs me to a log file, which contains:

# current user is: root
# mkdir -p /root/.passenger/native_support/5.0.30/ruby-2.2.4-x86_64-linux
# cd /root/.passenger/native_support/5.0.30/ruby-2.2.4-x86_64-linux
# /usr/local/rvm/gems/ruby-2.2.4/wrappers/ruby /usr/share/passenger/ruby_extension_source/extconf.rb
checking for alloca.h... *** /usr/share/passenger/ruby_extension_source/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.

I also tried running passenger-config as the user our application runs under, but the result was the same.

The file alloca.h exists where I'd expect it to, i.e. /usr/include.

Also, when I manually cd to "/root/.passenger/native_support/5.0.30/ruby-2.2.4-x86_64-linux" and run "/usr/local/rvm/gems/ruby-2.2.4/wrappers/ruby /usr/share/passenger/ruby_extension_source/extconf.rb" it completes successfully and a Makefile is generated.

Any thoughts?

Jay Howard

unread,
Oct 21, 2016, 5:28:07 PM10/21/16
to Phusion Passenger Discussions
I notice that pre-built extensions are available for Ruby 2.2.3 here:

https://oss-binaries.phusionpassenger.com/binaries/passenger/by_release/5.0.30/

...but not for Ruby 2.2.4.  Given I'm not able to build them myself, any idea when pre-built extensions will be available for Ruby 2.2.4?

--
You received this message because you are subscribed to a topic in the Google Groups "Phusion Passenger Discussions" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/phusion-passenger/EYBeROcX3v8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to phusion-passenger+unsubscribe@googlegroups.com.
To post to this group, send email to phusion-passenger@googlegroups.com.
Visit this group at https://groups.google.com/group/phusion-passenger.
To view this discussion on the web visit https://groups.google.com/d/msgid/phusion-passenger/d18ab063-32ff-4533-bdbb-c1d96e03e36c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Camden Narzt

unread,
Oct 25, 2016, 11:03:12 AM10/25/16
to Phusion Passenger Discussions
we'll likely make more prebuilt extentions around the time that we release the next update to passenger. Can you dump your shell's env vars? there's clearly some difference between the build environment that is used and what you have your shell set to.

Jay Howard

unread,
Oct 25, 2016, 2:44:43 PM10/25/16
to Phusion Passenger Discussions
Log follows.  After I run "passenger-config build-native-support" and it fails, I can manually go into the directory where it tries to create the Makefile and run the exact same command ("/usr/local/rvm/gems/ruby-2.2.4/wrappers/ruby /usr/share/passenger/ruby_extension_source/extconf.rb"), and it works.  I can then run make + make install to install the shared lib.


[myuser@myhost ~]$ passenger-config build-native-support
 [passenger_native_support.so] trying to compile for the current user (myuser) and Ruby interpreter...
     (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
     Warning: compilation didn't succeed. To learn why, read this file:
     /tmp/passenger_native_support-5nj6qw.log
 [passenger_native_support.so] finding downloads for the current Ruby interpreter...
     (set PASSENGER_DOWNLOAD_NATIVE_SUPPORT_BINARY=0 to disable)
     Could not download https://oss-binaries.phusionpassenger.com/binaries/passenger/by_release/5.0.30/rubyext-ruby-2.2.4-x86_64-linux.tar.gz: The requested URL returned error: 404 Not Found
     Trying next mirror...
     Could not download https://s3.amazonaws.com/phusion-passenger/binaries/passenger/by_release/5.0.30/rubyext-ruby-2.2.4-x86_64-linux.tar.gz: The requested URL returned error: 403 Forbidden
 [passenger_native_support.so] will not be used (can't compile or download)
  --> Passenger will still operate normally.
[myuser@myhost ~]$ uname -a
Linux myhost.mydomain.com 2.6.32-642.3.1.el6.x86_64 #1 SMP Tue Jul 12 18:30:56 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[myuser@myhost ~]$ cat /etc/redhat-release
CentOS release 6.8 (Final)
[myuser@myhost ~]$ passenger-status
Version : 5.0.30
Date    : Tue Oct 25 13:34:49 -0500 2016
Instance: ypfd5Q4f (Apache/2.2.15 (Unix) DAV/2 Phusion_Passenger/5.0.30)

----------- General information -----------
Max pool size : 20
App groups    : 1
Processes     : 10
Requests in top-level queue : 0

----------- Application groups -----------
/websites/myapp:
  App root: /websites/myapp
  Requests in queue: 0
  * PID: 34201   Sessions: 0       Processed: 2       Uptime: 33s
    CPU: 1%      Memory  : 216M    Last used: 32s ago
  * PID: 34209   Sessions: 0       Processed: 0       Uptime: 32s
    CPU: 0%      Memory  : 166M    Last used: 32s ago
  * PID: 34216   Sessions: 0       Processed: 0       Uptime: 32s
    CPU: 0%      Memory  : 132M    Last used: 32s ago
  * PID: 34223   Sessions: 0       Processed: 0       Uptime: 32s
    CPU: 0%      Memory  : 73M     Last used: 32s ago
  * PID: 34230   Sessions: 0       Processed: 0       Uptime: 31s
    CPU: 0%      Memory  : 73M     Last used: 31s ago
  * PID: 34237   Sessions: 0       Processed: 0       Uptime: 31s
    CPU: 0%      Memory  : 73M     Last used: 31s ago
  * PID: 34244   Sessions: 0       Processed: 0       Uptime: 31s
    CPU: 0%      Memory  : 73M     Last used: 31s ago
  * PID: 34251   Sessions: 0       Processed: 0       Uptime: 31s
    CPU: 0%      Memory  : 73M     Last used: 31s ago
  * PID: 34258   Sessions: 0       Processed: 0       Uptime: 30s
    CPU: 0%      Memory  : 73M     Last used: 30s ago
  * PID: 34265   Sessions: 0       Processed: 0       Uptime: 30s
    CPU: 0%      Memory  : 3M      Last used: 30s ago

[myuser@myhost ~]$ export
declare -x EDITOR="nano"
declare -x GEM_HOME="/usr/local/rvm/gems/ruby-2.2.4"
declare -x GEM_PATH="/usr/local/rvm/gems/ruby-2.2.4:/usr/local/rvm/gems/ruby-2.2.4@global"
declare -x GX_TMP_DIR="/root/.rackspace/mngd_backup/gxsetup"
declare -x G_BROKEN_FILENAMES="1"
declare -x HISTCONTROL="ignoredups"
declare -x HISTSIZE="10000"
declare -x HISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S "
declare -x HOME="/home/myuser"
declare -x HOSTNAME="myhost.mydomain.com"
declare -x IRBRC="/usr/local/rvm/rubies/ruby-2.2.4/.irbrc"
declare -x LANG="en_US.UTF-8"
declare -x LESSOPEN="||/usr/bin/lesspipe.sh %s"
declare -x LOGNAME="myuser"
declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:"
declare -x MAIL="/var/spool/mail/jhoward"
declare -x MY_RUBY_HOME="/usr/local/rvm/rubies/ruby-2.2.4"
declare -x OLDPWD="/root"
declare -x PATH="/usr/local/rvm/gems/ruby-2.2.4/bin:/usr/local/rvm/gems/ruby-2.2.4@global/bin:/usr/local/rvm/rubies/ruby-2.2.4/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/rvm/bin"
declare -x PWD="/home/myuser"
declare -x RUBY_VERSION="ruby-2.2.4"
declare -x SHELL="/bin/bash"
declare -x SHLVL="2"
declare -x SUDO_COMMAND="/bin/su"
declare -x SUDO_GID="506"
declare -x SUDO_UID="506"
declare -x SUDO_USER="jhoward"
declare -x TERM="xterm-color"
declare -x USER="myuser"
declare -x USERNAME="root"
declare -x _system_arch="x86_64"
declare -x _system_name="CentOS"
declare -x _system_type="Linux"
declare -x _system_version="6"
declare -x rvm_alias_expanded
declare -x rvm_bin_flag
declare -x rvm_bin_path="/usr/local/rvm/bin"
declare -x rvm_delete_flag
declare -x rvm_docs_type
declare -x rvm_file_name
declare -x rvm_gemstone_package_file
declare -x rvm_gemstone_url
declare -x rvm_hook
declare -x rvm_niceness
declare -x rvm_nightly_flag
declare -x rvm_only_path_flag
declare -x rvm_path="/usr/local/rvm"
declare -x rvm_prefix="/usr/local"
declare -x rvm_proxy
declare -x rvm_quiet_flag
declare -x rvm_ruby_alias
declare -x rvm_ruby_bits
declare -x rvm_ruby_configure
declare -x rvm_ruby_file
declare -x rvm_ruby_global_gems_path
declare -x rvm_ruby_make
declare -x rvm_ruby_make_install
declare -x rvm_ruby_mode
declare -x rvm_ruby_string
declare -x rvm_ruby_url
declare -x rvm_script_name
declare -x rvm_sdk
declare -x rvm_silent_flag
declare -x rvm_sticky_flag
declare -x rvm_system_flag
declare -x rvm_use_flag
declare -x rvm_user_flag
declare -x rvm_version="1.27.0 (latest)"
declare -x rvm_wrapper_name
[myuser@myhost ~]$ cat /tmp/passenger_native_support-5nj6qw.log
# current user is: myuser
# mkdir -p /home/myuser/.passenger/native_support/5.0.30/ruby-2.2.4-x86_64-linux
# cd /home/myuser/.passenger/native_support/5.0.30/ruby-2.2.4-x86_64-linux

# /usr/local/rvm/gems/ruby-2.2.4/wrappers/ruby /usr/share/passenger/ruby_extension_source/extconf.rb
checking for alloca.h... *** /usr/share/passenger/ruby_extension_source/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}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=/usr/share/passenger/ruby_extension_source
    --curdir
    --ruby=/usr/local/rvm/rubies/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
/usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:587:in `try_cpp'
    from /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:1060:in `block in have_header'
    from /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
    from /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:321:in `open'
    from /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
    from /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:321:in `open'
    from /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
    from /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
    from /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:1059:in `have_header'
    from /usr/share/passenger/ruby_extension_source/extconf.rb:38:in `<main>'



Camden Narzt

unread,
Oct 26, 2016, 6:07:11 PM10/26/16
to Phusion Passenger Discussions, jho...@alumni.utexas.net
Your env looks normal. I just created a fresh CentOS VM and installed rvm, ruby 2.2.4, passenger and the native extensions without any issue. So I'm not sure what's going on here.

One difference (though this shouldn't matter in practice) is that I wasn't running passenger when I built the native support, another possibly more important detail is that I had added my user to the wheel group.

It's also possible that there is some problem with your g++ install, because the specific failure is that the compiler either failed or doesn't exist.

What is the output of re-running

sudo yum install -y curl gpg gcc gcc-c++ make

Jay Howard

unread,
Oct 26, 2016, 6:20:56 PM10/26/16
to Camden Narzt, Phusion Passenger Discussions
[jhoward@myhost ~]$ sudo yum install -y curl gpg gcc gcc-c++ make
[sudo] password for jhoward:
Loaded plugins: rhnplugin, security
This system is receiving updates from RHN Classic or Red Hat Satellite.
Setting up Install Process
[...clip list of repositories...]
Package curl-7.19.7-52.el6.x86_64 already installed and latest version
Package gnupg2-2.0.14-8.el6.x86_64 already installed and latest version
Package gcc-4.4.7-17.el6.x86_64 already installed and latest version
Package gcc-c++-4.4.7-17.el6.x86_64 already installed and latest version
Package 1:make-3.81-23.el6.x86_64 already installed and latest version
Nothing to do

If gcc/g++ were missing or mis-configured then I would expect "make" to fail when I run it manually.

Possibly some bug in "mkmf"?  That's used by /usr/share/passenger/ruby_extension_source/extconf.rb.  Looks like it's calling "have_header()" to check for the existence of alloca.h, which is what's failing.

Jay Howard

unread,
Oct 26, 2016, 6:24:21 PM10/26/16
to Camden Narzt, Phusion Passenger Discussions
Notably, also:

[jhoward@myhost ~]$ irb
2.2.4 :001 > require 'mkmf'
 => true
2.2.4 :002 > have_header("alloca.h")
checking for alloca.h... yes
 => true

Camden Narzt

unread,
Oct 27, 2016, 10:45:34 AM10/27/16
to Phusion Passenger Discussions, camden...@gmail.com, jho...@alumni.utexas.net
If you trace /usr/local/rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb from line 456 the "The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first." message is generated because have_devel? fails, and if you trace that back to line 528 try_link0 tries to create a temp dir in order to test the linker, it may be that is what's failing and the alloca.h message is a red-herring.

In any case we're going to create new binaries soon, so this issue will go away at that point.
Reply all
Reply to author
Forward
0 new messages