The patch queue¶
Libera Suite does not fork upstream. It pins an upstream revision and applies a series of patches to it, each one a commit with a message explaining what it is for.
build/upstream/pins.toml the upstream revisions, by hash
build/upstream/patches/core/
build/upstream/patches/web-apps/
build/upstream/patches/sdkjs/
The pins follow Euro-Office's own desktop releases: the revisions its DesktopEditors repository names for a release are the ones we build, v9.3.8 since 2026-11-15. Up to v9.3.5-2, core carried a copy of libxml2, the XML parser the converter reads every document with, about release 2.9.4, and a 6 KB document of nested entities took that copy to 3.9 GB of memory; we built core against libxml2 2.9.14 instead, from a pin of its own, with two patches. Since v9.3.8 core builds libxml2 2.15.4 itself, from its own fetch script (Common/3dParty/libxml2), and the pin, its patches and core 0172 are gone.
build/engine/build.sh fetch resets each repository to its pinned hash, cleans it, and applies the series with git am, which does not fuzz. A patch that has stopped applying is news: investigate it.
Why a queue¶
The queue answers "what did Libera Suite change?" in a form anyone can check. On a long-lived branch that question becomes a diff against a moving target; a pin bump becomes one large merge. The queue gives a series of small rebases that each say what they were for.
It also makes the AGPL obligation concrete: the corresponding source for a release is a commit hash plus a patch series that provably applies to it.
What is in it¶
core: the build, the converter, and OpenDocument. Patches keep their numbers when others leave the queue, so the numbering has gaps.
- macOS. Upstream ported the build from qmake to CMake and the port dropped the Mac branches. We put them back in a series of about twenty patches; Euro-Office has since built macOS itself, and the queue keeps only what its build still lacks:
memalign, which macOS does not have, for openjpeg (0018), and two V8 build options of our own (0009,0010). - Windows. Boost's engine built with a named toolset (
0022), an external OpenSSL from vcpkg (0024), a namespace cryptopp no longer has (0025), and one C runtime for every DLL, V8 included, because core's libraries handFILE*handles to one another (0028). - Elsewhere in the build. Third-party builders that stream their output (
0023), doctrenderer against an OpenSSL without MD2 (0026),hypotfbound to its old glibc version so the Linux core loads on RHEL 9 (0032). - The converter. A large CSV read whole (
0029), characters outside the BMP (0030), a CSV value in hexadecimal kept as text, wherewcstodread0x1234as 4660 (0199, after ElixirOffice's0014-csv-keep-hex-text), a WMF or EMF line drawn at least a pixel wide in the SVG the editor draws the picture from, where a CAD drawing's one-unit pens came out a fiftieth of a pixel wide (0200, ours), a run's border (w:bdr) kept through the editor's binary format as run property 57, where every save dropped it (0201, ElixirOffice's, withsdkjs0008), an.odspage's margins kept through a save, where each one added the header's and footer's height again (0202, ElixirOffice's), a list's picture bullets kept through the editor's binary format, where every save turned them into text bullets (0203, ElixirOffice's, withsdkjs0011), the document's font table passed to the editor as table 22, so that a missing font is drawn in the alternate name the document gives it, as Word does (0204, ElixirOffice's, withsdkjs0012), a part of a package unzipped no further than the size the package declares for it, which minizip did by itself and minizip-ng, core's unzip since v9.3.8, does not, so that the size checks before conversion bound what x2t unpacks (0205, ours), the last section of an RTF written (0033), and the code cache of the editors' scripts kept in a folder the host names, not written beside the scripts (0034). A paragraph style the HTML reader makes from CSS, named after its CSS id, stays out of the style gallery, where a document read from Markdown or HTML offered "text-5" and "text-3" beside Normal (0198, ours). - OpenDocument (
0101onwards). Fixes to reading and writing.odt,.odsand.odp, each found against LibreOffice's own test documents. - A hostile document (
0173onwards). A picture a document links to is read from a web address only: one linked to a path on the user's disk was copied into everything written from the document (0175, ours). An SVG's<image>draws only a picture the SVG carries, not a file it names (0174). An.xlsActiveX control's data is bounds-checked without a sum that can overflow (0173). The last two are from ElixirOffice's fork ofcore, and so is the refusal of an encrypted Word, Excel or PowerPoint file whose integrity check fails, which x2t noted in a comment and opened all the same (0183, their0010-office-integrity-rejection, without its WebAssembly-only condition). - Encrypted OpenDocument. A part whose compressed data fills its last 16-byte block is written with the full padding block AES-CBC requires, which x2t left out: LibreOffice refused about a quarter of the encrypted ODF files x2t wrote, which x2t itself read back (
0184, from ElixirOffice's core4c95116). - A PDF's change of password. Each stream is copied to its Length or to its end, whichever comes first, where it was copied to its Length, the length of its ciphertext: an AES stream decrypts to fewer bytes, made up with 0xFF, so changing or removing an AES PDF's password padded every stream (
0185)./Permssays the metadata is encrypted, as it is, where it said the opposite and readers that check it, pypdf among them, reported a failed verification on every PDF x2t encrypted (0186). The old encryption dictionary is no longer copied into the new file, unreferenced, its strings encrypted twice (0187). - Signatures.
libera-sign, a program beside x2t that lists, makes and removes the signatures of an OOXML package, which the host cannot do itself,ooxmlsignaturehaving a C++ interface only (0190, ours). The signer shown is the certificate's subject, read as UTF-8, where it was the issuer's name, escaped (0188), and a certificate's end date has its own day (0189). - PDF (
0176onwards). A form saved as an incremental update leaves its XFA out, so that a reader which shows the XFA, Acrobat, shows the fields as filled rather than the form as it was (0176, ours). A saved PDF keeps its Creator, which the writer replaced with the Producer, or with its own name when the Creator was a hex string (0177, after ElixirOffice's0011-pdf-preserve-creator). A page moved after another keeps the size and rotation it inherits from its own parents, where it took those of the page that had been at its position (0178, ElixirOffice's). A value typed into a form field is written on the field, not on the first ancestor that already had one, which every field under it inherits: a LiveCycle form, a French Cerfa for one, keeps an empty value at its root, and one name typed became the value of all its fields (0179, ours). An encrypted PDF keeps its file ID at its own length: the key of every encryption but AES-256 is computed over it, and the writer copied 16 bytes of it while counting all of them, so a comment on a PDF pypdf encrypted, with RC4 or AES-128 and a 32-byte ID, was not saved (0181, ours). And an incremental update that cannot start writes nothing: the edits after it went into a document never set up, and the save appended an empty update and reported success, where now it copies the original, which the host's check refuses (0182, ours). - A faster start. Seven headers defined their constant tables
static, so every source file including one built its own copy each time x2t started. They are C++17inlinevariables now, defined once (0180, ElixirOffice's0004-header-statics-inline): on macOS the converter's library is 74 MB instead of 88, and a small conversion takes 43 ms instead of 60.
web-apps: 12 patches, and sdkjs: 12. Five are build fixes. Theme tokens were not substituted when deploying HTML. Two cap how many tasks a build phase runs at once. The fourth runs npm and webpack through node, since on Windows both exist only as .cmd files that Node will not spawn without a shell. The fifth makes the SVG sprites before the tasks that read them: the sprites are written into the source tree, and a task running beside them now and then read one half written and failed. One is a rendering fix, for unsized SVG icons in the language picker rendering at 300×150, the CSS default for a replaced element with no intrinsic size. Three are configuration changes that are ours alone. Two are branding. One drops upstream's favicon. The other keeps About reachable in the desktop build, where upstream hides it: that dialog shows the licence and the attribution.
Taking upstream's Go back button off the desktop page once took away what the password dialog's Close file reads to close the window: the button threw, the error became "An error has occurred while opening the file", and that message's OK threw again. Since v9.3.8 upstream's page names an empty Go back itself, which shows no button, and the patch that did so here (web-apps 0013) is gone.
Two are security fixes, from ElixirOffice's fork of web-apps, for places where the editor wrote a document's own text into its page as HTML. A document can carry markup there, and the page holds the bridge, so the markup ran beside it. The popup that describes a tracked change inserted the font of a formatting change and a paragraph's new style as the document names them; it ran as soon as the cursor entered the change. The Formula Wizard wrote each argument's value and the results the same way, so a cell holding markup ran it when the wizard was opened on a formula reading that cell. Both now escape what they show. tests/c_e2e/host/test_hostile_document.py holds them, beside the places that already showed such text as text: a change's author, a comment, a link's tooltip, a sheet's name. Neither fix is upstream yet.
The two other sdkjs patches choose fonts, and come from ElixirOffice's fork of sdkjs (AGPL, like the components), each naming the commit it was taken from. 0002 substitutes a missing font the way Word does: a metric-compatible font first (Carlito for Calibri, Caladea for Cambria, Liberation for Arial, Times New Roman and Courier New), and Calibri, hence Carlito, for a font Word would not know either. 0003 draws the characters of a missing Symbol, Wingdings or Webdings as the Unicode symbols they stand for, where they came out as letters. 0006, ours, finds a font whatever the case of its name, as Word does: a document set in "Open Sans SemiBold" was drawn in a substitute where the font installed is "Open Sans Semibold". 0007, ElixirOffice's (their commit 3d55711), sizes an autofit table's columns so that a word fits beside the first-line indent in every compatibility mode, as Word does, where a Word 2007 calendar had "Su" over "n". 0008, theirs too (the same commit), keeps a run's border in the text properties and the change log and draws it, one box around adjacent runs with equal borders; the change log's text properties had no flag bit left, so the border follows the ligatures byte, marked in two bits older data never sets. 0009, theirs (commit de6ba67), lays out a font size below half a point as half a point, as Word does, so an empty paragraph whose mark has w:sz="0" keeps a height; the stored size is left alone. 0010, theirs (commit 3d55711), draws a superscript's underline under the raised text, where it was left on the line's baseline. 0011, theirs (commit de6ba67) with two changes of ours, reads, draws and writes back picture bullets: a level's bullet id goes in the change log after IsLgl, whose byte's bit 1 says it is there, so that a change log written before still reads, and x2t's renderer, which has no image loader, draws the picture from its address. 0012, theirs (commit 340aed1dc), reads the font table core 0204 writes and draws a missing font in its alternate name when that one, or its clone, is installed; merged with 0006, so an alternate name is found in any case too.
0004 is ours: Markdown keeps its headings through a save. Markdown read into a document gives each heading a style derived from a heading style, which the HTML writer, on the way back to Markdown, did not recognise, so # Title came back as **Title**. It now writes a heading by its outline level, and leaves out a bold that covers the whole heading.
0005 is ours too, and lets the PDF editor open a PDF at all. CPDFDoc's constructor assigned widgets, annots and drawings, which its prototype defines as getters with no setters, and the bundle's strict mode refuses that: "Cannot set property widgets of #
One idea per patch¶
Each patch does one thing and says why. When a patch needs to change, the queue is regenerated from the build tree with git format-patch, and is never edited by hand.
Two traps have each cost real time:
git am strips carriage returns. It parses a patch as mail, so mailinfo removes the trailing CR from every line. Any patch touching upstream's CRLF files is then rejected, with nothing to suggest that line endings were the cause. The queue is applied with --keep-cr.
Do not git add -A in the build tree. The payload build stages generated assets into it, so a blanket add sweeps them into your patch.
Upstreaming¶
Most of these are upstream's own bugs and should go back.
The web-apps fixes are small and self-contained, so they can go as soon as the mirrors exist. The core patches are the valuable contribution and have to wait: two of them change platform defines globally, so the Linux build has to confirm they are inert there before we offer a series that could break somebody else's build.
Three patches never leave our tree. 0002 turns off upstream's feature tips and removes their helpdesk links; 0004 retitles the wrapper page; 0008 turns macros off, until there is a macro language worth offering (see the roadmap). They are configuration for a different product.