Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Weird behaviour #52

Closed
jubalh opened this issue Jun 8, 2018 · 7 comments
Closed

Weird behaviour #52

jubalh opened this issue Jun 8, 2018 · 7 comments
Labels
bug When the issue is about a bug

Comments

@jubalh
Copy link
Contributor

jubalh commented Jun 8, 2018

I just installed opmon and get a very wird behaviour which might be a problem on my side. But I think I will need your help to track it down.

I launch opmon in a terminal and I get:

$ opmon
Error n°1 : Keys initialization error: keys/english.rkeys
Fatal error.

No window is displayed. Program exits.

Funny enough I have another terminal instance open in which case it launches opmon when I type the name.

For both I get:

which opmon
/usr/bin/opmon

So it's the same executable.
When starting over the desktop file in GNOME3 menu it also doesn't start (which is the reason I went to the terminal in the first place).

So my question: under which circumstance is this error message displayed?

@jubalh
Copy link
Contributor Author

jubalh commented Jun 8, 2018

rpm -ql opmon|grep keys                                                                                                                                              
/usr/share/OpMon/keys
/usr/share/OpMon/keys/english.rkeys
/usr/share/OpMon/keys/espanol.rkeys
/usr/share/OpMon/keys/francais.rkeys

Keys are installed in that location.

@navet56
Copy link
Member

navet56 commented Jun 8, 2018

How did you install the game? Normally this is not where the data is installed

@jubalh
Copy link
Contributor Author

jubalh commented Jun 8, 2018

I'm packaging the game right now as an rpm for openSUSE.
AFAIK this is where it should be installed.

I'm using the openSUSE Cmake macro.
Which expands to:

    find . -name CMakeLists.txt \
        -exec sed -i -re '/^[[:blank:]]*[sS][eE][tT][[:blank:]]*\([[:blank:]]*(CMAKE_BUILD_TYPE|CMAKE_COLOR_MAKEFILE|CMAKE_INSTALL_PREFIX|CMAKE_VERBOSE_MAKEFILE).*\)/{s/^/#IGNORE /}' {} + 
    mkdir -p build 
    cd build 
    /usr/bin/cmake $OLDPWD/. \
%if "/usr/bin/make" == "/usr/bin/make" 
        -G"Unix Makefiles" \
%else 
        -GNinja \
%endif 
        -DCMAKE_INSTALL_PREFIX:PATH=/usr \
        -DINCLUDE_INSTALL_DIR:PATH=/usr/include \
        -DLIB_INSTALL_DIR:PATH=/usr/lib64 \
        -DSYSCONF_INSTALL_DIR:PATH=/etc \
        -DSHARE_INSTALL_PREFIX:PATH=/usr/share \
        -DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib64 \
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
        -DCMAKE_C_FLAGS="${CFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \
        -DCMAKE_CXX_FLAGS="${CXXFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \
        -DCMAKE_Fortran_FLAGS="${FFLAGS:--O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables} -DNDEBUG" \
        -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \
        -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed" \
        -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-undefined -Wl,-z,now" \
%if "lib64" == "lib64" 
        -DLIB_SUFFIX=64 \
%endif 
        -DCMAKE_SKIP_RPATH:BOOL=ON \
        -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
        -DBUILD_SHARED_LIBS:BOOL=ON \
        -DBUILD_STATIC_LIBS:BOOL=OFF \
        -DCMAKE_COLOR_MAKEFILE:BOOL=OFF \
        -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF \
        -DCMAKE_MODULES_INSTALL_DIR=/usr/share/cmake/Modules

Thus setting the prefix to /usr

@jubalh
Copy link
Contributor Author

jubalh commented Jun 8, 2018

Ok, I understand now why it works in that one terminal.
It's the instance where I am in the checked out git repo ;)
So it just takes the resources relative to pwd.

I think opmon needs to be patched to look for the location in the official places (/usr/local/share and /usr/share). It would be best if one could use the value that was given to it via CMake. Not sure if or how that is possible.

@jubalh
Copy link
Contributor Author

jubalh commented Jun 8, 2018

Shouldnt https://github.com/OpMonTeam/OpMon/blob/master/src/utils/path.cpp#L92 do this?

BTW I'm using the 0.14 release tarball. But according to git blame it already contains this.

@jubalh
Copy link
Contributor Author

jubalh commented Jun 8, 2018

Okay give me a minute, I might be on it ;)

jubalh referenced this issue in jubalh/OpMon Jun 8, 2018
We are in a while loop and plan to go through all elements of
XDG_DATA_DIRS. So far we actually returned out of it if only the first
path is not containig the OpMon dir, not even checking the other
elements.

Only return the default /usr/local/share/OpMon path if none of the
elements in XDG_DATA_DIRS contain OpMon.

Fixes OpMonTeam/OpMon#52
@jubalh
Copy link
Contributor Author

jubalh commented Jun 8, 2018

Solved it :)

@milkyroute milkyroute added bug When the issue is about a bug read labels Jun 8, 2018
@milkyroute milkyroute removed the read label May 22, 2019
milkyroute referenced this issue in OpMonTeam/OpMon-Data May 24, 2020
We are in a while loop and plan to go through all elements of
XDG_DATA_DIRS. So far we actually returned out of it if only the first
path is not containig the OpMon dir, not even checking the other
elements.

Only return the default /usr/local/share/OpMon path if none of the
elements in XDG_DATA_DIRS contain OpMon.

Fixes OpMonTeam/OpMon#52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug When the issue is about a bug
Projects
None yet
Development

No branches or pull requests

3 participants