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 fc9feb68283f9413f3a0475c29e2b5e347233533 Author: Peter Kovacs <[email protected]> AuthorDate: Fri Jun 12 21:58:18 2026 +0200 added unbuilt UNO reflection/introspection layer --- bug-readme.md | 30 ++++++++++++++++++++++++ main/postprocess/BUILD.bazel | 20 ++++++++++------ main/staging/BUILD.bazel | 7 ++++++ main/stoc/BUILD.bazel | 56 ++++++++++++++++++++++++++++++++++++++++++++ main/stoc/util/component.def | 8 +++++++ 5 files changed, 114 insertions(+), 7 deletions(-) diff --git a/bug-readme.md b/bug-readme.md index c996ac0197..c06ad53ca2 100644 --- a/bug-readme.md +++ b/bug-readme.md @@ -399,6 +399,36 @@ etc., normally filled from the bootstrap/version config) isn't applied. Tracked --- +## 11. Follow-on — unbuilt UNO reflection/introspection layer (the activation crash) + +With ICU + BASIC + Standard-library all fixed, the Writer view builds fully (toolbars, layout, frame +**Show**) and then throws at the very last step — **view activation**: +``` +type: com.sun.star.loader.CannotActivateFactoryException +msg: bootstrap.uno.dll: cannot get factory of demanded implementation: + com.sun.star.comp.stoc.Introspection +sb!SbUnoObject::doIntrospection ← BasicManager::SetGlobalUNOConstant ("ThisComponent") + ← SfxObjectShell::SetCurrentComponent ← SfxViewShell::Activate ← SwView::Activate +``` +**Root cause:** the entire stoc UNO **reflection/introspection/invocation** layer was never compiled. +`stoc/BUILD.bazel` built only `bootstrap.uno` (bootstrap/registry/loader/tdmanager) and `stocservices.uno` +(typeconv/uri). Missing: `corereflection` (`CoreReflection`), `inspect` (`Introspection`), `invocation` +(`Invocation`), `invocation_adapterfactory` (`InvocationAdapterFactory`), `namingservice` (`NamingService`), +`proxy_factory` (`ProxyFactory`). The postprocess `_SERVICES_COMPONENTS` map *registered* all of them in +services.rdb pointing at `bootstrap.uno.dll` ("All bundled into bootstrap.uno.dll"), but that DLL never +contained their factories → `CannotActivateFactoryException`. They cannot be merged into `bootstrap.uno` +(each has its own `component_getFactory` → symbol collision). + +**Fix (build-only, no source change):** build each as its own component DLL and point services.rdb at it. +- [stoc/BUILD.bazel](main/stoc/BUILD.bazel): six `cc_binary` targets (`reflection.uno`, `introspection.uno`, + `invocation.uno`, `invocadapt.uno`, `namingservice.uno`, `proxyfac.uno`) over a `_REFL_COMPONENTS` map, + sharing [util/component.def](main/stoc/util/component.def) (the 3 standard component exports). +- [postprocess/BUILD.bazel](main/postprocess/BUILD.bazel): each `.component` URI now points at its own DLL + instead of `bootstrap.uno.dll` (java* stay on bootstrap — deferred, only loaded if Java is used). +- [staging/BUILD.bazel](main/staging/BUILD.bazel): stage the six new DLLs. + +--- + ## Appendix A — raw debugger output ### A.1 Sig. A — `SfxInterface::Register` AV (sidebar off), with `kp` diff --git a/main/postprocess/BUILD.bazel b/main/postprocess/BUILD.bazel index d00a874c0d..e7d63734af 100644 --- a/main/postprocess/BUILD.bazel +++ b/main/postprocess/BUILD.bazel @@ -33,25 +33,31 @@ load(":postprocess.bzl", "services_rdb", "uiconfig_zip", "uiconfig_tree", "pack_ # Python mods: pymodule("module_name") _SERVICES_COMPONENTS = { # ── stoc / cppuhelper (UNO core runtime) ───────────────────────────── - # All bundled into bootstrap.uno.dll; stocservices separately. + # bootstrap.uno.dll = bootstrap/registry/loader/tdmanager only. The + # reflection/introspection/invocation components are SEPARATE DLLs (each + # has its own component_getFactory; cannot merge into bootstrap.uno), so + # each .component must point at its own library — not bootstrap.uno.dll, + # which does not contain their factories (CannotActivateFactoryException). "//main/stoc:util/bootstrap.component": basis_native("bootstrap.uno.dll"), "//main/stoc:source/inspect/introspection.component": - basis_native("bootstrap.uno.dll"), + basis_native("introspection.uno.dll"), "//main/stoc:source/invocation_adapterfactory/invocadapt.component": - basis_native("bootstrap.uno.dll"), + basis_native("invocadapt.uno.dll"), "//main/stoc:source/invocation/invocation.component": - basis_native("bootstrap.uno.dll"), + basis_native("invocation.uno.dll"), + # javaloader/javavm: Java components (deferred) — still mapped to + # bootstrap.uno.dll (not built; only loaded if Java is used). "//main/stoc:source/javaloader/javaloader.component": basis_native("bootstrap.uno.dll"), "//main/stoc:source/javavm/javavm.component": basis_native("bootstrap.uno.dll"), "//main/stoc:source/namingservice/namingservice.component": - basis_native("bootstrap.uno.dll"), + basis_native("namingservice.uno.dll"), "//main/stoc:source/proxy_factory/proxyfac.component": - basis_native("bootstrap.uno.dll"), + basis_native("proxyfac.uno.dll"), "//main/stoc:source/corereflection/reflection.component": - basis_native("bootstrap.uno.dll"), + basis_native("reflection.uno.dll"), "//main/stoc:util/stocservices.component": basis_native("stocservices.uno.dll"), diff --git a/main/staging/BUILD.bazel b/main/staging/BUILD.bazel index bbdcb78de3..1fba4e33df 100644 --- a/main/staging/BUILD.bazel +++ b/main/staging/BUILD.bazel @@ -58,6 +58,13 @@ collect_outputs( # ── UNO runtime infrastructure ──────────────────────────────────────── "//main/stoc:bootstrap.uno", "//main/stoc:stocservices.uno", + # UNO reflection/introspection/invocation components (needed by BASIC/scripting) + "//main/stoc:reflection.uno", + "//main/stoc:introspection.uno", + "//main/stoc:invocation.uno", + "//main/stoc:invocadapt.uno", + "//main/stoc:namingservice.uno", + "//main/stoc:proxyfac.uno", "//main/binaryurp:binaryurp", "//main/bridges:msci_uno", "//main/io:streams", diff --git a/main/stoc/BUILD.bazel b/main/stoc/BUILD.bazel index 5fe7901068..4a31d3b27a 100644 --- a/main/stoc/BUILD.bazel +++ b/main/stoc/BUILD.bazel @@ -155,5 +155,61 @@ cc_binary( visibility = ["//visibility:public"], ) +# ── stoc reflection / introspection / invocation component DLLs ─── +# Each is a standalone UNO component (its own component_getFactory, so they +# cannot be merged into bootstrap.uno — symbol collision). They were +# registered in services.rdb (postprocess maps each impl here) but never +# compiled; BASIC's ThisComponent introspection at view activation is the +# first consumer (CannotActivateFactoryException: com.sun.star.comp.stoc.Introspection). +# DLL names match the upstream .component loader URIs. +_REFL_IMPLIBS = [ + "//main/sal:sal_implib", + "//main/salhelper:salhelper_implib", + "//main/cppu:cppu3_implib", + "//main/cppuhelper:cppuhelper_implib", + "//main/registry:reg_implib", +] + +_REFL_LINKOPTS = [ + "$(execpath //main/sal:sal_implib)", + "$(execpath //main/salhelper:salhelper_implib)", + "$(execpath //main/cppu:cppu3_implib)", + "$(execpath //main/cppuhelper:cppuhelper_implib)", + "$(execpath //main/registry:reg_implib)", + "/MANIFEST:NO", +] + +_REFL_COMPONENTS = { + "reflection.uno": [ + "source/corereflection/crarray.cxx", + "source/corereflection/crbase.cxx", + "source/corereflection/crcomp.cxx", + "source/corereflection/crefl.cxx", + "source/corereflection/crenum.cxx", + "source/corereflection/criface.cxx", + ], + "introspection.uno": ["source/inspect/introspection.cxx"], + "invocation.uno": ["source/invocation/invocation.cxx"], + "invocadapt.uno": ["source/invocation_adapterfactory/iafactory.cxx"], + "namingservice.uno": ["source/namingservice/namingservice.cxx"], + "proxyfac.uno": ["source/proxy_factory/proxyfac.cxx"], +} + +[ + cc_binary( + name = _name, + srcs = _srcs, + copts = _COPTS, + defines = _DEFINES, + deps = _DEPS, + additional_linker_inputs = _REFL_IMPLIBS, + linkshared = True, + win_def_file = "util/component.def", + linkopts = _REFL_LINKOPTS, + visibility = ["//visibility:public"], + ) + for _name, _srcs in _REFL_COMPONENTS.items() +] + exports_files(glob(["**/*.component"])) diff --git a/main/stoc/util/component.def b/main/stoc/util/component.def new file mode 100644 index 0000000000..3fa9764e22 --- /dev/null +++ b/main/stoc/util/component.def @@ -0,0 +1,8 @@ +; Windows export file for standalone UNO component DLLs. +; No LIBRARY line: shared by every stoc reflection/introspection component DLL. +; Only the two ALWAYS-present component exports — component_canUnload is +; optional (several stoc components, e.g. introspection, don't define it; +; exporting it then fails to link). Omitting it merely means "not unloadable". +EXPORTS + component_getImplementationEnvironment + component_getFactory
