[ruby-core:55121] [ruby-trunk - Bug #8435][Open] Can't build tcl/tk extensions after updating Debian/Ubuntu package

41 views
Skip to first unread message

romuloceccon (Romulo Ceccon)

unread,
May 22, 2013, 9:28:14 AM5/22/13
to ruby...@ruby-lang.org

Issue #8435 has been reported by romuloceccon (Romulo Ceccon).

----------------------------------------
Bug #8435: Can't build tcl/tk extensions after updating Debian/Ubuntu package
https://bugs.ruby-lang.org/issues/8435

Author: romuloceccon (Romulo Ceccon)
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.1.0dev (2013-05-21 trunk 40883) [x86_64-linux]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


I've recently upgraded my Ubuntu system to 13.04 and tcl8.5-dev and tk8.5-dev were updated as well (to versions 8.5.13-1ubuntu and 8.5.11-2ubuntu4 respectively).

Now I can't build Tcl/Tk Ruby extensions anymore. I was able to reproduce the problem with
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux] and
ruby 2.1.0dev (2013-05-21 trunk 40883) [x86_64-linux].

Looking at source:/ext/tk/extconf.rb@39974#L376 I see that extconf tries to parse tclConfig.sh and tkConfig.sh, which worked nice previously when those files were ln'ed to the actual configuration files. However, after the update they look like this on my platform:

$ cat /usr/lib/tclConfig.sh
#!/bin/sh
. /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/tclConfig.sh
$ cat /usr/lib/tkConfig.sh
#!/bin/sh
. /usr/lib/`dpkg-architecture -qDEB_HOST_MULTIARCH`/tkConfig.sh

So the setup fails:

...
Search tclConfig.sh and tkConfig.sh.....................
WARNING: found "/usr/lib/tclConfig.sh", but cannot find valid Tcl library for the tclConfig.sh. So, ignore it.

WARNING: found "/usr/lib/tkConfig.sh", but cannot find valid Tk library for the tkConfig.sh. So, ignore it.
..........
Fail to find [tclConfig.sh, tkConfig.sh]
...

Full 'ruby extconf.rb' output and mkmf.log are attached.


--
http://bugs.ruby-lang.org/

romuloceccon (Romulo Ceccon)

unread,
May 22, 2013, 10:03:19 AM5/22/13
to ruby...@ruby-lang.org

Issue #8435 has been updated by romuloceccon (Romulo Ceccon).


Workaround is to specify actual location of tcl/tk files:

./configure --with-tclConfig-file=/usr/lib/x86_64-linux-gnu/tclConfig.sh --with-tkConfig-file=/usr/lib/x86_64-linux-gnu/tkConfig.sh

It looks like the change in the *.sh scripts intend to improve support for DEB_HOST_MULTIARCH. I don't know how prevalent the problem will be for other platforms, or what the policy is for Ruby regarding that kind of workaround.
----------------------------------------
Bug #8435: Can't build tcl/tk extensions after updating Debian/Ubuntu package
https://bugs.ruby-lang.org/issues/8435#change-39488

zzak (Zachary Scott)

unread,
May 22, 2013, 10:42:59 PM5/22/13
to ruby...@ruby-lang.org

Issue #8435 has been updated by zzak (Zachary Scott).


Seems like third party issue
----------------------------------------
Bug #8435: Can't build tcl/tk extensions after updating Debian/Ubuntu package
https://bugs.ruby-lang.org/issues/8435#change-39502

hsbt (Hiroshi SHIBATA)

unread,
May 23, 2013, 9:10:34 PM5/23/13
to ruby...@ruby-lang.org

Issue #8435 has been updated by hsbt (Hiroshi SHIBATA).

Category set to ext
Assignee set to nagai (Hidetoshi Nagai)
Target version set to current: 2.1.0


----------------------------------------
Bug #8435: Can't build tcl/tk extensions after updating Debian/Ubuntu package
https://bugs.ruby-lang.org/issues/8435#change-39510

Author: romuloceccon (Romulo Ceccon)
Status: Open
Priority: Normal
Assignee: nagai (Hidetoshi Nagai)
Category: ext
Target version: current: 2.1.0

romuloceccon (Romulo Ceccon)

unread,
May 25, 2013, 8:44:12 PM5/25/13
to ruby...@ruby-lang.org

Issue #8435 has been updated by romuloceccon (Romulo Ceccon).


A possible fix:

--- a/ext/tk/extconf.rb 2013-01-10 05:47:20.000000000 -0200
+++ b/ext/tk/extconf.rb 2013-05-25 21:32:54.230020034 -0300
@@ -117,6 +117,11 @@
/64|universal/ =~ RUBY_PLATFORM
end

+def multiarch_supported?
+ dpkg_arch = `which dpkg-architecture`.strip
+ `#{dpkg_arch} -qDEB_HOST_MULTIARCH`.strip unless dpkg_arch.empty?
+end
+
def check_tcltk_version(version)
return [nil, nil] unless version.kind_of? String

@@ -466,7 +471,14 @@

config_dir << RbConfig::CONFIG['libdir']

- ((maybe_64bit?)? ['lib64', 'lib']: ['lib']).each{|dir|
+ if arch = multiarch_supported?
+ lib_dirs = ["lib/#{arch}", 'lib']
+ elsif maybe_64bit?
+ lib_dirs = ['lib64', 'lib']
+ else
+ lib_dirs = ['lib']
+ end
+ lib_dirs.each{|dir|
config_dir.concat [
File.join(RbConfig::CONFIG['exec_prefix'], dir),
File.join(RbConfig::CONFIG['prefix'], dir),

----------------------------------------
Bug #8435: Can't build tcl/tk extensions after updating Debian/Ubuntu package
https://bugs.ruby-lang.org/issues/8435#change-39531

Author: romuloceccon (Romulo Ceccon)
Status: Open
Priority: Normal
Assignee: nagai (Hidetoshi Nagai)
Category: ext
Target version: current: 2.1.0

nobu (Nobuyoshi Nakada)

unread,
May 27, 2013, 11:08:11 AM5/27/13
to ruby...@ruby-lang.org

Issue #8435 has been updated by nobu (Nobuyoshi Nakada).


romuloceccon (Romulo Ceccon) wrote:
> +def multiarch_supported?
> + dpkg_arch = `which dpkg-architecture`.strip
> + `#{dpkg_arch} -qDEB_HOST_MULTIARCH`.strip unless dpkg_arch.empty?
> +end

`` returns a string, that is true value.

Possibly,
/\S/ =~ `dpkg-architecture -qDEB_HOST_MULTIARCH` rescue false
?

----------------------------------------
Bug #8435: Can't build tcl/tk extensions after updating Debian/Ubuntu package
https://bugs.ruby-lang.org/issues/8435#change-39544

Author: romuloceccon (Romulo Ceccon)
Status: Open
Priority: Normal
Assignee: nagai (Hidetoshi Nagai)
Category: ext
Target version: current: 2.1.0

romuloceccon (Romulo Ceccon)

unread,
May 27, 2013, 1:27:16 PM5/27/13
to ruby...@ruby-lang.org

Issue #8435 has been updated by romuloceccon (Romulo Ceccon).


The idea is that the method would also return the architecture as a string, but return false if dpkg-architecture is not available or is of an older version (DEB_HOST_MULTIARCH unsupported). So a more comprehensive approach could be:

def multiarch_supported?
cmd = `which dpkg-architecture 2>/dev/null`
return unless $?.success?
arch = `#{cmd.strip} -qDEB_HOST_MULTIARCH`
arch.strip if $?.success?
end

----------------------------------------
Bug #8435: Can't build tcl/tk extensions after updating Debian/Ubuntu package
https://bugs.ruby-lang.org/issues/8435#change-39545

Author: romuloceccon (Romulo Ceccon)
Status: Open
Priority: Normal
Assignee: nagai (Hidetoshi Nagai)
Category: ext
Target version: current: 2.1.0

nagai (Hidetoshi Nagai)

unread,
Jun 17, 2013, 1:20:14 AM6/17/13
to ruby...@ruby-lang.org

Issue #8435 has been updated by nagai (Hidetoshi Nagai).

Status changed from Open to Third Party's Issue

It depends on Ubuntu packages. The patch may be able to avoid the "current" problem,
but it cannot guarantee that it is available in the next version of Ubuntu.
If the policy of Ubuntu is changed, extconf.rb must check the Tcl/Tk package version of Ubuntu.
I think that it is not a good choice.
Although it may be troble, please use configure options.

----------------------------------------
Bug #8435: Can't build tcl/tk extensions after updating Debian/Ubuntu package
https://bugs.ruby-lang.org/issues/8435#change-39989

Author: romuloceccon (Romulo Ceccon)
Status: Third Party's Issue
Priority: Normal
Assignee: nagai (Hidetoshi Nagai)
Category: ext
Target version: current: 2.1.0
Reply all
Reply to author
Forward
0 new messages