Bug #8115

make install DESTDIR=/my/install/path fails

Added by Vit Ondruch about 1 year ago. Updated 10 months ago.

[ruby-core:53502]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
Category:-
Target version:-
ruby -v:ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux] Backport:

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 bymysql.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

[1] https://gist.github.com/voxik/5186924
=end

Makefile (7.1 KB) Vit Ondruch, 04/11/2013 12:16 AM

0001-mkmf-s-system-configuration-should-use-expanded-valu.patch Magnifier (1 KB) Vit Ondruch, 06/26/2013 04:54 AM

Associated revisions

Revision 39841
Added by Nobuyoshi Nakada about 1 year ago

mkmf.rb: prefix install_dirs only with DESTDIR

  • lib/mkmf.rb (installdirs, withdestdir): prefix with DESTDIR directories to install only unless bundled extension libraries. [Bug #8115]

Revision 41648
Added by Nobuyoshi Nakada 10 months ago

mkmf.rb: use expanded values

  • lib/mkmf.rb: should use expanded values for header directories unless extmk. patch by vo.x (Vit Ondruch) at [Bug #8115], rhbz#921650.

Revision 41756
Added by Nobuyoshi Nakada 10 months ago

mkmf.rb: revert DESTDIR prefix

  • lib/mkmf.rb (install_dirs): revert DESTDIR prefix by r39841, since it is fixed by r41648. [Bug #8115]

History

#1 Updated by Nobuyoshi Nakada about 1 year 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 (installdirs, withdestdir): prefix with DESTDIR directories to install only unless bundled extension libraries. [Bug #8115]

#2 Updated by Vit Ondruch about 1 year ago

  • File Makefile added
  • Status changed from Closed to Assigned

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.

#3 Updated by Vit Ondruch 11 months ago

This is still issue for -p195 :/

#4 Updated by Nobuyoshi Nakada 11 months ago

  • Tracker changed from Bug to Backport
  • Project changed from ruby-trunk to Backport200
  • Category deleted (build)
  • Assignee changed from Nobuyoshi Nakada to Tomoyuki Chikanaga

#5 Updated by Tomoyuki Chikanaga 10 months 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.
   [Bug #8115]

#6 Updated by Tomoyuki Chikanaga 10 months ago

Sorry for late response.

I've merged r39841 to ruby20_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,

#7 Updated by Josef Stribny 10 months 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]

[1] https://gist.github.com/strzibny/5748006

#8 Updated by Tomoyuki Chikanaga 10 months ago

  • Tracker changed from Backport to Bug
  • Project changed from Backport200 to ruby-trunk
  • Status changed from Closed to Assigned
  • Assignee changed from Tomoyuki Chikanaga to Nobuyoshi Nakada

Hello, Josef.

Thank you for your report.

I reopen this ticket.

#9 Updated by Nobuyoshi Nakada 10 months ago

  • Category set to ext
  • ruby -v set to 2.0.0

@jstribny, how did you configure p214?

#10 Updated by Vit Ondruch 10 months ago

nobu (Nobuyoshi Nakada) wrote:

@jstribny, 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

#11 Updated by Vit Ondruch 10 months ago

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.

#12 Updated by Nobuyoshi Nakada 10 months 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 [Bug #8115], rhbz#921650.

#13 Updated by Tomoyuki Chikanaga 10 months ago

  • Tracker changed from Bug to Backport
  • Project changed from ruby-trunk to Backport200
  • Category deleted (ext)
  • Status changed from Closed to Assigned
  • Assignee changed from Nobuyoshi Nakada to Tomoyuki Chikanaga

#14 Updated by Tomoyuki Chikanaga 10 months 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 
  [Bug #8115], rhbz#921650.

#15 Updated by Vit Ondruch 10 months ago

Thank you for applying and backporting the patch.

#16 Updated by Usaku NAKAMURA 10 months ago

  • Project changed from Backport200 to ruby-trunk
  • Status changed from Closed to Assigned
  • Assignee changed from Tomoyuki Chikanaga to 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.

#17 Updated by Vit Ondruch 10 months 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/vendorruby
RUBYARCHDIR = $(DESTDIR)$(vendorarchdir)$(target
prefix)

i.e. $(DESTDIR) is applied 2 times.

Not sure how I tested my patch, though. Sorry :/

#18 Updated by Nobuyoshi Nakada 10 months 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. [Bug #8115]

Also available in: Atom PDF