[Citadel Development] (null)

2023-08-11 Thread UFarx


here's the configure patch:

--- configure_O 2023-08-01 04:34:30.0 +0200 +++ configure 2023-08-11 23:58:52.0 +0200 @@ -7,7 +7,7 @@ # This program is open source software. Use, duplication, and/or # disclosure are subject to the GNU General Purpose License version 3.  -echo  +echo echo Running the configure script to create config.mk echo  @@ -39,7 +39,6 @@ shift done  -  # Set any missing values  @@ -50,10 +49,9 @@ # Configure the directory into which Citadel Server will be installed. [ "$CTDLDIR" = "" ] && CTDLDIR=/usr/local/citadel  -# Permit override of CFLAGS and LDFLAGS using environment variables -[ "$CFLAGS" = "" ] && CFLAGS='-ggdb' -[ "$LDFLAGS" = "" ] && LDFLAGS='' - +# Permit override of CPPLAGS and LDFLAGS using environment variables +[ "$CPPFLAGS" = "" ] && CPPFLAGS='' +[ "$LDFLAGS" = "" ] && LDFLAGS=''   # Test for OpenSSL @@ -68,7 +66,7 @@ exit(0); } ! -cc $tempcc -lssl -lcrypto -o $tempfile && $tempfile && { +$CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile $LDFLAGS -lssl -lcrypto && $tempfile && { CFLAGS=${CFLAGS}' -DHAVE_OPENSSL' LDFLAGS=${LDFLAGS}' -lssl -lcrypto -lz' } || { @@ -76,7 +74,6 @@ exit 2 }  -  # Test for iconv  @@ -93,13 +90,12 @@ return(0); } ! - -cc $tempcc -o $tempfile && { +$CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile && { ICONV='yes' echo iconv.h is present and requires no additional libraries } || { echo Trying again with -liconv... - cc $tempcc -liconv -o $tempfile && { + $CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile $LDFLAGS -liconv && { ICONV='yes' LDFLAGS=${LDFLAGS}' -liconv' } || { @@ -108,21 +104,20 @@ } }  -  # The build ID can be generated from git or from the date  + CFLAGS=${CFLAGS}' -DBUILD_ID=\"'$(git describe 2>/dev/null || date +%y%03j)'\"' CFLAGS=${CFLAGS}' -DCTDLDIR=\"'${CTDLDIR}'\"'  -  # Output the config.mk  ( echo '# config.mk is generated by configure' echo "CTDLDIR := ${CTDLDIR}" - echo "CFLAGS := ${CFLAGS}" + echo "CFLAGS := ${CFLAGS} ${CPPFLAGS}" echo "LDFLAGS := ${LDFLAGS}" ) >config.mk   

i removed the hardcoded ggdb on purpose. people who want or need that can add it on their own.




[Citadel Development] (null)

2023-08-11 Thread UFarx



Fri Aug 11 2023 13:41:20 EDT from IGnatius T Foobar 
I'd be pleased to see that. Maybe just do one component first so we can see what it will look like.

sure, one at a time.

Fri Aug 11 2023 13:41:20 EDT from IGnatius T Foobar 
We try to make the build work cleanly on FreeBSD and Linux. There is no interest in testing on obsolete variants

sorted, no problem with cmake then.

Fri Aug 11 2023 14:36:40 EDT from LadySerenaKitty 
I also limit myself to only using CMake 3.3, which is the last version made for IRIX.

oh nice, irix was my main platform for many years :-)




[Citadel Development] More renaming of symbols that are local to the berkeley_db module.

2023-08-11 Thread rss
dbp[] is now bdb_table[]
dbenv is now bdb_env





[Citadel Development] (null)

2023-08-11 Thread LadySerenaKitty


The email verification thingy doesn't seem to be workering.

Fri Aug 11 2023 08:26:21 EDT from IGnatius T Foobar 


I already did the account creation thingy. 
Ok, I approved the account. I guess I need to set up more alerts on that sort of thing. 


 




[Citadel Development] (null)

2023-08-11 Thread LadySerenaKitty


CMake does do a bit of automagic resolution of certain resources.  It's a common tie-in with many ports/pkg systems, so in 3 ways CMake makes building official packages on OS project build servers much easier.
I also limit myself to only using CMake 3.3, which is the last version made for IRIX.  Unless you're using a pretty extensive build system, building for IRIX is non-trivial.  CMake makes it trivial by automagically bringing in all the various library and include locations.




[Citadel Development] (null)

2023-08-11 Thread IGnatius T Foobar
 >if that's welcome, i'm happy to beef things up a little without  
 >sacrificing any compatibility.  
  
 I'd be pleased to see that.  Maybe just do one component first so we can
see what it will look like. 
  
 We try to make the build work cleanly on FreeBSD and Linux.  There is no
interest in testing on obsolete variants such as Solaris, AIX, HPUX, etc.

  
 In other news, y'all may have noticed that we're scraping the Citadel commit
log into this room now. 
 


[Citadel Development] (null)

2023-08-11 Thread UFarx


 

Thu Aug 10 2023 22:04:00 EDT from LadySerenaKitty 
I've never seen CMake be an issue for compatibility across multiple systems, and since it's a ready-made package for basically every OS

both is only true if you're dealing with:

rather recent os versions
mainstream systems

pure c programs like citadel are especially attractive for older and/or more exotic systems. making cmake mandatory would kill that advantage. looking at the citadel package itself, for which i proposed the changes, cmake would be overkill. with a little tuning like the things i suggested, it would be fine and remain highly compatible.
if that's welcome, i'm happy to beef things up a little without sacrificing any compatibility.




[Citadel Development] Moved cdb_chmod_data() out of the backend API

2023-08-11 Thread rss
This function only does file and directory level operations on
the data/ directory and files in it.  These operations will be
common across all backends.





[Citadel Development] Renamed some more functions and variables that are specific to the bdb_ module.

2023-08-11 Thread rss





[Citadel Development] ctdldump/ctdlload: more testing

2023-08-11 Thread rss





[Citadel Development] Release version 987 generated by do-release.sh

2023-08-11 Thread rss





[Citadel Development] More reliable search for guesstimezone.sh

2023-08-11 Thread rss





[Citadel Development] ctdldump/ctdlload: -h now specifies the top-level Citadel directory, just lik...

2023-08-11 Thread rss
ctdldump/ctdlload: -h now specifies the top-level Citadel directory, just like all the other programs, and defaults to the compiled-in Citadel directory, just like all the other programs





[Citadel Development] Release version 988 generated by do-release.sh

2023-08-11 Thread rss





[Citadel Development] Merge branch 'ConstStr_Access_Checks' into 'master'

2023-08-11 Thread rss
IMAP memory issues with use of ConstStr

See merge request !5





[Citadel Development] Enumerate attachments in JSON message output

2023-08-11 Thread rss





[Citadel Development] verify that 'begin' and 'end' lines were found

2023-08-11 Thread rss





[Citadel Development] point out sessions that are timed out but non-idle

2023-08-11 Thread rss





[Citadel Development] serv_nntp.c: change everything to C99 comment style

2023-08-11 Thread rss





[Citadel Development] Renamed database.c to database_bdb.c

2023-08-11 Thread rss





[Citadel Development] database.h: assert that it is an internal API that should remain consistent...

2023-08-11 Thread rss
database.h: assert that it is an internal API that should remain consistent across multiple back ends.





[Citadel Development] Removed checkpoint_thread() prototype from database.h , this is not a real fu...

2023-08-11 Thread rss





[Citadel Development] Also remove cdb_allocate_tsd(), cdb_free_tsd(), cdb_cull_logs()

2023-08-11 Thread rss
It is important to get this right because it's going to become a driver interface for databases





[Citadel Development] usetable.c: moved CheckIfAlreadySeen() out of database.c

2023-08-11 Thread rss





[Citadel Development] open_databases() and close_databases() are now cdb_open_databases() and cdb_c...

2023-08-11 Thread rss





[Citadel Development] made the prototypes prettier

2023-08-11 Thread rss





[Citadel Development] Begin turning cdb_ functions into pointers assigned to bdb_ functions

2023-08-11 Thread rss





[Citadel Development] Tried it with a function that requires a parameter

2023-08-11 Thread rss





[Citadel Development] saving my work before I do the rest of the functions en masse

2023-08-11 Thread rss





[Citadel Development] Mostly finished the abstractions, now just need to silence some compiler warn...

2023-08-11 Thread rss





[Citadel Development] Silenced a compiler warning by bringing in the correct include files.

2023-08-11 Thread rss





[Citadel Development] cdb_init_backends() just calls bdb_init_backend() for now

2023-08-11 Thread rss





[Citadel Development] server/database_bdb.c is now server/backends/berkeley_db/berkeley_db.c

2023-08-11 Thread rss





[Citadel Development] Building better abstractions for the backend interface

2023-08-11 Thread rss





[Citadel Development] Moved cdb_ prototypes from berkeley_db.c to database.c where they belong

2023-08-11 Thread rss





[Citadel Development] document private/public functions in berkeley_db.c

2023-08-11 Thread rss





[Citadel Development] berkeley_db.c: remove includes that are no longer needed

2023-08-11 Thread rss





[Citadel Development] imap_acl.c: update to C99 style comments

2023-08-11 Thread rss





[Citadel Development] Prepared for upcoming change to cdb_next_item() API.

2023-08-11 Thread rss
cdb_next_item() is always preceded by a call to cdb_rewind() before the
iteration loop.  We're going to remove the cursor from thread-specific
data, and replace it with a void pointer that the caller is responsible
for passing back.  This will make the backend drivers easier to build.





[Citadel Development] Changed the API for cdb_rewind() / cdb_next_item() to make the caller hold th...

2023-08-11 Thread rss





[Citadel Development] Revert "Changed the API for cdb_rewind() / cdb_next_item() to make the caller...

2023-08-11 Thread rss
This reverts commit 733c6e8f.





[Citadel Development] Revert "Prepared for upcoming change to cdb_next_item() API."

2023-08-11 Thread rss
This reverts commit d805c820.





[Citadel Development] This works much better. TSD maintained in-module instead of globally.

2023-08-11 Thread rss





[Citadel Development] ctdlload: finished remaining record types; need to test

2023-08-11 Thread rss





[Citadel Development] began work on enumerating attachments in the mail view

2023-08-11 Thread rss





[Citadel Development] Marked code that will require some rework for LMDB.

2023-08-11 Thread rss
When BDB returns data, the caller owns the memory and is required to
free it, which we usually do.  I marked the places where we take ownership
of memory pointers and then set the BDB ptr to NULL.  If we switch to
LMDB, those pointers remain valid forever, so we cannot simply free them
later.





[Citadel Development] ctdl_module_init_database() is now ctdl_module_init_database_bdb()

2023-08-11 Thread rss





[Citadel Development] berkeley_db.c: prefixed all module-local functions with bdb_ to avoid namespa...

2023-08-11 Thread rss





[Citadel Development] comments cleanup

2023-08-11 Thread rss





[Citadel Development] (null)

2023-08-11 Thread IGnatius T Foobar
All right, that worked much better.  The database backend interface has been
reverted to what it was before.  The backend for Berkeley DB still needs 
thread-specific
data, but now it maintains that data locally to the module instead of tainting
the server with its own needs. 
  
 Sensibly, when something in the backend needs to store or retrieve something
specific to the thread (a cursor, a lock, or a transaction) it calls a function
that says "please give me a pointer to the thread-specific data region for
this thread; if none exists, create one". 
  
 I'm guessing that when we built the previous arrangement 25 years ago we
were expecting we'd need to store more than just database stuff in that region,
but it turned out not to be the case.  Also we were foolishly envisioning
a Windows port at the time so who knows what was going through our heads.

 


[Citadel Development] (null)

2023-08-11 Thread IGnatius T Foobar
 > Therefore I am changing the API so that cdb_rewind() returns a cursor,
 
 >and cdb_next_item() must be passed that cursor with every call.  As   
  
 Well that was a disaster, and with more people involved now I ought to test
this stuff before announcing an API change. 
  
 I think I'm going to try simply moving the thread-specific stuff into 
berkeley_db.c
and letting it handle that stuff internally instead of trying to do surgery
on the module and change its inner workings. 
 


[Citadel Development] Re: Build System

2023-08-11 Thread IGnatius T Foobar
 >as for creating a patch, i would but if you wanna switch to cmake  
 >anyway it might not be necessary anymore. a word of caution though  
 >regarding cmake:   
  
 CMake is interesting and I'm happy to learn about it, but we've got too much
going on right now to think about switching to a new build system. 
 


[Citadel Development] (null)

2023-08-11 Thread IGnatius T Foobar
 >I already did the account creation thingy.   
  
 Ok, I approved the account.  I guess I need to set up more alerts on that
sort of thing.