bin/find-unneeded-includes                            |   27 +++++++++++++++---
 download.lst                                          |    4 +-
 external/xmlsec/0001-const-up-xmlSecErrorsTable.patch |   26 -----------------
 external/xmlsec/UnpackedTarball_xmlsec.mk             |    2 -
 4 files changed, 25 insertions(+), 34 deletions(-)

New commits:
commit d56e6cc6ec7807155e56bb7c59aabe5f8f885beb
Author:     Miklos Vajna <[email protected]>
AuthorDate: Thu Oct 16 09:16:24 2025 +0200
Commit:     Miklos Vajna <[email protected]>
CommitDate: Thu Oct 16 12:00:30 2025 +0200

    xmlsec: upgrade to 1.3.8
    
    Downloaded from
    <https://www.aleksey.com/xmlsec/download/xmlsec1-1.3.8.tar.gz>.
    
    Remove 0001-const-up-xmlSecErrorsTable.patch, which is upstream already.
    
    Change-Id: I633ed7ecc90b8d798aa9ae03a4237fda4cf26b47
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192476
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/download.lst b/download.lst
index 8441b918dd32..e126ee3f1a37 100644
--- a/download.lst
+++ b/download.lst
@@ -455,8 +455,8 @@ LIBWEBP_TARBALL := libwebp-1.6.0.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
-XMLSEC_SHA256SUM := 
d82e93b69b8aa205a616b62917a269322bf63a3eaafb3775014e61752b2013ea
-XMLSEC_TARBALL := xmlsec1-1.3.7.tar.gz
+XMLSEC_SHA256SUM := 
d0180916ae71be28415a6fa919a0684433ec9ec3ba1cc0866910b02e5e13f5bd
+XMLSEC_TARBALL := xmlsec1-1.3.8.tar.gz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
diff --git a/external/xmlsec/0001-const-up-xmlSecErrorsTable.patch 
b/external/xmlsec/0001-const-up-xmlSecErrorsTable.patch
deleted file mode 100644
index d580909ea53c..000000000000
--- a/external/xmlsec/0001-const-up-xmlSecErrorsTable.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 49382b442e2c1c651019c58966f7a6378759954b Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <[email protected]>
-Date: Sat, 12 Jul 2025 21:33:34 +0100
-Subject: [PATCH] const up xmlSecErrorsTable
-
-to move it out of the .data table
----
- src/errors.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/errors.c b/src/errors.c
-index 075265d6..fe7e6601 100644
---- a/src/errors.c
-+++ b/src/errors.c
-@@ -41,7 +41,7 @@ struct _xmlSecErrorDescription {
-     const char*         errorMsg;
- };
- 
--static xmlSecErrorDescription xmlSecErrorsTable[XMLSEC_ERRORS_MAX_NUMBER + 1] 
= {
-+static const xmlSecErrorDescription 
xmlSecErrorsTable[XMLSEC_ERRORS_MAX_NUMBER + 1] = {
-   { XMLSEC_ERRORS_R_XMLSEC_FAILED,              "xmlsec library function 
failed" },
-   { XMLSEC_ERRORS_R_MALLOC_FAILED,              "malloc function failed" },
-   { XMLSEC_ERRORS_R_STRDUP_FAILED,              "strdup function failed" },
--- 
-2.49.0
-
diff --git a/external/xmlsec/UnpackedTarball_xmlsec.mk 
b/external/xmlsec/UnpackedTarball_xmlsec.mk
index 36641d89cd20..77d3386b27dc 100644
--- a/external/xmlsec/UnpackedTarball_xmlsec.mk
+++ b/external/xmlsec/UnpackedTarball_xmlsec.mk
@@ -10,8 +10,6 @@
 xmlsec_patches :=
 # Remove this when Ubuntu 20.04 is EOL in 2025.
 xmlsec_patches += old-nss.patch.1
-# Upstreamed as: https://github.com/lsh123/xmlsec/pull/937
-xmlsec_patches += 0001-const-up-xmlSecErrorsTable.patch
 
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,xmlsec))
 
commit 607cb95dd5e4197f54e38516d657db5d62fef8e3
Author:     Gabor Kelemen <[email protected]>
AuthorDate: Fri Oct 10 20:41:25 2025 +0200
Commit:     Miklos Vajna <[email protected]>
CommitDate: Thu Oct 16 12:00:19 2025 +0200

    bin/find-unneeded-includes: bring back forward declaration suggestions
    
    In headers only, in order to shave off even more headers from build
    
    Put this behind a new option and skip headers that have '#if' in them, 
indicating
    config or platform dependent code of any kind - this is fragile, so let's 
skip it.
    
    Change-Id: I74777a2a2b0aef9c17fd7542f2c405f7536fe4ea
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192182
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins

diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes
index 1f82f2b044b1..3f9d3bfeccc5 100755
--- a/bin/find-unneeded-includes
+++ b/bin/find-unneeded-includes
@@ -504,7 +504,7 @@ def isInUnoIncludeFile(path):
             or path.startswith("include/uno/")
 
 
-def tidy(compileCommands, paths, dontstop, noexclude, checknamespaces, 
finderrors, removefwdd, debug):
+def tidy(compileCommands, paths, dontstop, noexclude, checknamespaces, 
finderrors, removefwdd, debug, headersfwd):
     return_code = 0
 
     try:
@@ -554,8 +554,12 @@ def tidy(compileCommands, paths, dontstop, noexclude, 
checknamespaces, finderror
             if assume:
                 args = args.replace(assumeAbs, "-x c++ " + pathAbs)
 
-            if not removefwdd:
+            if not removefwdd and not headersfwd:
+            # Do not suggest forward declarations in headers
                 invocation = "include-what-you-use -Xiwyu --no_fwd_decls 
-Xiwyu --max_line_length=200 " + args
+            # Suggest headers' replacement with forward declarations
+            elif headersfwd:
+                invocation = "include-what-you-use -Xiwyu --cxx17ns -Xiwyu 
--max_line_length=200 " + args
             # In --fwdecl mode we ask for fw declaration removal suggestions.
             # In this mode obsolete fw declarations are suggested for removal.
             # Later we ignore the header removal suggestions, which may be
@@ -589,8 +593,11 @@ def main(argv):
                     help='The files to be checked')
     parser.add_argument('--recursive', metavar='DIR', nargs=1, type=str,
                     help='Recursively search a directory for source files to 
check')
-    parser.add_argument('--headers', action='store_true',
+    hgroup = parser.add_mutually_exclusive_group()
+    hgroup.add_argument('--headers', action='store_true',
                     help='Check header files. If omitted, check source files. 
Use with --recursive.')
+    hgroup.add_argument('--headersfwd', action='store_true',
+                    help='Check header files, suggest fw declaration 
replacements. If omitted, check source files. Use with --recursive.')
     parser.add_argument('--noexclude', action='store_true',
                     help='Ignore excludelist. Useful to check whether its 
exclusions are still all valid.')
     parser.add_argument('--ns', action='store_true',
@@ -627,6 +634,18 @@ def main(argv):
                         # used in defines and iwyu (0.21 at least) can not yet 
understand those properly
                         if (file.endswith(".hxx") or file.endswith(".h")):
                             list_of_files.append(os.path.join(root,file))
+                elif args.headersfwd:
+                    if (file.endswith(".hxx") or file.endswith(".hrc") or 
file.endswith(".h")):
+                        # Peek inside the file to check for code behind #ifdef 
or similar
+                        # This is the fragile part, skip forward declaration 
suggestions for such
+                        p1 = subprocess.Popen(['git', 'grep', '-v', '-e', 
'INCLUDED', os.path.join(root,file) ], stdout=subprocess.PIPE)
+                        p2 = subprocess.Popen(['grep', '-e', '#if'], 
stdin=p1.stdout, stdout=subprocess.PIPE)
+                        p1.stdout.close()
+                        output, _ = p2.communicate()
+                        if not output:
+                            list_of_files.append(os.path.join(root,file))
+                        else:
+                            continue
                 else:
                     if (file.endswith(".cxx") or file.endswith(".c")):
                         list_of_files.append(os.path.join(root,file))
@@ -691,7 +710,7 @@ def main(argv):
                         print("WARNING: no exclusions are defined for:", file)
         sys.exit(0)
 
-    tidy(compileCommands, paths=list_of_files, 
dontstop=vars(args)["continue"], noexclude=args.noexclude, 
checknamespaces=args.ns, finderrors=args.finderrors, removefwdd=args.fwdecl, 
debug=args.d)
+    tidy(compileCommands, paths=list_of_files, 
dontstop=vars(args)["continue"], noexclude=args.noexclude, 
checknamespaces=args.ns, finderrors=args.finderrors, removefwdd=args.fwdecl, 
debug=args.d, headersfwd=args.headersfwd)
 
 if __name__ == '__main__':
     main(sys.argv[1:])

Reply via email to