commit 723093895f8cf874e2be7b5bc6839af2c6f3f902
Author: Juergen Spitzmueller <[email protected]>
Date:   Sat Sep 5 15:09:45 2026 +0200

    Handle biblatex error on wrong bbl file (#13360)
---
 src/LaTeX.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index 5ad6e6ebf6..efade08c6f 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -406,6 +406,14 @@ int LaTeX::run(TeXErrors & terr)
                int ex_code = startscript();
                if (ex_code == Systemcall::KILLED || ex_code == 
Systemcall::TIMEOUT)
                        return ex_code;
+               if (scanres & ERROR_RERUN) {
+                       // If we have a ERROR_RERUN clear the errors
+                       // and reset exit_code in case it resolves on rerun.
+                       // This might happen after a faulty blg file that
+                       // has been corrected after the biber run (#13360).
+                       terr.clearErrors();
+                       exit_code = ex_code;
+               }
                scanres = scanLogFile(terr);
 
                // update the depedencies
@@ -1036,6 +1044,7 @@ int LaTeX::scanLogFile(TeXErrors & terr)
        static regex const undef_ref(".*Reference `(.+)\\' on page.*");
        static regex const 
minted_data("\\\\openout[0-9]+.*=.*`(.+)(..).*data\\.minted'\\.");
        static regex const minted_highlight("\\(\\./.*highlight\\.minted");
+       static regex const biblatex_bbl_error("Package biblatex Error: File 
'.*\\.bbl' not created by biblatex\\.");
        // Flag for 'File ended while scanning' message.
        // We need to wait for subsequent processing.
        string wait_for_error;
@@ -1325,6 +1334,11 @@ int LaTeX::scanLogFile(TeXErrors & terr)
                                    || contains(desc,
                                        "Package babel Error: Unknown 
language"))
                                        retval |= ERROR_RERUN;
+                               if (regex_match(desc, sub, biblatex_bbl_error))
+                                       // A bbl file npt produced with biblatex
+                                       // has been found by biblatex (see 
#13360)
+                                       // Simple rerun will generate the 
correct one.
+                                       retval |= ERROR_RERUN;
                                // get the line number:
                                int line = 0;
                                sscanf(tmp.c_str(), "l.%d", &line);
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to