tree: 215dd7850238c5189960d30bd3a519a293233379
  1. checkdeliver/
  2. checkxml/
  3. packcomponents/
  4. packconfig/
  5. packregistry/
  6. prj/
  7. rebase/
  8. signing/
  9. BUILD.bazel
  10. postprocess.bzl
  11. readme.md
main/postprocess/readme.md

postprocess — Bazel migration

What this module produces

TargetOutputNotes
//main/postprocess:services_rdbservices.rdb + services.inputMerges ~130 .component files via packcomponents.xslt
//main/postprocess:ooo_services_rdbooo_services_rdb.rdb + .inputMerges mailmerge component only
//main/postprocess:uiconfig_zipuiconfig.zipZIP of all UI config XML files from all modules
//main/postprocess:allAll of the aboveConvenience filegroup
//main/postprocess:all_xcd20 .xcd registry packagesSee XCD section below
Individual XCDsbase.xcd, calc.xcd, main.xcd, …See XCD section below

How to build

bazel build //main/postprocess:services_rdb
bazel build //main/postprocess:ooo_services_rdb
bazel build //main/postprocess:uiconfig_zip
bazel build //main/postprocess:all
bazel build //main/postprocess:all_xcd

Architecture

services.rdb

The legacy build ran:

xsltproc packcomponents.xslt services.input > services.rdb

where services.input is an XML <list> of <filename> elements pointing at each .component file.

The Bazel implementation uses a custom services_rdb Starlark rule in postprocess.bzl. At analysis time it generates a .bat script that:

  1. Writes <list>…</list> XML with file:/// URIs built from %cd% (exec root) using delayed expansion (!F:\=/!) so backslashes become forward slashes.
  2. Calls xsltproc to merge them into the output .rdb.

file:/// URIs are required because xsltproc‘s document() resolves relative paths against the input XML’s base URI (the bazel-out path), not the working directory.

Each registered DLL must also be staged. The _SERVICES_COMPONENTS map associates every .component with a loader URL via basis_native("X.dll")vnd.sun.star.expand:$OOO_BASE_DIR/program/X.dll. Registration here does not stage the DLL — X.dll must independently be a dep of //main/staging so it lands in program/. If it is missing, the first service instantiated from that component throws com.sun.star.loader.CannotActivateFactoryException("loading component library failed: …/X.dll") at runtime. (Example: fileacc.dll was registered here but unstaged, causing a startup FatalError via the deployment help backend on 2026-05-30 — see main/staging/readme.md.)

uiconfig.zip

A uiconfig_zip Starlark rule generates a PowerShell script at analysis time. The script uses System.IO.Compression.ZipFile to create the archive, stripping the path up to and including \uiconfig\ so ZIP entries start at the module/menu level (e.g. calc/menubar/menubar.xml).

Each module with uiconfig files exposes a filegroup(name="uiconfig_files", ...).

XCD files (packregistry)

Each .xcd file is a compiled registry package produced by packregistry.xslt from a list of .xcs (schema) and .xcu (data) files. XCS files must precede XCU files in the list (configmgr requirement).

The pack_registry Starlark rule in postprocess.bzl:

  1. Calls make_services_input.pl to write an XML <list> with file:/// absolute URIs
  2. Calls xsltproc packregistry.xslt to produce the .xcd

The 20 XCD packages and their contents:

XCDXCS schema filesXCU data sources
base_xcdfcfg_database + officecfg module extractions
calc_xcdCalcCommands, CalcWindowStatefcfg_calc + connectivity calc.xcu + module extractions
cjk_xcdOffice/Common + Office/Writer cjk modules
ctl_xcdOffice/Common ctl module
draw_xcdDrawWindowStatefcfg_draw + module extractions
forcedefault_xcdOffice/Linguistic ForceDefaultLanguage module
graphicfilter_xcdfcfg_drawgraphics + fcfg_impressgraphics
impress_xcdEffects, ImpressWindowState, PresenterScreenfcfg_impress + sdext presenter XCU
korea_xcdOffice/Common korea module
lingucomponent_xcdhyphenator/spellchecker/thesaurus XCU
main_xcd84 XCS files86 XCU files (raw + FCFGMerge + module extractions + DataAccess)
math_xcdMathCommands, MathWindowStatefcfg_math + module extractions
oooimprovement_xcdextensions/oooimprovement Jobs.xcu + Logging.xcu
palm_xcdfcfg_palm
pocketexcel_xcdfcfg_pocketexcel
pocketword_xcdfcfg_pocketword
pyuno_xcdOffice/Scripting python module
w4w_xcdfcfg_w4w (109 Word-for-Windows filter fragments)
writer_xcd7 WriterWindowState XCS filesfcfg_global + fcfg_web + fcfg_writer + module extractions
xsltfilter_xcdfcfg_xslt

FCFGMerge pipeline (fcfg_merge rule + fcfg_merge.pl):

The old Java/Python FCFGMerge tool is replaced by fcfg_merge.pl. Each target in main/filter/source/config/fragments/BUILD.bazel merges raw .xcu fragments from types/, filters/, frameloaders/, contenthandlers/, and internalgraphicfilters/ subdirectories into a single combined XCU with the proper <oor:component-data> wrapper.

Module extraction pipeline (alllang_module_* genrules in main/officecfg/BUILD.bazel):

The old alllang.xsl --stringparam module <suffix> pass extracts nodes with install:module=<suffix> attributes into per-module XCU spool files. Outputs go to spool_module/<module>/org/openoffice/<xcu> to avoid collision with per-locale spool files.

Files changed

  • main/postprocess/postprocess.bzlservices_rdb, uiconfig_zip, fcfg_merge, pack_registry rules
  • main/postprocess/BUILD.bazel — all targets including 20 XCD pack_registry calls
  • main/solenv/bin/BUILD.bazelexports_files for packcomponents.xslt + packregistry.xslt
  • main/extensions/BUILD.bazelexports_files for .component files + uiconfig_files filegroup
  • main/xmlhelp/BUILD.bazelexports_files for .component files
  • main/basctl/BUILD.bazel etc. (11 modules) — uiconfig_files filegroup appended
  • main/filter/source/config/fragments/BUILD.bazel — new; all fcfg_merge targets
  • main/officecfg/BUILD.bazelexports_files for individual XCS/XCU + alllang_module_* genrules
  • main/connectivity/BUILD.bazelexports_files for DataAccess XCU files
  • main/extensions/source/oooimprovement/BUILD.bazel — new; exports_files for Jobs/Logging XCU
  • main/sdext/BUILD.bazelexports_files for presenter Jobs/ProtocolHandler XCU
  • main/lingucomponent/BUILD.bazelexports_files for hyphenator/spell/thesaurus XCU
  • build/tools/fcfg_merge.pl — new; Perl FCFGMerge replacement
  • build/tools/BUILD.bazel — added fcfg_merge.pl to exports_files