diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 37bbd2e6..724b4620 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -191,12 +191,10 @@ jobs: FreeBSD: continue-on-error: true env: - BUILD_PARALLEL_LEVEL: 2 CFLAGS: --coverage CTEST_HOST: localhost CXXFLAGS: --coverage LIBRARY_PATH: /usr/local/lib - TEST_PARALLEL_LEVEL: 2 TMPDIR: /tmp name: >- ${{ matrix.box_generic }} @@ -224,6 +222,11 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Set `BUILD_PARALLEL_LEVEL` & `TEST_PARALLEL_LEVEL` + run: | + echo "BUILD_PARALLEL_LEVEL=$(nproc)" >> "$GITHUB_ENV" + echo "TEST_PARALLEL_LEVEL=$(nproc)" >> "$GITHUB_ENV" + - name: Provision VM uses: hummeltech/freebsd-vagrant-action@v1.4 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index fa336788..ff2bf659 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ find_package(Threads REQUIRED) find_package(APR REQUIRED) find_package(CAIRO REQUIRED) -find_package(GLIB REQUIRED) +find_package(GLIB 2.50 REQUIRED) find_package(HTTPD REQUIRED) find_package(INIPARSER REQUIRED) find_package(LIBMAPNIK 3 REQUIRED) diff --git a/includes/g_logger.h b/includes/g_logger.h index 4e062bf4..12aa7c6c 100644 --- a/includes/g_logger.h +++ b/includes/g_logger.h @@ -24,6 +24,8 @@ extern "C" { #endif +extern int foreground; + void g_logger(int log_level, const char *format, ...); const char *g_logger_level_name(int log_level); diff --git a/src/g_logger.c b/src/g_logger.c index 78cd5d86..bd882044 100644 --- a/src/g_logger.c +++ b/src/g_logger.c @@ -22,7 +22,7 @@ #include #include -extern int foreground; +int foreground = 0; const char *g_logger_level_name(int log_level) { diff --git a/src/gen_tile.cpp b/src/gen_tile.cpp index 6fee4a88..280d9223 100644 --- a/src/gen_tile.cpp +++ b/src/gen_tile.cpp @@ -78,8 +78,6 @@ using namespace mapnik; #define RENDER_SIZE (512) #endif -extern int foreground; - struct projectionconfig { double bound_x0; double bound_y0; diff --git a/src/mod_tile.c b/src/mod_tile.c index 4a8b1656..3d3a3f6a 100644 --- a/src/mod_tile.c +++ b/src/mod_tile.c @@ -99,8 +99,6 @@ char *mutexfilename; int layerCount = 0; int global_max_zoom = 0; -int foreground = 0; - struct storage_backends { struct storage_backend ** stores; int noBackends; diff --git a/src/render_expired.c b/src/render_expired.c index 15fc21e9..9cf2abea 100644 --- a/src/render_expired.c +++ b/src/render_expired.c @@ -33,6 +33,7 @@ #include +#include "g_logger.h" #include "protocol.h" #include "config.h" #include "render_config.h" @@ -74,8 +75,6 @@ static int maxZoom = 18; static int verbose = 0; static int maxLoad = MAX_LOAD_OLD; -int foreground = 1; - void display_rate(struct timeval start, struct timeval end, int num) { int d_s, d_us; @@ -122,6 +121,7 @@ int main(int argc, char **argv) mt >>= 1; } + foreground = 1; while (1) { int option_index = 0; diff --git a/src/render_list.c b/src/render_list.c index 08108f4e..228dfebe 100644 --- a/src/render_list.c +++ b/src/render_list.c @@ -34,6 +34,7 @@ #include +#include "g_logger.h" #include "gen_tile.h" #include "protocol.h" #include "config.h" @@ -58,8 +59,6 @@ static int maxZoom = MAX_ZOOM; static int verbose = 0; static int maxLoad = MAX_LOAD_OLD; -int foreground = 1; - void display_rate(struct timeval start, struct timeval end, int num) { @@ -118,6 +117,8 @@ int main(int argc, char **argv) struct storage_backend * store; struct stat_info s; + foreground = 1; + while (1) { int option_index = 0; static struct option long_options[] = { diff --git a/src/render_old.c b/src/render_old.c index 08a292d7..9ded594a 100644 --- a/src/render_old.c +++ b/src/render_old.c @@ -35,7 +35,7 @@ #include - +#include "g_logger.h" #include "gen_tile.h" #include "protocol.h" #include "config.h" @@ -64,8 +64,6 @@ static int max_load = MAX_LOAD_OLD; static time_t planetTime; static struct timeval start, end; -int foreground = 1; - void display_rate(struct timeval start, struct timeval end, int num) @@ -200,6 +198,8 @@ int main(int argc, char **argv) int dd, mm, yy; struct tm tm; + foreground = 1; + while (1) { int option_index = 0; static struct option long_options[] = { diff --git a/src/render_speedtest.cpp b/src/render_speedtest.cpp index 456e4db6..71dfb30e 100644 --- a/src/render_speedtest.cpp +++ b/src/render_speedtest.cpp @@ -31,6 +31,7 @@ #include #include +#include "g_logger.h" #include "gen_tile.h" #include "protocol.h" #include "config.h" @@ -71,8 +72,6 @@ static double boundx1 = 3.2; static double boundy1 = 58.8; #endif -int foreground = 1; - static double minmax(double a, double b, double c) { @@ -151,6 +150,8 @@ int main(int argc, char **argv) int minZoom = 0; int numThreads = 1; + foreground = 1; + while (1) { int option_index = 0; static struct option long_options[] = { diff --git a/src/renderd.c b/src/renderd.c index 13b85824..9b25d08c 100644 --- a/src/renderd.c +++ b/src/renderd.c @@ -66,8 +66,6 @@ static renderd_config config; int num_slave_threads; -int foreground = 0; - struct request_queue * render_request_queue; static const char *cmdStr(enum protoCmd c) diff --git a/src/store.c b/src/store.c index f1a7fedb..b25a09c2 100644 --- a/src/store.c +++ b/src/store.c @@ -24,8 +24,6 @@ #include "store_null.h" #include "g_logger.h" -extern int foreground; - /** * In Apache 2.2, we call the init_storage_backend once per process. For mpm_worker and mpm_event multiple threads therefore use the same * storage context, and all storage backends need to be thread-safe in order not to cause issues with these mpm's diff --git a/tests/gen_tile_test.cpp b/tests/gen_tile_test.cpp index 7a83c2b0..04a3719f 100644 --- a/tests/gen_tile_test.cpp +++ b/tests/gen_tile_test.cpp @@ -65,9 +65,6 @@ extern struct projectionconfig *get_projection(const char *srs); extern mapnik::box2d tile2prjbounds(struct projectionconfig *prj, int x, int y, int z); -extern int foreground; -extern struct request_queue *render_request_queue; - // mutex to guard access to the shared render request counter static pthread_mutex_t item_counter_lock;