This is an automated email from the ASF dual-hosted git repository. leginee pushed a commit to branch bazel-migration in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 3504aee7aabe1d9309982e31744484a4b0433bb2 Author: Peter Kovacs <[email protected]> AuthorDate: Fri Aug 14 06:36:55 2026 +0200 build(connectivity): three resource libraries, not one merged .res source/resource/makefile.mk builds THREE resource libraries and the glob here collapsed them into one: cnr shared driver strings; dbtools is compiled with CONN_SHARED_RESOURCE_FILE=cnr sdbcl the connection logger's messages. JDriver.cxx constructs comphelper::ResourceBasedEventLogger("sdbcl", "org.openoffice.sdbc.jdbcBridge") and the FIRST argument is the bundle name, so the logger resolves sdbcl<lang>.res sdberr the SQL error messages Only cnren-US.res was ever produced, so two of the three did not exist, and merging three .src files into one .res can also collide IDs across what were meant to be separate namespaces. Latent until now: nothing could reach it while no connectivity driver was built. It is also quiet by construction, which is why it survived this long -- sdbcl is only consulted when the logger's level check passes, and that check returns before any resource lookup while logging is off. sdberr is the one that matters in normal use: without it the text of a driver's SQLException is empty at exactly the moment something has gone wrong. Between them they are a good part of why failures in this module report so little. Not built, deliberately: upstream's fourth reslib, hsqldb, from source/drivers/hsqldb/hsqlui.src. Its own comment says the .res "is *not* included in the final OOo installation. Instead, it is only built to ensure that the two images below are included in the application-wide image repository (images.zip)", reached at runtime through the GraphicProvider's private:imagerepository/ protocol rather than a ResId. That is a dmake artifact -- compiling a .src was the only way to get an image into the repository there. //main/default_images:images globs database/**/*.png directly, so both images are already zip entries and a resource library built purely for its side effect would be a dead target. GENERAL RULE for rsc_res: one module's source/**/*.src is not necessarily one .res. Check the module's makefile for RESLIB<N>NAME before globbing. Also corrects the hsqldb.dll export count in three comments: 27 undecorated Java_* names, not 28 -- verified against the built DLL's export table and against the 27 native methods sdbc_hsqldb declares (NativeStorageAccess 10, StorageNativeInputStream 7, StorageNativeOutputStream 7, StorageFileAccess 3). Co-Authored-By: Claude Opus 5 <[email protected]> --- main/connectivity/BUILD.bazel | 61 ++++++++++++++++++++++++++++++++++++++----- main/staging/BUILD.bazel | 9 +++++++ 2 files changed, 63 insertions(+), 7 deletions(-) diff --git a/main/connectivity/BUILD.bazel b/main/connectivity/BUILD.bazel index b046297d87..7ff7ddeea6 100644 --- a/main/connectivity/BUILD.bazel +++ b/main/connectivity/BUILD.bazel @@ -21,6 +21,16 @@ _COPTS = [ "/Zc:wchar_t-", ] +# Shared by the four rsc_res targets below. source/resource/makefile.mk builds +# THREE separate resource libraries (cnr, sdbcl, sdberr) and the hsqldb driver +# a fourth (hsqldb) -- they are separate bundles looked up by NAME at runtime, +# so they must not be globbed into one .res. +_RES_INCLUDES = [ + "main/connectivity/source/resource", + "main/connectivity/source/drivers/hsqldb", + "main/connectivity/source/inc", +] + # ── public headers ───────────────────────────────────────────────── cc_library( name = "connectivity_headers", @@ -456,7 +466,7 @@ cc_binary( # lives inside the .odb zip storage rather than as loose files on disk. # # DUAL-ROLE DLL: a UNO component AND a JNI library, hence a DEF that carries -# both component_* entries and 28 undecorated Java_* names (JNICALL is +# both component_* entries and 27 undecorated Java_* names (JNICALL is # __stdcall on Win32, so without the DEF they would be exported as _Java_..@N # and the JVM could not find them) -- same trick as //main/jurt jpipe.def. # @@ -550,18 +560,55 @@ uno_jar( rsc_res( name = "connectivity_res", - srcs = glob(["source/**/*.src"]), + srcs = ["source/resource/conn_shared_res.src"], hdrs = glob(["source/**/*.hrc"]), - includes = [ - "main/connectivity/source/resource", - "main/connectivity/source/drivers/hsqldb", - "main/connectivity/source/inc", - ], + includes = _RES_INCLUDES, images = ["//main/default_images:database_images"], images_root = "main/default_images", visibility = ["//visibility:public"], ) +# ── sdbcl — the connection LOGGER's messages ─────────────────────── +# java_sql_DatabaseMetaData::impl_callBooleanMethod() and friends log every +# call and its result through comphelper::ResourceBasedEventLogger, which +# JDriver.cxx constructs as ("sdbcl", "org.openoffice.sdbc.jdbcBridge") -- +# the first argument is this bundle's name, so the logger resolves +# sdbcl<lang>.res, not cnr<lang>.res. Inert while the logger is off (its +# level check returns before any resource lookup), which is why nothing has +# ever failed on its absence; it becomes load-bearing the moment JDBC +# logging is switched on to diagnose a driver. +rsc_res( + name = "connectivity_log_res", + srcs = ["source/resource/conn_log_res.src"], + hdrs = glob(["source/**/*.hrc"]), + includes = _RES_INCLUDES, + visibility = ["//visibility:public"], +) + +# ── sdberr — SQL ERROR messages ──────────────────────────────────── +# The strings behind the SQLExceptions the drivers throw. Missing bundle = +# hollowed-out error text at exactly the moment something goes wrong, which +# is the worst possible time to lose a message. +rsc_res( + name = "connectivity_err_res", + srcs = ["source/resource/conn_error_message.src"], + hdrs = glob(["source/**/*.hrc"]), + includes = _RES_INCLUDES, + visibility = ["//visibility:public"], +) + +# NO target for source/drivers/hsqldb/hsqlui.src, deliberately. Upstream +# builds it as a fourth reslib, but hsqlui.src says why itself: "The resource +# file built here (hsqldb.res, finally) is *not* included in the final OOo +# installation. Instead, it is only built to ensure that the two images below +# are included in the application-wide image repository (images.zip)" -- they +# are reached at runtime via the GraphicProvider's private:imagerepository/ +# protocol, not through a ResId. That is a dmake artifact: there, compiling a +# .src was the only way to pull an image into the repository. Here +# //main/default_images:images globs database/**/*.png directly, so +# linked_text_table{,_hc}.png are already zip entries and a resource library +# built for its side effect would be a dead target. + exports_files(glob(["**/*.component"])) # DataAccess XCU files consumed by //main/postprocess pack_registry targets. diff --git a/main/staging/BUILD.bazel b/main/staging/BUILD.bazel index f09736a6b3..9efe1e71fe 100644 --- a/main/staging/BUILD.bazel +++ b/main/staging/BUILD.bazel @@ -478,7 +478,16 @@ res_stage( "//main/basctl:basctl_res": "basctlen-US", "//main/basic:basic_res": "sben-US", "//main/chart2:chart2_res": "chartcontrolleren-US", + # Three SEPARATE bundles, looked up by name at runtime, not one merged + # .res: cnr is the shared driver strings (dbtools is compiled with + # CONN_SHARED_RESOURCE_FILE=cnr), sdbcl is what JDriver.cxx's + # ResourceBasedEventLogger("sdbcl", "org.openoffice.sdbc.jdbcBridge") + # resolves, and sdberr holds the SQL error messages. connectivity's + # fourth reslib, hsqldb, is deliberately absent — it exists only to pull + # its two images into images.zip and upstream never installs it. "//main/connectivity:connectivity_res": "cnren-US", + "//main/connectivity:connectivity_log_res": "sdbclen-US", + "//main/connectivity:connectivity_err_res": "sdberren-US", "//main/cui:cui_res": "cuien-US", "//main/scaddins:date_res": "dateen-US", "//main/dbaccess:dba_res": "dbaen-US",
