Bug #8115
closedmake install DESTDIR=/my/install/path fails
Description
=begin
In Fedora packaging, we used to use (({make install DESTDIR=/my/install/path})) to install compiled extension into the folder, which RPM used to pick up the extension. However, since Ruby 2.0.0, this approach fails with message such as;
make install DESTDIR=/builddir/build/BUILDROOT/ruby-mysql-2.8.2-9.fc20.i386
make: *** No rule to make target /builddir/build/BUILDROOT/ruby-mysql-2.8.2-9.fc20.i386/usr/include/ruby.h', needed by
mysql.o'. Stop.
Apparently, the mkmf creates Makefile, where everything depends on DESTDIR (see the diff of makefiles here [1]). This is wrong IMO, since obviously Ruby's header files location has nothing to do with location I'd like to install my libraries.
Could you fix this issue? Or if that was always wrong approach, could you provide us better one?
Please note that this was originally reported here: https://bugzilla.redhat.com/show_bug.cgi?id=921650
Files
Updated by nobu (Nobuyoshi Nakada) almost 12 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r39841.
Vit, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
mkmf.rb: prefix install_dirs only with DESTDIR
- lib/mkmf.rb (install_dirs, with_destdir): prefix with DESTDIR
directories to install only unless bundled extension libraries.
[ruby-core:53502] [Bug #8115]
Updated by vo.x (Vit Ondruch) over 11 years ago
I backported the patch for Ruby 2.0.0-p0, but I can't see any difference. I might be doing something wrong, but I am afraid that the patch does not fixes our issues. Please see the attached Makefile. Thank you.
Updated by vo.x (Vit Ondruch) over 11 years ago
This is still issue for -p195 :/
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
- Tracker changed from Bug to Backport
- Project changed from Ruby master to Backport200
- Category deleted (
build) - Assignee changed from nobu (Nobuyoshi Nakada) to nagachika (Tomoyuki Chikanaga)
Updated by nagachika (Tomoyuki Chikanaga) over 11 years ago
- Status changed from Assigned to Closed
This issue was solved with changeset r41193.
Vit, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
merge revision(s) 39841: [Backport #8115]
* lib/mkmf.rb (install_dirs, with_destdir): prefix with DESTDIR
directories to install only unless bundled extension libraries.
[ruby-core:53502] [Bug #8115]
Updated by nagachika (Tomoyuki Chikanaga) over 11 years ago
Sorry for late response.
I've merged r39841 to ruby_2_0_0 at r41193.
Vit:
Please check ruby-2.0.0 patchlevel 214 or higher.
If this issue is not fixed, please reopen this ticket or create a new one.
Regards,
Updated by jstribny (Josef Stribny) over 11 years ago
This doesn't seem to help.
I am still getting the following error with the generated Makefile[1]
+ ruby extconf.rb --vendor --with-mysql-config
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... yes
checking for rb_thread_start_timer()... no
checking for mysql.h... yes
extconf.rb:40:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
extconf.rb:40:in `<main>': Use RbConfig instead of obsolete and deprecated Config.
creating Makefile
+ make -j4
gcc -I. -I/usr/include/x86_64-linux -I/usr/include/ruby/backward -I/usr/include -I. -DHAVE_MYSQL_SSL_SET -DHAVE_RB_STR_SET_LEN -DHAVE_MYSQL_H -I/usr/include/mysql -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1 -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -m64 -o mysql.o -c mysql.c
rm -f mysql.so
gcc -shared -o mysql.so mysql.o -L. -L/usr/lib64 -L. -Wl,-z,relro -fstack-protector -rdynamic -Wl,-export-dynamic -m64 -lruby -L/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -lssl -lcrypto -ldl -lpthread -lrt -ldl -lcrypt -lm -lc
+ exit 0
...
+ make install DESTDIR=/builddir/build/BUILDROOT/ruby-mysql-2.8.2-9.fc20.x86_64
make: *** No rule to make target `/builddir/build/BUILDROOT/ruby-mysql-2.8.2-9.fc20.x86_64/usr/include/ruby.h', needed by `mysql.o'. Stop.
Ruby version:
ruby -v¶
ruby 2.0.0p214 (2013-06-09 revision 41193) [x86_64-linux]
Updated by nagachika (Tomoyuki Chikanaga) over 11 years ago
- Tracker changed from Backport to Bug
- Project changed from Backport200 to Ruby master
- Status changed from Closed to Assigned
- Assignee changed from nagachika (Tomoyuki Chikanaga) to nobu (Nobuyoshi Nakada)
Hello, Josef.
Thank you for your report.
I reopen this ticket.
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
- Category set to ext
- ruby -v set to 2.0.0
@jstribny (Josef Stribny), how did you configure p214?
Updated by vo.x (Vit Ondruch) over 11 years ago
nobu (Nobuyoshi Nakada) wrote:
@jstribny (Josef Stribny), how did you configure p214?
Please see Fedora Ruby's build log: http://kojipkgs.fedoraproject.org//packages/ruby/2.0.0.195/8.fc20/data/logs/i686/build.log
Updated by vo.x (Vit Ondruch) over 11 years ago
- File 0001-mkmf-s-system-configuration-should-use-expanded-valu.patch 0001-mkmf-s-system-configuration-should-use-expanded-valu.patch added
This seems to be related to r37015. Prior this commit, there used to be $hdrdir = RbConfig::CONFIG["rubyhdrdir"], i.e. $hdrdir contained expanded path to Ruby's header files, while after the r37015 changes it essentially to use $hdrdir = RbConfig::MAKEFILE_CONFIG["rubyhdrdir"], which contains the additional $(DESTDIR) which is later wrongly evaluated. The attached patch should fix this issue.
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
- Status changed from Assigned to Closed
This issue was solved with changeset r41648.
Vit, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
mkmf.rb: use expanded values
- lib/mkmf.rb: should use expanded values for header directories
unless extmk. patch by vo.x (Vit Ondruch) at [ruby-core:55653]
[Bug #8115], rhbz#921650.
Updated by nagachika (Tomoyuki Chikanaga) over 11 years ago
- Tracker changed from Bug to Backport
- Project changed from Ruby master to Backport200
- Category deleted (
ext) - Status changed from Closed to Assigned
- Assignee changed from nobu (Nobuyoshi Nakada) to nagachika (Tomoyuki Chikanaga)
Updated by nagachika (Tomoyuki Chikanaga) over 11 years ago
- Status changed from Assigned to Closed
This issue was solved with changeset r41658.
Vit, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
merge revision(s) 41648: [Backport #8115]
* lib/mkmf.rb: should use expanded values for header directories
unless extmk. patch by vo.x (Vit Ondruch) at [ruby-core:55653]
[Bug #8115], rhbz#921650.
Updated by vo.x (Vit Ondruch) over 11 years ago
Thank you for applying and backporting the patch.
Updated by usa (Usaku NAKAMURA) over 11 years ago
- Project changed from Backport200 to Ruby master
- Status changed from Closed to Assigned
- Assignee changed from nagachika (Tomoyuki Chikanaga) to nobu (Nobuyoshi Nakada)
- Tracker changed from Backport to Bug
On Windows, when making extensions, `nmake install' now causes error because rubylibprefix (and others) has "C:C:" prefix.
I think we need to split ruby's path and extensions one more strictly.
Updated by vo.x (Vit Ondruch) over 11 years ago
- ruby -v set to ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
usa (Usaku NAKAMURA) wrote:
On Windows, when making extensions, `nmake install' now causes error because rubylibprefix (and others) has "C:C:" prefix.
I think we need to split ruby's path and extensions one more strictly.
I would say that r39841 should be reverted, since it never fixed my issues. Moreover, it introduces another issue, e.g. from my makefile:
vendorarchdir = $(DESTDIR)/usr/lib64/ruby/vendor_ruby
RUBYARCHDIR = $(DESTDIR)$(vendorarchdir)$(target_prefix)
i.e. $(DESTDIR) is applied 2 times.
Not sure how I tested my patch, though. Sorry :/
Updated by nobu (Nobuyoshi Nakada) over 11 years ago
- Status changed from Assigned to Closed
This issue was solved with changeset r41756.
Vit, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
mkmf.rb: revert DESTDIR prefix
- lib/mkmf.rb (install_dirs): revert DESTDIR prefix by r39841, since
it is fixed by r41648. [ruby-core:55760] [Bug #8115]
Updated by nobu (Nobuyoshi Nakada) almost 10 years ago
- Backport set to 2.0.0: REQUIRED, 2.1: DONE
Updated by usa (Usaku NAKAMURA) almost 10 years ago
- Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: DONE, 2.1: DONE
ruby_2_0_0 r49444 merged revision(s) 41756.