Project

General

Profile

Bug #12681

Gemfied tk issue

Added by vo.x (Vit Ondruch) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.4.0dev (2016-08-16 trunk 55915) [x86_64-linux]
[ruby-core:76931]

Description

First of all, thank you for moving Tk into independent gem.

Nevertheless, I have one concern. So far, you left the tcltklib.so and tkutil.so under ruby lib directory. This is unfortunately major flaw, since the Tk gem is not one of the default gems. Hence, if you install more versions of Tk library, there might be collision among them.

Also, the "gem install tk" does not build the extension, so that is another source of possible issues.


Related issues

Related to Ruby trunk - Feature #8539: Unbundle ext/tkClosed
Related to Ruby trunk - Bug #12714: make で $(topdir)/.ext/gems が作成されるClosed

Associated revisions

Revision 9839d82d
Added by nobu (Nobuyoshi Nakada) over 1 year ago

gem extensions

  • ext/extmk.rb: build gem extensions into separate directories
  • tool/rbinstall.rb: install pre-built gem extension files gem extension directories. [Bug #12681]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 55950
Added by nobu (Nobuyoshi Nakada) over 1 year ago

gem extensions

  • ext/extmk.rb: build gem extensions into separate directories
  • tool/rbinstall.rb: install pre-built gem extension files gem extension directories. [Bug #12681]

Revision 55950
Added by nobu (Nobuyoshi Nakada) over 1 year ago

gem extensions

  • ext/extmk.rb: build gem extensions into separate directories
  • tool/rbinstall.rb: install pre-built gem extension files gem extension directories. [Bug #12681]

Revision 55950
Added by nobu (Nobuyoshi Nakada) over 1 year ago

gem extensions

  • ext/extmk.rb: build gem extensions into separate directories
  • tool/rbinstall.rb: install pre-built gem extension files gem extension directories. [Bug #12681]

Revision 1b6a42d9
Added by nobu (Nobuyoshi Nakada) over 1 year ago

mkmf.rb: TARGET_SO_DIR

  • ext/extmk.rb: move TARGET_SO_DIR stuffs to mkmf.rb.
  • lib/mkmf.rb (create_makefile): create target shared object files under $(TARGET_SO_DIR) which is $sodir if it is defined with $extout. [Bug #12681]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 56047
Added by nobu (Nobuyoshi Nakada) over 1 year ago

mkmf.rb: TARGET_SO_DIR

  • ext/extmk.rb: move TARGET_SO_DIR stuffs to mkmf.rb.
  • lib/mkmf.rb (create_makefile): create target shared object files under $(TARGET_SO_DIR) which is $sodir if it is defined with $extout. [Bug #12681]

Revision 56047
Added by nobu (Nobuyoshi Nakada) over 1 year ago

mkmf.rb: TARGET_SO_DIR

  • ext/extmk.rb: move TARGET_SO_DIR stuffs to mkmf.rb.
  • lib/mkmf.rb (create_makefile): create target shared object files under $(TARGET_SO_DIR) which is $sodir if it is defined with $extout. [Bug #12681]

Revision 56047
Added by nobu (Nobuyoshi Nakada) over 1 year ago

mkmf.rb: TARGET_SO_DIR

  • ext/extmk.rb: move TARGET_SO_DIR stuffs to mkmf.rb.
  • lib/mkmf.rb (create_makefile): create target shared object files under $(TARGET_SO_DIR) which is $sodir if it is defined with $extout. [Bug #12681]

Revision 7f7aa9d4
Added by nobu (Nobuyoshi Nakada) over 1 year ago

extmk.rb: build_complete

  • ext/extmk.rb (create_makefile): make gem.build_complete file under TARGET_SO_DIR and install it only when the gem build succeeded. [Bug #12681]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 56048
Added by nobu (Nobuyoshi Nakada) over 1 year ago

extmk.rb: build_complete

  • ext/extmk.rb (create_makefile): make gem.build_complete file under TARGET_SO_DIR and install it only when the gem build succeeded. [Bug #12681]

Revision 56048
Added by nobu (Nobuyoshi Nakada) over 1 year ago

extmk.rb: build_complete

  • ext/extmk.rb (create_makefile): make gem.build_complete file under TARGET_SO_DIR and install it only when the gem build succeeded. [Bug #12681]

Revision 56048
Added by nobu (Nobuyoshi Nakada) over 1 year ago

extmk.rb: build_complete

  • ext/extmk.rb (create_makefile): make gem.build_complete file under TARGET_SO_DIR and install it only when the gem build succeeded. [Bug #12681]

History

#1 [ruby-core:76934] Updated by hsbt (Hiroshi SHIBATA) over 1 year ago

Also, the "gem install tk" does not build the extension, so that is another source of possible issues.

I missed configuration of tk.gemspec. It's fixed at tk-0.1.1 probably. Can you confirm it?

#2 Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset r55950.


gem extensions

  • ext/extmk.rb: build gem extensions into separate directories
  • tool/rbinstall.rb: install pre-built gem extension files gem extension directories. [Bug #12681]

#3 [ruby-core:77056] Updated by vo.x (Vit Ondruch) over 1 year ago

Hiroshi SHIBATA wrote:

Also, the "gem install tk" does not build the extension, so that is another source of possible issues.

I missed configuration of tk.gemspec. It's fixed at tk-0.1.1 probably. Can you confirm it?

Yes, the 0.1.1 looks good. Thx.

#4 [ruby-core:77057] Updated by vo.x (Vit Ondruch) over 1 year ago

  • Status changed from Closed to Open

The r55950 does not resolve the issue completely. The make install does not work (neither the gem itself probably):

# make install DESTDIR=/builddir/build/BUILDROOT/ruby-2.4.0-0.1.r56008.fc26.x86_64

... snip ...

./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems -r./x86_64-linux-fake ./tool/rbinstall.rb --make="make" --dest-dir="/builddir/build/BUILDROOT/ruby-2.4.0-0.1.r56008.fc26.x86_64" --extout=".ext" --mflags="" --make-flags="" --data-mode=0644 --prog-mode=0755 --installed-list .installed.list --mantype="doc" --install=all --rdoc-output=".ext/rdoc"
installing binary commands:   /usr/bin
installing base libraries:    /usr/lib64
installing arch files:        /usr/lib64/ruby/2.4.0/x86_64-linux
installing pkgconfig data:    /usr/lib64/pkgconfig
installing command scripts:   /usr/bin
installing library scripts:   /usr/lib64/ruby/2.4.0
installing common headers:    /usr/include/ruby-2.4.0
installing manpages:          /usr/share/man/man1
installing extension objects: /usr/lib64/ruby/2.4.0/x86_64-linux
installing extension objects: /usr/lib64/ruby/site_ruby/2.4.0/x86_64-linux
installing extension objects: /usr/lib64/ruby/vendor_ruby/2.4.0/x86_64-linux
installing extension headers: /usr/include/ruby-2.4.0/x86_64-linux
installing extension scripts: /usr/lib64/ruby/2.4.0
installing extension scripts: /usr/lib64/ruby/site_ruby/2.4.0
installing extension scripts: /usr/lib64/ruby/vendor_ruby/2.4.0
installing extension headers: /usr/include/ruby-2.4.0/ruby
installing default gems:      /usr/lib64/ruby/gems/2.4.0 (build_info, cache, doc, extensions, gems, specifications)
                              bigdecimal 1.2.8
                              io-console 0.4.6
                              json 2.0.2
                              psych 2.1.0
                              rdoc 4.2.1
installing bundle gems:       /usr/lib64/ruby/gems/2.4.0 (build_info, cache, doc, extensions, gems, specifications)
                              did_you_mean 1.0.2
                              minitest 5.9.0
                              rake 11.2.2
                              power_assert 0.3.0
                              test-unit 3.2.1
                              tk 0.1.1
./tool/rbinstall.rb:273:in `initialize': No such file or directory @ rb_sysopen - /builddir/build/BUILDROOT/ruby-2.4.0-0.1.r56008.fc26.x86_64/usr/lib64/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/tk-0.1.1/gem.build_complete (Errno::ENOENT)
    from ./tool/rbinstall.rb:273:in `open'
    from ./tool/rbinstall.rb:273:in `open_for_install'
    from ./tool/rbinstall.rb:769:in `block (2 levels) in <main>'
    from /builddir/build/BUILD/ruby-2.4.0-r56008/lib/rubygems/specification.rb:821:in `block in each_spec'
    from /builddir/build/BUILD/ruby-2.4.0-r56008/lib/rubygems/specification.rb:743:in `block (2 levels) in each_gemspec'
    from /builddir/build/BUILD/ruby-2.4.0-r56008/lib/rubygems/specification.rb:742:in `each'
    from /builddir/build/BUILD/ruby-2.4.0-r56008/lib/rubygems/specification.rb:742:in `block in each_gemspec'
    from /builddir/build/BUILD/ruby-2.4.0-r56008/lib/rubygems/specification.rb:741:in `each'
    from /builddir/build/BUILD/ruby-2.4.0-r56008/lib/rubygems/specification.rb:741:in `each_gemspec'
    from /builddir/build/BUILD/ruby-2.4.0-r56008/lib/rubygems/specification.rb:819:in `each_spec'
    from ./tool/rbinstall.rb:758:in `block in <main>'
    from ./tool/rbinstall.rb:823:in `block in <main>'
    from ./tool/rbinstall.rb:820:in `each'
    from ./tool/rbinstall.rb:820:in `<main>'
uncommon.mk:277: recipe for target 'do-install-all' failed
make: *** [do-install-all] Error 1

#5 [ruby-core:77058] Updated by vo.x (Vit Ondruch) over 1 year ago

Moreover, I still see the tcltklib.so and tkutil.so installed into /usr/lib64/ruby/2.4.0/x86_64-linux/ but they should not be there at all.

#6 [ruby-core:77059] Updated by vo.x (Vit Ondruch) over 1 year ago

Actually this line is suspicious:

https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L568

It expands to $(topdir)/.ext/gems and creates the $(topdir) directory indeed. But that doesn't look to be the original intention here. Tried to revert to .ext/gems but it doesn't really make a difference ...

#7 Updated by vo.x (Vit Ondruch) over 1 year ago

#8 [ruby-core:77100] Updated by vo.x (Vit Ondruch) over 1 year ago

  • Assignee changed from naruse (Yui NARUSE) to nobu (Nobuyoshi Nakada)

It seems that r55966 is part of the problem. The place 1 where the block could be executed was removed in favor of 2. Unfortunately, that path is never reached, since the tk gem contains extconf.rb and hence the condition 3 is true.

Reverting r55966 helped me to place the compiled extension into proper places.

Also, I think that the removal of FileUtils::makedirs("#$extout/gems") 4 should be enough to avoid the creation of the $(topdir) directory. The appropriate directories are created later by extmake anyway

#9 [ruby-core:77101] Updated by nobu (Nobuyoshi Nakada) over 1 year ago

Do you install after make extract-gems or without it?

#10 Updated by nobu (Nobuyoshi Nakada) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset r56047.


mkmf.rb: TARGET_SO_DIR

  • ext/extmk.rb: move TARGET_SO_DIR stuffs to mkmf.rb.
  • lib/mkmf.rb (create_makefile): create target shared object files under $(TARGET_SO_DIR) which is $sodir if it is defined with $extout. [Bug #12681]

#11 Updated by vo.x (Vit Ondruch) over 1 year ago

  • Related to Bug #12714: make で $(topdir)/.ext/gems が作成される added

#12 [ruby-core:77111] Updated by vo.x (Vit Ondruch) over 1 year ago

  • Status changed from Closed to Assigned

Vit Ondruch wrote:

Also, I think that the removal of FileUtils::makedirs("#$extout/gems") [4] should be enough to avoid the creation of the $(topdir) directory. The appropriate directories are created later by extmake anyway

This was reported separately as #12714 and fixed by r56042

Nobuyoshi Nakada wrote:

Do you install after make extract-gems or without it?

Never heard about "extract-gems" nor I understand why I should use it, when I build from the snapshot tarball. So far make & make install was always enough.

Anyway, your recent changes probably fix the issue but broke some RubyGems tests:

http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/log/20160831T110500Z.fail.html.gz

#13 [ruby-core:77113] Updated by vo.x (Vit Ondruch) over 1 year ago

  • Status changed from Assigned to Closed

It seems that r56049 and r56050 fixes the remaining issues for me. Thx.

Also available in: Atom PDF