plk / biber

Backend processor for BibLaTeX
Artistic License 2.0
336 stars 38 forks source link

The order of `keyalias` commands in `bbl` file changes nondeterministically #182

Closed ziggystar closed 7 years ago

ziggystar commented 7 years ago

This file reproduces the bug

The problem with this is, that latexmk (and possibly other tools) keeps running forever, because the bbl and bcf files keep changing.

The data of the entries shouldn't matter, though I tried first with minimal @misc entries and it didn't produce the bug. Maybe I made a mistake.

\documentclass{article}

\usepackage[backend=biber]{biblatex}
\begin{filecontents*}{main_biber.bib}
@InProceedings{Bacchus2002,
  author       = {Bacchus, Fahiem and Dalmao, Shannon and Pitassi, Toniann},
  title        = {Value elimination: Bayesian inference via backtracking search},
  booktitle    = {Proceedings of the Nineteenth conference on Uncertainty in Artificial Intelligence},
  year         = {2002},
  ids          = {bacchus2002value},
}
@InCollection{Bidyuk2003,
  author         = {Bidyuk, Bozhena and Dechter, Rina},
  title          = {Cycle-cutset sampling for Bayesian networks},
  booktitle      = {Advances in Artificial Intelligence},
  year           = {2003},
  ids            = {bidyuk2003cycle},
}
@InBook{Biere2009,
  author    = {Biere, Armin},
  title     = {Handbook of satisfiability},
  year      = {2009},
  publisher = {Ios PressInc},
  chapter   = {Model Counting},
  ids       = {Biere2009b},
}
@InProceedings{Bouchard2009,
  author       = {Bouchard, Guillaume and Zoeter, Onno},
  title        = {Split variational inference},
  booktitle    = {Proceedings of the 26\textsuperscript{th} Annual International Conference on Machine Learning},
  year         = {2009},
  ids          = {bouchard2009split},
}

@InProceedings{Boutilier1996,
  author       = {Boutilier, Craig and Friedman, Nir and Goldszmidt, Moises and Koller, Daphne},
  title        = {Context-specific independence in Bayesian networks},
  booktitle    = {Proceedings of the Twelfth international conference on Uncertainty in artificial intelligence},
  year         = {1996},
  ids          = {boutilier1996context},
}

\end{filecontents*}

\addbibresource{main_biber.bib}

\begin{document}
    \parencite{bacchus2002value}
    \parencite{bidyuk2003cycle}
    \parencite{Biere2009b}
    \parencite{bouchard2009split}
    \parencite{boutilier1996context}
    \printbibliography
\end{document}
moewew commented 7 years ago

See also https://github.com/plk/biblatex/issues/618. The MWE does not work with BIbTeX, the ids are not resolved. Not sure if that can be done with BibTeX.

ziggystar commented 7 years ago

I tried adding a sort before the hash that gets traversed at https://github.com/plk/biber/blob/a29463dbe2f565cf1986520107d885ce6cae5a4a/lib/Biber/Output/base.pm#L339.

But this didn't fix it. I don't understand what happens here: https://github.com/plk/biber/blob/a29463dbe2f565cf1986520107d885ce6cae5a4a/lib/Biber/Output/bbl.pm#L167

I assume that the relevant code for this issue is in bbl.pl and base.pl.

plk commented 7 years ago

I have corrected the non-determinism in the .bbl output - please try biber 2.8 DEV version (on Sourceforge). You will also need biblatex 3.8 DEV version to use this.

ziggystar commented 7 years ago

I haven't yet upgraded biblatex, but I'm getting this, and I think this is a Perl issue:

INFO - This is Biber 2.8 (beta) INFO - Logfile is 'main.blg' Use of bare << to mean <<"" is deprecated at /home/thomas/workspace/biber/lib/Biber/Output/bbl.pm line 42. ERROR - Error loading data source package 'Biber::Output::bbl': syntax error at /home/thomas/workspace/biber/lib/Biber/Output/bbl.pm line 42, near "<<~" Compilation failed in require at (eval 339) line 2.

INFO - ERRORS: 1

plk commented 7 years ago

That means you are not using the pre-built biber - presumably you are using your own perl installation but biber 2.8+ requires perl 26.0+ and you seemingly don't have that (<<~ constructions are perl 26.0+).

ziggystar commented 7 years ago

Yes, I'm running the source from Git. Can I get a binary of the dev branch somehow?

plk commented 7 years ago

Yes, in the development folder on Sourceforge: https://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/development/

ziggystar commented 7 years ago

I can confirm that the order of the entries within the bbl file now stays the same with the current dev version.

Thanks a lot.

plk commented 7 years ago

Let me know about the latemnk run after you have updated biblatex - if not, I need to look at the .bcf generation.

ziggystar commented 7 years ago

I checked with my minimal example and with my project. latexmk fails to complete with the old code, and completes after three runs with the new code.

plk commented 7 years ago

Ok, then I'll close this.