Discussion:
[referencer] ./data directory needed during startup
Dominik Kriegner
2011-08-15 09:27:49 UTC
Permalink
Hello all,

I tried to build the latest commit from launchpad in Ant?nio Lima's
development branch. However I have problems executing the resulting
referencer binary.

So what I did is

fetch the sources from launchpad
bzr branch lp:~referencer-devs/referencer/amrlima_gio_port

configure, build and install them
cd amrlima_gio_port/
./devconfigure
make
make install

the build works fine. when I try to run referencer this only works when
in the working directory a folder "data" exists. Otherwise I get

$ bin/referencer
int main(int, char**):
setting pythonPath
to :/home/dominik/apps/lib/python:./plugins:/home/dominik/.referencer/plugins:/home/dominik/devel/referencer/amrlima_gio_port/dist/lib/referencer:
terminate called after throwing an instance of 'Gio::Error'
Aborted

if I do
mkdir data
bin/referencer

then referencer starts up fine and creates 4 empty files in the data
directory:

crossref.ui documentproperties.ui preferences.ui referencer.svg

A subsequent start of referencer fails because of those 4 emtpy files.
Did I do something wrong or should I file a bug report on launchpad?

kind regards,

Dominik
Mads Chr. Olesen
2011-08-15 09:38:39 UTC
Permalink
Post by Dominik Kriegner
$ bin/referencer
setting pythonPath
terminate called after throwing an instance of 'Gio::Error'
Aborted
I see the same behaviour, however if you use ./src/referencer it works
for me
Post by Dominik Kriegner
A subsequent start of referencer fails because of those 4 emtpy files.
Did I do something wrong or should I file a bug report on launchpad?
Does installing as non-devconfigure work?
./configure
make
make install
--
Mads Chr. Olesen <mads at mchro.dk>
Dominik Kriegner
2011-08-15 10:44:32 UTC
Permalink
hi
Post by Mads Chr. Olesen
Post by Dominik Kriegner
$ bin/referencer
setting pythonPath
terminate called after throwing an instance of 'Gio::Error'
Aborted
I see the same behaviour, however if you use ./src/referencer it works
for me
You are right it works with ./src/referencer but only When I execute it
from the root directory of the branch! If I do

cd src
./referencer

it fails with the same error again. I guess your case works only since
a data directory and the needed files exist in the root directory.
Since the files already exist there also subsequent startups work as
expected.
Post by Mads Chr. Olesen
Post by Dominik Kriegner
A subsequent start of referencer fails because of those 4 emtpy files.
Did I do something wrong or should I file a bug report on launchpad?
Does installing as non-devconfigure work?
./configure
make
make install
fails for me too if executed outside the build directory where the data folder is located!
somehow the current directory is important when referencer is started!

kind regards

dominik
Dominik Kriegner
2011-08-15 16:14:02 UTC
Permalink
I think the main problem is in the Utility::findDataFile function. I
could fix the problem with

=== modified file 'src/Utility.C'
--- old/src/Utility.C 2011-03-24 16:55:22 +0000
+++ new/src/Utility.C 2011-08-15 15:39:32 +0000
@@ -213,9 +213,7 @@
localfile = filename;
} else {
localfile = Glib::build_filename (
- Glib::get_current_dir (), "data");
- localfile = Glib::build_filename (
- localfile, filename);
+ DATADIR, filename);
}

Glib::RefPtr<Gio::File> uri =

I am however not sure if this is what the findDataFile function is
intended for. I also attached the patch file. Please have a look!

kind regards

Dominik
Post by Dominik Kriegner
hi
Post by Mads Chr. Olesen
Post by Dominik Kriegner
$ bin/referencer
setting pythonPath
terminate called after throwing an instance of 'Gio::Error'
Aborted
I see the same behaviour, however if you use ./src/referencer it works
for me
You are right it works with ./src/referencer but only When I execute it
from the root directory of the branch! If I do
cd src
./referencer
it fails with the same error again. I guess your case works only since
a data directory and the needed files exist in the root directory.
Since the files already exist there also subsequent startups work as
expected.
Post by Mads Chr. Olesen
Post by Dominik Kriegner
A subsequent start of referencer fails because of those 4 emtpy files.
Did I do something wrong or should I file a bug report on launchpad?
Does installing as non-devconfigure work?
./configure
make
make install
fails for me too if executed outside the build directory where the data folder is located!
somehow the current directory is important when referencer is started!
kind regards
dominik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: referencer-datadir.patch
Type: text/x-patch
Size: 393 bytes
Desc: not available
URL: <http://icculus.org/pipermail/referencer/attachments/20110815/61535c87/attachment.bin>
António Lima
2011-08-15 23:02:28 UTC
Permalink
Dominik Kriegner
Hi Dominik,

I'll look at you patch in the next days and commit to my gio_port
branch. I hope I'll be able to work on referencer in the next month.
Been really busy :( .


Thank you for reporting and fixing this!

Ant?nio Lima
António Lima
2011-08-27 00:14:02 UTC
Permalink
Post by Dominik Kriegner
I think the main problem is in the Utility::findDataFile function. I
could fix the problem with
=== modified file 'src/Utility.C'
--- old/src/Utility.C 2011-03-24 16:55:22 +0000
+++ new/src/Utility.C 2011-08-15 15:39:32 +0000
@@ -213,9 +213,7 @@
localfile = filename;
} else {
localfile = Glib::build_filename (
- Glib::get_current_dir (), "data");
- localfile = Glib::build_filename (
- localfile, filename);
+ DATADIR, filename);
}
Glib::RefPtr<Gio::File> uri =
I am however not sure if this is what the findDataFile function is
intended for. I also attached the patch file. Please have a look!
Hi,

This is fixed in my branch
http://bazaar.launchpad.net/~referencer-devs/referencer/amrlima_gio_port/revision/876

The problem was introduced by a change due to the gio port. Thanks
Dominik for reporting!

Regards,
Ant?nio Lima
Post by Dominik Kriegner
kind regards
Dominik
Post by Dominik Kriegner
hi
Post by Mads Chr. Olesen
Post by Dominik Kriegner
$ bin/referencer
setting pythonPath
terminate called after throwing an instance of 'Gio::Error'
Aborted
I see the same behaviour, however if you use ./src/referencer it works
for me
You are right it works with ./src/referencer but only When I execute it
from the root directory of the branch! If I do
cd src
./referencer
it fails with the same error again. I guess your case works only since
a data directory and the needed files exist in the root directory.
Since the files already exist there also subsequent startups work as
expected.
Post by Mads Chr. Olesen
Post by Dominik Kriegner
A subsequent start of referencer fails because of those 4 emtpy files.
Did I do something wrong or should I file a bug report on launchpad?
Does installing as non-devconfigure work?
./configure
make
make install
fails for me too if executed outside the build directory where the data folder is located!
somehow the current directory is important when referencer is started!
kind regards
dominik
_______________________________________________
referencer mailing list
referencer at icculus.org
http://icculus.org/mailman/listinfo/referencer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/referencer/attachments/20110827/22a49bef/attachment.htm>
Loading...