[Citadel Development] (null)
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)
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.
dbp[] is now bdb_table[] dbenv is now bdb_env
[Citadel Development] (null)
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)
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)
>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)
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
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.
[Citadel Development] ctdldump/ctdlload: more testing
[Citadel Development] Release version 987 generated by do-release.sh
[Citadel Development] More reliable search for guesstimezone.sh
[Citadel Development] ctdldump/ctdlload: -h now specifies the top-level Citadel directory, just lik...
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
[Citadel Development] Merge branch 'ConstStr_Access_Checks' into 'master'
IMAP memory issues with use of ConstStr See merge request !5
[Citadel Development] Enumerate attachments in JSON message output
[Citadel Development] verify that 'begin' and 'end' lines were found
[Citadel Development] point out sessions that are timed out but non-idle
[Citadel Development] serv_nntp.c: change everything to C99 comment style
[Citadel Development] Renamed database.c to database_bdb.c
[Citadel Development] database.h: assert that it is an internal API that should remain consistent...
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...
[Citadel Development] Also remove cdb_allocate_tsd(), cdb_free_tsd(), cdb_cull_logs()
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
[Citadel Development] open_databases() and close_databases() are now cdb_open_databases() and cdb_c...
[Citadel Development] made the prototypes prettier
[Citadel Development] Begin turning cdb_ functions into pointers assigned to bdb_ functions
[Citadel Development] Tried it with a function that requires a parameter
[Citadel Development] saving my work before I do the rest of the functions en masse
[Citadel Development] Mostly finished the abstractions, now just need to silence some compiler warn...
[Citadel Development] Silenced a compiler warning by bringing in the correct include files.
[Citadel Development] cdb_init_backends() just calls bdb_init_backend() for now
[Citadel Development] server/database_bdb.c is now server/backends/berkeley_db/berkeley_db.c
[Citadel Development] Building better abstractions for the backend interface
[Citadel Development] Moved cdb_ prototypes from berkeley_db.c to database.c where they belong
[Citadel Development] document private/public functions in berkeley_db.c
[Citadel Development] berkeley_db.c: remove includes that are no longer needed
[Citadel Development] imap_acl.c: update to C99 style comments
[Citadel Development] Prepared for upcoming change to cdb_next_item() API.
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...
[Citadel Development] Revert "Changed the API for cdb_rewind() / cdb_next_item() to make the caller...
This reverts commit 733c6e8f.
[Citadel Development] Revert "Prepared for upcoming change to cdb_next_item() API."
This reverts commit d805c820.
[Citadel Development] This works much better. TSD maintained in-module instead of globally.
[Citadel Development] ctdlload: finished remaining record types; need to test
[Citadel Development] began work on enumerating attachments in the mail view
[Citadel Development] Marked code that will require some rework for LMDB.
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()
[Citadel Development] berkeley_db.c: prefixed all module-local functions with bdb_ to avoid namespa...
[Citadel Development] comments cleanup
[Citadel Development] (null)
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)
> 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
>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)
>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.