[Debian-med-packaging] Bug#775302: [fis-gtm] UTF-8 libgtmutils.so in fis-gtm-6.2-000 is missing routines

Amul Shah amul.shah at fisglobal.com
Wed Apr 22 18:57:52 UTC 2015


Hi Andreas,
Good news, I have a fix! But I think there may be a more appropriate fix. Please read below.

On 01/27/15 09:35, Shah, Amul wrote:
> On Tue, Jan 13, 2015 at 04:05:45PM -0500, Amul Shah wrote:
>> Package: fis-gtm
>> Version: 6.2-000-1
>> Severity: important
>>
>> A user reported the following on comp.lang.mumps:
>>> When starting gtm with gtm_chset=UTF-8 i get the following error:
>>> (the error does not occur in m-mode)
>>>
>>> %GTM-E-ZLINKFILE, Error while zlinking "%XCMD"
>>> %GTM-E-FILENOTFND, File %XCMD not found
>>>
>>> Any hints? I found an old discussion linking this to a missing/incomplete
>>> gtmroutines environment variable, but that one seems to be correct
>> As an upstream fis-gtm developer, I was confused since this bug is
>> not present in the package that I built on my Debian 7 stable
>> workstation. However, when I picked up the package from
>> packages.debian.org/sid/fis-gtm-6.2-000 , I was able to
>> recreate the error.
>>
>> There seems to be a problem with the creation of the UTF-8 mode libgtmutil.so. Upstream is tracking the issue as GTM-8041.
>>
>> This is the M mode test case which works:
>> $ . /usr/lib/x86_64-linux-gnu/fis-gtm/V6.2-000_x86_64/gtmprofile
>> $ ls $gtm_dist/[_A-Z][A-Z]*.m | sed -e
>> 's;/usr/lib/x86_64-linux-gnu/fis-gtm/V6.2-000_x86_64/;set ln="^;' -e
>> 's;\.m.*$;" write ln," was ",$select($length($text(@ln)):"",1:"not
>> "),"found";' -e 's;_;%;' | $gtm_dist/mumps -direct ; echo
>> $gtmroutines
>> ... prints mostly "^XYZ was found" except for GDE routines which is normal ...
>>
>> This is the UTF-8 mode test case which does not work
>> $ . /usr/lib/x86_64-linux-gnu/fis-gtm/V6.2-000_x86_64/utf8/gtmprofile
>> $ ls $gtm_dist/[_A-Z][A-Z]*.m | sed -e
>> 's;/usr/lib/x86_64-linux-gnu/fis-gtm/V6.2-000_x86_64/utf8/;set
>> ln="^;' -e 's;\.m.*$;" write ln," was
>> ",$select($length($text(@ln)):"",1:"not "),"found";' -e 's;_;%;' |
>> $gtm_dist/mumps -direct ; echo $gtmroutines
>> ... prints only "^XYZ was not found" ...
>>
>> Amul

I finally got around to using cowbuilder to setup a clean build environment for myself. I'm not sure what the hold-up was 
earlier, it's not hard.

Let me first describe the source of the bug. The script sr_unix/configure.gtc is responsible for doing the final installation of 
GT.M. Among other things, it compiles M routines into object code for both M mode and UTF-8 mode. The section that built the 
UTF-8 mode object files did the following to extract a UTF-8 locale for the GT.M compiler to use.
     697 # Now work on UTF-8 mode
     698 if [ "$doutf8" -ne 0 ]; then
     699         # Enclose UTF-8 operations inside a subshell. This avoids changing the current M mode execution
     700         (
     701                 # Ensure we ARE in UTF-8 mode
     702                 utflocale=`locale -a | grep -i en_us | grep -i utf | grep '8$' | head -n 1`
     ...
     712                         LC_CTYPE=$utflocale
     713                         export LC_CTYPE
     ...
     730                 (gtm_dist=$gtmdist/utf8; export gtm_dist; cd $gtm_dist; ./mumps -noignore *.m; $echo 
$?>>$gtmdist/compstat; \
     731                 if [ $is64bit_gtm -eq 1 -o "linux" != $arch ] ; then $ldcmd $ldflags -o libgtmutil$ext *.o ; fi )

Line 702 doesn't work correctly because 'locale -a' lists the following locales:
     C
     C.UTF-8
     POSIX

Removing the 'grep -i en_us' from line 702 above allows the script to match the locale 'C.UTF-8' and generate the UTF-8 mode 
object files on line 730.


While this fix works, it strikes me as not completely correct because debian/rules sets up a locale for the pbuilder environment 
(lines 21-27 copied in below). What do I need to do in order to use locale from override_dh_auto_build in override_dh_auto_install?
      21 # Set up locale support in the pbuilder environment
      22 override_dh_auto_build:
      23         mkdir -p debian/tmp/locale/
      24         localedef -f UTF-8 -i en_US ./debian/tmp/locale/en_US.UTF-8/
      25         export LOCPATH=$(CURDIR)/debian/tmp/locale/ && \
      26         export LC_ALL=en_US.UTF-8 && \
      27         dh_auto_build

thanks,
Amul

_____________
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.



More information about the Debian-med-packaging mailing list