Re: [GNC-dev] XCode build not building gnc-vcs-info

2020-05-05 Thread Mike Alexander
Thanks, but the dependencies were already installed, and worked fine 
when I hand-built gnc-vcs-info.h so that's not the problem.  I'm not 
using, and have never used jhbuild so it's not involved.  I'm building 
using cmake and ninja.  The result isn't packaged into an application 
bundle, but it is a perfectly good Quartz application that runs fine.  
I'm not asking for help since I got GnuCash built and debugged it using 
XCode.  I was just reporting the problem.  I probably should have used 
BugZilla, but I didn't think that was necessary since this has no effect 
on anything users see.  It's just a problem for developers.


  Mike
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] [GNC] Gnucash logs

2020-05-05 Thread Chris Good
From: Geert Janssens  
Sent: Thursday, 30 April 2020 7:24 PM
To: gnucash-u...@gnucash.org
Cc: Chris Good ; 'David T.' ; 
'David H' 
Subject: Re: [GNC] Gnucash logs

 

Op donderdag 30 april 2020 06:04:10 CEST schreef Chris Good:

> Hi Geert,

> 

> 

> 

> I think options 2-5 are too disruptive and more work than the benefits

> deserve.

> 

> 

> 

> Re option 1,

> 

> I’d prefer to put logs and backups in separate folders. Maybe (going with

> your name) book.dir/backup and book.dir/log. Many people seem to be

> confused about what all these long filenames are when mixed together.

> 

I see I didn't mention this, but that making separate subdirectories for those 
was also intended in my suggestion.

> 

> 

> Also putting the metadata (book.gcm) in book.dir would make if hard to

> notice, so I think it should be in the folder holding book.gnucash (or

> maybe a separate ‘metadata’ subfolder as some people think the metadata

> file is their book).

 

I'm not decided on whether this is a good idea yet. I was throwing it in for 
further consideration. Note that if we do switch to a model with a data file 
and associated directory for other stuff, the metadata file could just be 
called that - metadata.gcm. It's already in the directory with the same name as 
the book. No need to keep that file itself named as the book is.

 

For that matter even the log and backups files could be reduced in file name 
length to only the timestamp. The same applies, the base directory (book.dir) 
uniquely identifies which book they belong to.

 

> 

> Not having all the metadata files for multiple books in the same folder

> means it is more fiddly to share metadata between multiple books by giving

> the books the same name (books in different directories) but there is

> probably nobody doing that anyway (as it is easy to get confused about

> which book is open).

> 

Well, actually you can't. GnuCash has guards in place that make each file name 
in the current metadata directory unique. The filename is just a first 
indication. The actual match between your book and the metadata file is done by 
comparing the root account's GUID in your book with the GUID stored in the 
metadata file.

So if you would have two books named "book.gnucash", you will end up with a 
"books.gcm" and a "books-1.gcm" metadata file. As they are created for diferent 
books, they will both store a unique GUID. When opening either book, gnucash 
will check both metadata files for the one that has your book's GUID stored in 
it.

 

And yes, you could thus circumvent that safety measure by manipulating your 
books to have the same root account GUID. But that's not what the system was 
designed for so we can ignore that hack in this discussion :)

 

Regards,

 

Geert

> 

> 

> Regards,

> 

> Chris Good

> 

> From: Geert Janssens   >

> Sent: Wednesday, 29 April 2020 7:57 PM

> To: gnucash-u...@gnucash.org  

> Cc: Chris Good mailto:goodchri...@gmail.com> >; 
> 'David T.' mailto:sunfis...@yahoo.com> >;

> 'David H' mailto:hell...@gmail.com> > Subject: Re: [GNC] 
> Gnucash logs

> 

> Hi,

> 

> For the file based books (xml and sqlite) there are several approaches:

> 

> 1. Have a book.gnucash and a book.dir side by side, per book you create.

> 

> book.gnucash is your actual data file.

> 

> book.dir is a directory containing extra files related to this data file.

> These include log files, backup files and can potentially be extended to

> hold attachments and possibly book metadata

> 

> Advantages:

> 

> - all data related to one book is stored together in one place. No

> intermingling of (meta)data with other books. Makes it easy to move a book

> to somewhere else

> 

> - as the main book is outside of the the directory it's easy to spot your

> book to open it.

> 

> Disadvantage: per book you will have two items: a file and a directory. At

> the file management level you always have to treat them as one (move them

> together, back them up together,...)

> 

> 2. Have a directory book.gnucash and store all data in there in a structured

> form (logs in their own subdirectory,...). To save a book, you enter the

> book's name and gnucash will create that directory for you. Inside the

> directory your book will now have a generic name (as the directory already

> indicates the unique name) as would log files and backup files. To open a

> book, you select the directory in gnucash and it will open the actual book

> inside of it for you. Backup management could be integrated in gnucash.

> 

> Advantages:

> 

> - like option 1, all data related to a single book is encapsulated closely

> together.

> 

> - only one single element on the file system level to remember: the book.dir

> is your book. Makes it slightly easier to move things around, make backups

> and so on.

> 

> Disadvantage: double-clicking a file to open it in gnucash will no longer

> 

Re: [GNC-dev] Master: Cannot open or save to SQLite3 database

2020-05-05 Thread Chris Good
-Original Message-
From: John Ralls  
Sent: Wednesday, 6 May 2020 1:30 PM
To: Chris Good 
Cc: gnucash-devel 
Subject: Re: [GNC-dev] Master: Cannot open or save to SQLite3 database



> On May 5, 2020, at 7:10 PM, Chris Good  wrote:
> 
> -Original Message-
> From: John Ralls 
> Sent: Wednesday, 6 May 2020 1:59 AM
> To: Chris Good 
> Cc: gnucash-devel 
> Subject: Re: [GNC-dev] Master: Cannot open or save to SQLite3 database
> 
> 
> 
>> On May 4, 2020, at 7:53 PM, Chris Good  wrote:
>> 
>> -Original Message-
>> From: John Ralls 
>> Sent: Tuesday, 5 May 2020 4:28 AM
>> To: Chris Good 
>> Cc: gnucash-devel 
>> Subject: Re: [GNC-dev] Master: Cannot open or save to SQLite3 
>> database
>> 
>> 
>> 
>>> On May 3, 2020, at 10:40 PM, Chris Good  wrote:
>>> 
>>> Hi,
>>> 
>>> 
>>> 
>>> GnuCash master (as at 29 Apr 2020 fbf7171ab Fix 
>>> libgnc-app-utils.dylib
>>> install_name_dir.) on Ubuntu 18.04
>>> 
>>> 
>>> 
>>> I'm trying to open SQLite3 file
>>> del-account-cross-currencies-issue.gnucash
>>> attached to bug 797220.
>>> 
>>> 
>>> 
>>> But when I try to open SQLite3 file. It says "no suitable backend 
>>> was
>> found"
>>> and if I try to save an xml file, only xml format is available.
>>> 
>>> 
>>> 
>>> I have built with no options for turning off SQL ie
>>> 
>>> 
>>> 
>>> Src/CMakeLists.txt: WITH_SQL=ON
>>> 
>>> 
>>> 
>>> I have the following installed
>>> 
>>> libdbi-dev   0.9.0-5
>>> 
>>> libdbi1 0.9.0-5
>>> 
>>> libdbi1-dbg 0.9.0-5
>>> 
>>> libdbd-sqlite3 0.9.0-5ubuntu2
>>> 
>>> 
>>> 
>>> When I try to debug, it seems to me:
>>> 
>>> 
>>> 
>>> In gnucash/libgnucash/backend/dbi/gnc-backend-dbi.cpp
>>> gnc_module_init_backend_dbi()
>>> 
>>> I can see HAVE_LIBDBI_R is set
>>> 
>>> 
>>> 
>>> num_drivers = dbi_initialize_r (driver_dir, _instance);
>>> 
>>> 
>>> 
>>> returns num_drivers=0 but dbi_instance is no longer null 
>>> so the code exits before any drivers are registered.
>>> 
>>> 
>>> 
>>> Any suggestions please?
>>> 
>> 
>> I just built from current master on my Ubuntu-18.04 VM and SQLite3 is 
>> an option in Save As...
>> 
>> If dpi_initialize_r returns 0 then that function (a libdbi one) 
>> didn't find any drivers to initialize. Make sure that GNC_DBD_DIR 
>> isn't set and in gdb at that dpi_initialize_r call check that driver_dir
is 0.
>> 
>> Check that /usr/lib/x86_64-linux-gnu/dbd/lidbdsqlite3.so and
>> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 is present.
>> 
>> Regards,
>> John Ralls
>> 
>> Hi John,
>> 
>> GNC_DBD_DIR=/ is set in build/etc/gnucash/environment
>> Commenting that out enables SQLite to work.
>> 
>> Here are the libraries:
>> 
>> /usr/lib/x86_64-linux-gnu/dbd/libdbdpgsql.la
>> /usr/lib/x86_64-linux-gnu/dbd/libdbdsqlite3.so
>> /usr/lib/x86_64-linux-gnu/dbd/libdbdmysql.la
>> /usr/lib/x86_64-linux-gnu/dbd/libdbdpgsql.so
>> /usr/lib/x86_64-linux-gnu/dbd/libdbdsqlite3.la
>> /usr/lib/x86_64-linux-gnu/dbd/libdbdmysql.so
>> 
>> /usr/lib/x86_64-linux-gnu/libdbi.so.1.1.0
>> /usr/lib/x86_64-linux-gnu/libdbi.a
>> /usr/lib/x86_64-linux-gnu/libdbi.so.1
>> /usr/lib/x86_64-linux-gnu/libdbi.so
>> 
>> cmake 3.10.2-1ubuntu2.18.04.1
>> 
>> I think the " GNC_DBD_DIR=/" line is added to environment file in 
>> src/gnucash/CMakeLists.txt :
>> 
>>if (LIBDBI_LIBRARY AND LIBDBI_DRIVERS_DIR)
>>  get_filename_component(libdir ${LIBDBI_LIBRARY}
>> DIRECTORY)
>>  string(FIND ${LIBDBI_DRIVERS_DIR} ${libdir} is_subdir)
>>  if (NOT is_subdir EQUAL 0)
>>file(APPEND ${BUILD_ENV_FILE_OUT}
>> "GNC_DBD_DIR=${LIBDBI_DRIVERS_DIR}")
>>  endif()
>>endif()
>> 
>> Before I spend too much time trying to fix this, I am running the 
>> build environment from within eclipse. Is SQLite supported while 
>> running from the build or should I "ninja install" and run from there?
> 
> Chris,
> 
> It should run from the build directory. Misconfiguring GNC_DBD_DIR is 
> the obvious problem and would break libdbi regardless of whether 
> GnuCash is installed.
> 
> You found half of the LIBDBI_DRIVERS_DIR code; the other half is in 
> the top-level CMakeLists.txt beginning at line 436 (in master):
> find_library (LIBDBI_DRIVERS_DIR
>  NAMES dbdmysql dbdpgsql dbdsqlite3 NAMES_PER_DIR  PATH_SUFFIXES dbd 
> libdbi-drivers/dbd  HINTS LIBDBI_LIBRARY  PATHS GNC_DBD_DIR  DOC 
> "Libdbi Drivers Directory") If (WITH_SQL)  if (NOT 
> LIBDBI_INCLUDE_PATH)
>message (SEND_ERROR "Include file  was not found - did 
> you install libdbi0-dev or libdbi-dev?")
>  endif()
>  if (NOT LIBDBI_LIBRARY)
>message (SEND_ERROR "Library libdbi was not found")
>  endif()
>  set(HAVE_DBI_DBI_H 1)
>  if (NOT LIBDBI_DRIVERS_DIR)
>message (SEND_ERROR "No libdbi drivers found, SQL tests will 
> fail.")
>  else()
>get_filename_component(drivers_dir ${LIBDBI_DRIVERS_DIR} DIRECTORY)

Re: [GNC-dev] Master: Cannot open or save to SQLite3 database

2020-05-05 Thread John Ralls



> On May 5, 2020, at 7:10 PM, Chris Good  wrote:
> 
> -Original Message-
> From: John Ralls  
> Sent: Wednesday, 6 May 2020 1:59 AM
> To: Chris Good 
> Cc: gnucash-devel 
> Subject: Re: [GNC-dev] Master: Cannot open or save to SQLite3 database
> 
> 
> 
>> On May 4, 2020, at 7:53 PM, Chris Good  wrote:
>> 
>> -Original Message-
>> From: John Ralls 
>> Sent: Tuesday, 5 May 2020 4:28 AM
>> To: Chris Good 
>> Cc: gnucash-devel 
>> Subject: Re: [GNC-dev] Master: Cannot open or save to SQLite3 database
>> 
>> 
>> 
>>> On May 3, 2020, at 10:40 PM, Chris Good  wrote:
>>> 
>>> Hi,
>>> 
>>> 
>>> 
>>> GnuCash master (as at 29 Apr 2020 fbf7171ab Fix 
>>> libgnc-app-utils.dylib
>>> install_name_dir.) on Ubuntu 18.04
>>> 
>>> 
>>> 
>>> I'm trying to open SQLite3 file
>>> del-account-cross-currencies-issue.gnucash
>>> attached to bug 797220.
>>> 
>>> 
>>> 
>>> But when I try to open SQLite3 file. It says "no suitable backend was
>> found"
>>> and if I try to save an xml file, only xml format is available.
>>> 
>>> 
>>> 
>>> I have built with no options for turning off SQL ie
>>> 
>>> 
>>> 
>>> Src/CMakeLists.txt: WITH_SQL=ON
>>> 
>>> 
>>> 
>>> I have the following installed
>>> 
>>> libdbi-dev   0.9.0-5
>>> 
>>> libdbi1 0.9.0-5
>>> 
>>> libdbi1-dbg 0.9.0-5
>>> 
>>> libdbd-sqlite3 0.9.0-5ubuntu2
>>> 
>>> 
>>> 
>>> When I try to debug, it seems to me:
>>> 
>>> 
>>> 
>>> In gnucash/libgnucash/backend/dbi/gnc-backend-dbi.cpp
>>> gnc_module_init_backend_dbi()
>>> 
>>> I can see HAVE_LIBDBI_R is set
>>> 
>>> 
>>> 
>>> num_drivers = dbi_initialize_r (driver_dir, _instance);
>>> 
>>> 
>>> 
>>> returns num_drivers=0 but dbi_instance is no longer null 
>>> so the code exits before any drivers are registered.
>>> 
>>> 
>>> 
>>> Any suggestions please?
>>> 
>> 
>> I just built from current master on my Ubuntu-18.04 VM and SQLite3 is 
>> an option in Save As...
>> 
>> If dpi_initialize_r returns 0 then that function (a libdbi one) didn't 
>> find any drivers to initialize. Make sure that GNC_DBD_DIR isn't set 
>> and in gdb at that dpi_initialize_r call check that driver_dir is 0.
>> 
>> Check that /usr/lib/x86_64-linux-gnu/dbd/lidbdsqlite3.so and
>> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 is present.
>> 
>> Regards,
>> John Ralls
>> 
>> Hi John,
>> 
>> GNC_DBD_DIR=/ is set in build/etc/gnucash/environment
>> Commenting that out enables SQLite to work.
>> 
>> Here are the libraries:
>> 
>> /usr/lib/x86_64-linux-gnu/dbd/libdbdpgsql.la
>> /usr/lib/x86_64-linux-gnu/dbd/libdbdsqlite3.so
>> /usr/lib/x86_64-linux-gnu/dbd/libdbdmysql.la
>> /usr/lib/x86_64-linux-gnu/dbd/libdbdpgsql.so
>> /usr/lib/x86_64-linux-gnu/dbd/libdbdsqlite3.la
>> /usr/lib/x86_64-linux-gnu/dbd/libdbdmysql.so
>> 
>> /usr/lib/x86_64-linux-gnu/libdbi.so.1.1.0
>> /usr/lib/x86_64-linux-gnu/libdbi.a
>> /usr/lib/x86_64-linux-gnu/libdbi.so.1
>> /usr/lib/x86_64-linux-gnu/libdbi.so
>> 
>> cmake 3.10.2-1ubuntu2.18.04.1
>> 
>> I think the " GNC_DBD_DIR=/" line is added to environment file in 
>> src/gnucash/CMakeLists.txt :
>> 
>>if (LIBDBI_LIBRARY AND LIBDBI_DRIVERS_DIR)
>>  get_filename_component(libdir ${LIBDBI_LIBRARY}
>> DIRECTORY)
>>  string(FIND ${LIBDBI_DRIVERS_DIR} ${libdir} is_subdir)
>>  if (NOT is_subdir EQUAL 0)
>>file(APPEND ${BUILD_ENV_FILE_OUT}
>> "GNC_DBD_DIR=${LIBDBI_DRIVERS_DIR}")
>>  endif()
>>endif()
>> 
>> Before I spend too much time trying to fix this, I am running the 
>> build environment from within eclipse. Is SQLite supported while 
>> running from the build or should I "ninja install" and run from there?
> 
> Chris,
> 
> It should run from the build directory. Misconfiguring GNC_DBD_DIR is the
> obvious problem and would break libdbi regardless of whether GnuCash is
> installed.
> 
> You found half of the LIBDBI_DRIVERS_DIR code; the other half is in the
> top-level CMakeLists.txt beginning at line 436 (in master):
> find_library (LIBDBI_DRIVERS_DIR
>  NAMES dbdmysql dbdpgsql dbdsqlite3 NAMES_PER_DIR
>  PATH_SUFFIXES dbd libdbi-drivers/dbd
>  HINTS LIBDBI_LIBRARY
>  PATHS GNC_DBD_DIR
>  DOC "Libdbi Drivers Directory")
> If (WITH_SQL)
>  if (NOT LIBDBI_INCLUDE_PATH)
>message (SEND_ERROR "Include file  was not found - did you
> install libdbi0-dev or libdbi-dev?")
>  endif()
>  if (NOT LIBDBI_LIBRARY)
>message (SEND_ERROR "Library libdbi was not found")
>  endif()
>  set(HAVE_DBI_DBI_H 1)
>  if (NOT LIBDBI_DRIVERS_DIR)
>message (SEND_ERROR "No libdbi drivers found, SQL tests will fail.")
>  else()
>get_filename_component(drivers_dir ${LIBDBI_DRIVERS_DIR} DIRECTORY)
>set(LIBDBI_DRIVERS_DIR ${drivers_dir} CACHE FILEPATH "Directory
> containing the libdbi driver modules." FORCE)
>  endif()
> endif()
> 
> Note that the "found" value of LIBDBI_DRIVERS_DIR gets 

Re: [GNC-dev] Master: Cannot open or save to SQLite3 database

2020-05-05 Thread Chris Good
-Original Message-
From: John Ralls  
Sent: Wednesday, 6 May 2020 1:59 AM
To: Chris Good 
Cc: gnucash-devel 
Subject: Re: [GNC-dev] Master: Cannot open or save to SQLite3 database



> On May 4, 2020, at 7:53 PM, Chris Good  wrote:
> 
> -Original Message-
> From: John Ralls 
> Sent: Tuesday, 5 May 2020 4:28 AM
> To: Chris Good 
> Cc: gnucash-devel 
> Subject: Re: [GNC-dev] Master: Cannot open or save to SQLite3 database
> 
> 
> 
>> On May 3, 2020, at 10:40 PM, Chris Good  wrote:
>> 
>> Hi,
>> 
>> 
>> 
>> GnuCash master (as at 29 Apr 2020 fbf7171ab Fix 
>> libgnc-app-utils.dylib
>> install_name_dir.) on Ubuntu 18.04
>> 
>> 
>> 
>> I'm trying to open SQLite3 file
>> del-account-cross-currencies-issue.gnucash
>> attached to bug 797220.
>> 
>> 
>> 
>> But when I try to open SQLite3 file. It says "no suitable backend was
> found"
>> and if I try to save an xml file, only xml format is available.
>> 
>> 
>> 
>> I have built with no options for turning off SQL ie
>> 
>> 
>> 
>> Src/CMakeLists.txt: WITH_SQL=ON
>> 
>> 
>> 
>> I have the following installed
>> 
>> libdbi-dev   0.9.0-5
>> 
>> libdbi1 0.9.0-5
>> 
>> libdbi1-dbg 0.9.0-5
>> 
>> libdbd-sqlite3 0.9.0-5ubuntu2
>> 
>> 
>> 
>> When I try to debug, it seems to me:
>> 
>> 
>> 
>> In gnucash/libgnucash/backend/dbi/gnc-backend-dbi.cpp
>> gnc_module_init_backend_dbi()
>> 
>> I can see HAVE_LIBDBI_R is set
>> 
>> 
>> 
>> num_drivers = dbi_initialize_r (driver_dir, _instance);
>> 
>> 
>> 
>>  returns num_drivers=0 but dbi_instance is no longer null 
>> so the code exits before any drivers are registered.
>> 
>> 
>> 
>> Any suggestions please?
>> 
> 
> I just built from current master on my Ubuntu-18.04 VM and SQLite3 is 
> an option in Save As...
> 
> If dpi_initialize_r returns 0 then that function (a libdbi one) didn't 
> find any drivers to initialize. Make sure that GNC_DBD_DIR isn't set 
> and in gdb at that dpi_initialize_r call check that driver_dir is 0.
> 
> Check that /usr/lib/x86_64-linux-gnu/dbd/lidbdsqlite3.so and
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 is present.
> 
> Regards,
> John Ralls
> 
> Hi John,
> 
> GNC_DBD_DIR=/ is set in build/etc/gnucash/environment
> Commenting that out enables SQLite to work.
> 
> Here are the libraries:
> 
> /usr/lib/x86_64-linux-gnu/dbd/libdbdpgsql.la
> /usr/lib/x86_64-linux-gnu/dbd/libdbdsqlite3.so
> /usr/lib/x86_64-linux-gnu/dbd/libdbdmysql.la
> /usr/lib/x86_64-linux-gnu/dbd/libdbdpgsql.so
> /usr/lib/x86_64-linux-gnu/dbd/libdbdsqlite3.la
> /usr/lib/x86_64-linux-gnu/dbd/libdbdmysql.so
> 
> /usr/lib/x86_64-linux-gnu/libdbi.so.1.1.0
> /usr/lib/x86_64-linux-gnu/libdbi.a
> /usr/lib/x86_64-linux-gnu/libdbi.so.1
> /usr/lib/x86_64-linux-gnu/libdbi.so
> 
> cmake 3.10.2-1ubuntu2.18.04.1
> 
> I think the " GNC_DBD_DIR=/" line is added to environment file in 
> src/gnucash/CMakeLists.txt :
> 
> if (LIBDBI_LIBRARY AND LIBDBI_DRIVERS_DIR)
>   get_filename_component(libdir ${LIBDBI_LIBRARY}
> DIRECTORY)
>   string(FIND ${LIBDBI_DRIVERS_DIR} ${libdir} is_subdir)
>   if (NOT is_subdir EQUAL 0)
> file(APPEND ${BUILD_ENV_FILE_OUT}
> "GNC_DBD_DIR=${LIBDBI_DRIVERS_DIR}")
>   endif()
> endif()
> 
> Before I spend too much time trying to fix this, I am running the 
> build environment from within eclipse. Is SQLite supported while 
> running from the build or should I "ninja install" and run from there?

Chris,

It should run from the build directory. Misconfiguring GNC_DBD_DIR is the
obvious problem and would break libdbi regardless of whether GnuCash is
installed.

You found half of the LIBDBI_DRIVERS_DIR code; the other half is in the
top-level CMakeLists.txt beginning at line 436 (in master):
find_library (LIBDBI_DRIVERS_DIR
  NAMES dbdmysql dbdpgsql dbdsqlite3 NAMES_PER_DIR
  PATH_SUFFIXES dbd libdbi-drivers/dbd
  HINTS LIBDBI_LIBRARY
  PATHS GNC_DBD_DIR
  DOC "Libdbi Drivers Directory")
If (WITH_SQL)
  if (NOT LIBDBI_INCLUDE_PATH)
message (SEND_ERROR "Include file  was not found - did you
install libdbi0-dev or libdbi-dev?")
  endif()
  if (NOT LIBDBI_LIBRARY)
message (SEND_ERROR "Library libdbi was not found")
  endif()
  set(HAVE_DBI_DBI_H 1)
  if (NOT LIBDBI_DRIVERS_DIR)
message (SEND_ERROR "No libdbi drivers found, SQL tests will fail.")
  else()
get_filename_component(drivers_dir ${LIBDBI_DRIVERS_DIR} DIRECTORY)
set(LIBDBI_DRIVERS_DIR ${drivers_dir} CACHE FILEPATH "Directory
containing the libdbi driver modules." FORCE)
  endif()
endif()

Note that the "found" value of LIBDBI_DRIVERS_DIR gets overwritten in that
last phrase so it might be helpful to insert
  message(INFO "find_library found drivers at $LIBDBI_DRIVERS_DIR") just
before the get_filename_component() call.

Regards,
John Ralls

Hi John,

The problem is that 

Re: [GNC-dev] XCode build not building gnc-vcs-info

2020-05-05 Thread Chris Graves
Mike,

Did you by chance build starting from scratch — i.e. the Gnucash dependencies.  
I have had miserable luck recently trying to build the dependencies and finally 
gave up on it.  If I remember correctly, when asking for help on building them 
that, jralls mentioned that recent versions of jhbuild are broken.  I tried 
some workarounds, then finally gave up.

Chris
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


[GNC-dev] XCode build not building gnc-vcs-info

2020-05-05 Thread Mike Alexander
I tried the XCode project on the master branch this afternoon and the 
build failed because there was no rule to build 
libgnucash/core-utils/gnc-vcs-info.h.  When I copied it from another 
recent build directory everything worked fine so this seems to be the 
only problem with using XCode with master.


Mike
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Significance of 18:59:00 in GnuCash 2.6.21 and altering of existing data

2020-05-05 Thread John Ralls



> On May 4, 2020, at 9:52 PM, Kevin Buckley  wrote:
> 
> On Mon, 4 May 2020 at 20:37, Geert Janssens  
> wrote:
> 
>> 
>>> Initially, given the swig in the file name, I had almost allowed for the
>>> differences as resulting from different swig versions but, on closer
>> 
>>> inspection, noted the different text, including the fixing up of the
>>> ".. add out module ..." text, to the correct "... add our module ..."
>>> 
>>> Howver, I can't find that change in the repo, as in, I did a git log
>>> against the
>>> 
>>> src/gnc-module/swig-gnc-module.c
>>> 
>>> file, having checked out the most recent commit on the maint branch,
>>> and the file alwasy has the uncorrected "out" not "our" in it.
>>> 
>>> Does that mean that the official 2.6.21 tarball wasn't built against
>>> the commit with the hash that is visible in the autogenerated file
>> 
>> 
>> No. If building from a git repo swig-gnc-module.c is a generated file. That 
>> generated
>> file will be included in the dist tarballs together with all the other swig 
>> generated files.
>> 
>> So if you generate dist tarballs with different versions of swig installed 
>> on your system,
>> they may indeed have different swig-generated files.
> 
> Yes, but no version of SWIG would alter the Text in a Comment within the file
> it was processing, or would it?
> 
> I wasn't aware of SWIG having any "automatic" spell-correction capability
> but I could imagine that it might be congigured/used to do that.
> 
> So if SWIG is not responsble for the change to the text in a comment,
> then what changed the comment in the file SWIG processed, and where
> is the commit for that ?
> 
> Apologies if I didn't make what I was asking clear,

https://github.com/swig/swig/blob/master/Lib/swiginit.swg#L82

Regards,
John Ralls

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Master: Cannot open or save to SQLite3 database

2020-05-05 Thread John Ralls



> On May 4, 2020, at 7:53 PM, Chris Good  wrote:
> 
> -Original Message-
> From: John Ralls  
> Sent: Tuesday, 5 May 2020 4:28 AM
> To: Chris Good 
> Cc: gnucash-devel 
> Subject: Re: [GNC-dev] Master: Cannot open or save to SQLite3 database
> 
> 
> 
>> On May 3, 2020, at 10:40 PM, Chris Good  wrote:
>> 
>> Hi,
>> 
>> 
>> 
>> GnuCash master (as at 29 Apr 2020 fbf7171ab Fix libgnc-app-utils.dylib
>> install_name_dir.) on Ubuntu 18.04
>> 
>> 
>> 
>> I'm trying to open SQLite3 file 
>> del-account-cross-currencies-issue.gnucash
>> attached to bug 797220.
>> 
>> 
>> 
>> But when I try to open SQLite3 file. It says "no suitable backend was
> found"
>> and if I try to save an xml file, only xml format is available.
>> 
>> 
>> 
>> I have built with no options for turning off SQL ie
>> 
>> 
>> 
>> Src/CMakeLists.txt: WITH_SQL=ON
>> 
>> 
>> 
>> I have the following installed
>> 
>> libdbi-dev   0.9.0-5
>> 
>> libdbi1 0.9.0-5
>> 
>> libdbi1-dbg 0.9.0-5
>> 
>> libdbd-sqlite3 0.9.0-5ubuntu2
>> 
>> 
>> 
>> When I try to debug, it seems to me:
>> 
>> 
>> 
>> In gnucash/libgnucash/backend/dbi/gnc-backend-dbi.cpp
>> gnc_module_init_backend_dbi()
>> 
>> I can see HAVE_LIBDBI_R is set
>> 
>> 
>> 
>> num_drivers = dbi_initialize_r (driver_dir, _instance);
>> 
>> 
>> 
>>  returns num_drivers=0 but dbi_instance is no longer null 
>> so the code exits before any drivers are registered.
>> 
>> 
>> 
>> Any suggestions please?
>> 
> 
> I just built from current master on my Ubuntu-18.04 VM and SQLite3 is an
> option in Save As...
> 
> If dpi_initialize_r returns 0 then that function (a libdbi one) didn't find
> any drivers to initialize. Make sure that GNC_DBD_DIR isn't set and in gdb
> at that dpi_initialize_r call check that driver_dir is 0.
> 
> Check that /usr/lib/x86_64-linux-gnu/dbd/lidbdsqlite3.so and
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 is present.
> 
> Regards,
> John Ralls
> 
> Hi John,
> 
> GNC_DBD_DIR=/ is set in build/etc/gnucash/environment
> Commenting that out enables SQLite to work.
> 
> Here are the libraries:
> 
> /usr/lib/x86_64-linux-gnu/dbd/libdbdpgsql.la
> /usr/lib/x86_64-linux-gnu/dbd/libdbdsqlite3.so
> /usr/lib/x86_64-linux-gnu/dbd/libdbdmysql.la
> /usr/lib/x86_64-linux-gnu/dbd/libdbdpgsql.so
> /usr/lib/x86_64-linux-gnu/dbd/libdbdsqlite3.la
> /usr/lib/x86_64-linux-gnu/dbd/libdbdmysql.so
> 
> /usr/lib/x86_64-linux-gnu/libdbi.so.1.1.0
> /usr/lib/x86_64-linux-gnu/libdbi.a
> /usr/lib/x86_64-linux-gnu/libdbi.so.1
> /usr/lib/x86_64-linux-gnu/libdbi.so
> 
> cmake 3.10.2-1ubuntu2.18.04.1
> 
> I think the " GNC_DBD_DIR=/" line is added to environment file in
> src/gnucash/CMakeLists.txt :
> 
> if (LIBDBI_LIBRARY AND LIBDBI_DRIVERS_DIR)
>   get_filename_component(libdir ${LIBDBI_LIBRARY}
> DIRECTORY)
>   string(FIND ${LIBDBI_DRIVERS_DIR} ${libdir} is_subdir)
>   if (NOT is_subdir EQUAL 0)
> file(APPEND ${BUILD_ENV_FILE_OUT}
> "GNC_DBD_DIR=${LIBDBI_DRIVERS_DIR}")
>   endif()
> endif()
> 
> Before I spend too much time trying to fix this, I am running the build
> environment from within eclipse. Is SQLite supported while running from the
> build or should I "ninja install" and run from there?

Chris,

It should run from the build directory. Misconfiguring GNC_DBD_DIR is the 
obvious problem and would break libdbi regardless of whether GnuCash is 
installed.

You found half of the LIBDBI_DRIVERS_DIR code; the other half is in the 
top-level CMakeLists.txt beginning at line 436 (in master):
find_library (LIBDBI_DRIVERS_DIR
  NAMES dbdmysql dbdpgsql dbdsqlite3 NAMES_PER_DIR
  PATH_SUFFIXES dbd libdbi-drivers/dbd
  HINTS LIBDBI_LIBRARY
  PATHS GNC_DBD_DIR
  DOC "Libdbi Drivers Directory")
If (WITH_SQL)
  if (NOT LIBDBI_INCLUDE_PATH)
message (SEND_ERROR "Include file  was not found - did you 
install libdbi0-dev or libdbi-dev?")
  endif()
  if (NOT LIBDBI_LIBRARY)
message (SEND_ERROR "Library libdbi was not found")
  endif()
  set(HAVE_DBI_DBI_H 1)
  if (NOT LIBDBI_DRIVERS_DIR)
message (SEND_ERROR "No libdbi drivers found, SQL tests will fail.")
  else()
get_filename_component(drivers_dir ${LIBDBI_DRIVERS_DIR} DIRECTORY)
set(LIBDBI_DRIVERS_DIR ${drivers_dir} CACHE FILEPATH "Directory containing 
the libdbi driver modules." FORCE)
  endif()
endif()

Note that the "found" value of LIBDBI_DRIVERS_DIR gets overwritten in that last 
phrase so it might be helpful to insert
  message(INFO "find_library found drivers at $LIBDBI_DRIVERS_DIR")
just before the get_filename_component() call.

Regards,
John Ralls
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel