[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

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



[email massaged from one that I sent to debian-med-packaging@lists.alioth.debian.org]

Top posting for context. I am an upstream developer for the fis-gtm
project. fis-gtm (among other things) is a MUMPS language compiler that
generates two different types of object files, M mode for standard ASCII
(well, ISO-8859-* variants) and UTF-8 mode for Unicode. The fis-gtm
package built on the Debian build servers was missing the UTF-8 mode
object files for many MUMPS routines. Read on for more information.

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

I finally got around to using cowbuilder to setup a clean build environment for
myself and found the problem.

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 Unicode
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).
     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

I played around with attempting to use the LOCPATH and LC_ALL settings
from override_dh_auto_build in override_dh_auto_install, but
$(CURDIR)/debian/tmp/locale does not exist at override_dh_auto_install.

I can either repeat the steps from override_dh_auto_build to generate
the locale in override_dh_auto_build or I can use my fix as is because
all fis-gtm needs is a valid Unicode locale to proceed with compilation.

Thoughts? Do I need to go read the manual(s) again?

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.


Reply to: