YottaDB / YDB

Mirrored from https://gitlab.com/YottaDB/DB/YDB
Other
76 stars 37 forks source link

`ydb_dist` seems to overriden based on location of mumps executable #198

Closed ztmr closed 6 years ago

ztmr commented 6 years ago

When you set ydb_dist or gtm_dist to it's utf8 subdirectory and have a standard install (most of the utf8 files are symlinked to the main non-utf8 directory), these variables are forcibly changed to the directory where the binary is physically located (where the symlink is pointing to).

An example tells you everything:

$ docker run -ti --rm -e gtm_dist=/opt/yottadb/r1.20-x86_64/utf8 -e ydb_dist=/opt/yottadb/r1.20-x86_64/utf8 --entrypoint /bin/bash yottadb/yottadb:r1.20
root@060795d9bf65:/data# 
root@060795d9bf65:/data# 
root@060795d9bf65:/data# echo $ydb_dist
/opt/yottadb/r1.20-x86_64/utf8
root@060795d9bf65:/data# 
root@060795d9bf65:/data# 
root@060795d9bf65:/data# $ydb_dist/mumps -di

YDB>w $ztrnlnm("ydb_dist")
/opt/yottadb/r1.20-x86_64
YDB>h
root@060795d9bf65:/data# 
root@060795d9bf65:/data# 
root@060795d9bf65:/data# cd $ydb_dist/

root@060795d9bf65:/opt/yottadb/r1.20-x86_64/utf8# unlink mumps 
root@060795d9bf65:/opt/yottadb/r1.20-x86_64/utf8# cp ../mumps .
root@060795d9bf65:/opt/yottadb/r1.20-x86_64/utf8# cd
root@060795d9bf65:~# $ydb_dist/mumps -di

YDB>w $ztrnlnm("gtm_dist")
/opt/yottadb/r1.20-x86_64/utf8
YDB>w $ztrnlnm("ydb_dist")
/opt/yottadb/r1.20-x86_64/utf8
YDB>

YDB>h
root@060795d9bf65:~# 
root@060795d9bf65:~# 
root@060795d9bf65:~# exit
nars1 commented 6 years ago

Tomas. Yes. That is on purpose. But I am trying to understand why that is an issue. Can you please explain. Thanks.

ztmr commented 6 years ago

May not be, just didn't expect anything to override something I have set earlier and originally suspected myself but found out it is actually happening in the binary itself.

This is all because I was seeing an error where my utf8 app (that worked well with GT.M 6.3-003A) tried to access a non-utf8 version of one of the precompiled routines distributed with ydb so I thought it may also affect $zroutines.

As I think about it, if you do it just for *_dist variables, that should be fine. Can you confirm? If yes, we can probably close this :)

ztmr commented 6 years ago

OK, so the issue is in the code that tries to simulate UCIs from other MUMPS systems. On GT.M, we had a list of UCIs registered in configuration global and when we have switched in between these, the switch UCI function would take the UCI name and derive the right global directory and routine paths from it -- using environment variables in format of <UCI>_RTNS and <UCI>_GLD. At the end of each of the routine variables, the $ZTRNLNM("gtm_dist") was appended.

So two points:

Having these workarounds applied, everything seems to work OK now.

nars1 commented 6 years ago

Yes we do it just for *_dist variables. Glad you found a workaround.