Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Biber and BibLatex incompatibility #88067

Closed
ghost opened this issue May 18, 2020 · 12 comments · Fixed by #273740
Closed

Biber and BibLatex incompatibility #88067

ghost opened this issue May 18, 2020 · 12 comments · Fixed by #273740
Labels
0.kind: bug Something is broken 6.topic: TeX Issues regarding texlive and TeX in general

Comments

@ghost
Copy link

ghost commented May 18, 2020

Describe the bug

$ biber paper
INFO - This is Biber 2.14 (beta)
INFO - Logfile is 'paper.blg'
INFO - Reading 'paper.bcf'
ERROR - Error: Found biblatex control file version 3.4, expected version 3.7.
This means that your biber (2.14) and biblatex (3.11) versions are incompatible.
See compat matrix in biblatex or biber PDF documentation.
INFO - ERRORS: 1

Reproduction
shell.nix

let
  pkgs = import <nixpkgs> {};
in
pkgs.mkShell {
  buildInputs = [
    pkgs.tectonic
    pkgs.biber
  ];
}

paper.tex

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{biblatex}
\addbibresource{sample.bib}

\begin{document}
Let's cite! The Einstein's journal paper \cite{einstein} and the Dirac's 
book \cite{dirac} are physics related items. 

\printbibliography

\end{document}

sample.bib

@article{einstein,
    author = "Albert Einstein",
    title = "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
    [{On} the electrodynamics of moving bodies]",
    journal = "Annalen der Physik",
    volume = "322",
    number = "10",
    pages = "891--921",
    year = "1905",
    DOI = "http://dx.doi.org/10.1002/andp.19053221004",
    keywords = "physics"
}

@book{dirac,
    title = {The Principles of Quantum Mechanics},
    author = {Paul Adrien Maurice Dirac},
    isbn = {9780198520115},
    series = {International series of monographs on physics},
    year = {1981},
    publisher = {Clarendon Press},
    keywords = {physics}
}

Expected behavior
No errors

Notify maintainers
@vcunat

Metadata

$ nix-shell -p nix-info --run "nix-info -m"
these paths will be fetched (0.05 MiB download, 0.28 MiB unpacked):
  /nix/store/vffvap9384lg9vbv4c5j33pvgqc6n1r3-bash-interactive-4.4-p23-dev
copying path '/nix/store/vffvap9384lg9vbv4c5j33pvgqc6n1r3-bash-interactive-4.4-p23-dev' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.40, NixOS, 20.09pre225673.8ba41a1e149 (Nightingale)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.4`
 - channels(root): `"nixos-20.09pre225673.8ba41a1e149, home-manager"`
 - channels(me): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: biber
# a list of nixos modules affected by the problem
module:
@ghost ghost added the 0.kind: bug Something is broken label May 18, 2020
@veprbl veprbl added the 6.topic: TeX Issues regarding texlive and TeX in general label May 18, 2020
@veprbl
Copy link
Member

veprbl commented May 18, 2020

The version of biber that we ship corresponds to texlive.biblatex. tectonic ships with texlive 2018 (tectonic-typesetting/tectonic-staging#9). And doesn't yet have a builtin solution for biber tectonic-typesetting/tectonic#35. You can try overriding biber to version 2.11, which should be compatible.

cc @lluchs as maintainer of tectonic

@simeoncarstens
Copy link
Contributor

I would also appreciate a fix for this. I tried overriding biber to version 2.11, but that didn't help (similar version incompatibility), at least not on the current unstable channel or on 20.03 to match with the date of @veprbl's message. The biblatex version in the current texlive derivation seems to be 3.3, which dates back to 2016, so it looks like updating biblatex would make more sense.

@stale
Copy link

stale bot commented Jun 30, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 30, 2021
@maddiemort
Copy link

I've just encountered this issue too.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 23, 2022
@veprbl
Copy link
Member

veprbl commented Apr 23, 2022

@nerosnm Which version of nixpkgs are you using?
What is the output of:

biber --version
realpath `which latex`

@bryango
Copy link
Member

bryango commented Jun 15, 2023

Currently biber expects biber=2.17 while nixpkgs (as well as texlive) contains biber=2.19. For me the override suggested in #88067 (comment) works with no issue; e.g. with home-manager:

## home.nix

{ pkgs, ... }:

let

  ## source of biber v2.17
  ## ... from: https://hydra.nixos.org/build/202359527
  nixpkgs_biber217 = import (builtins.fetchTarball {
    url = "https://github.com/NixOS/nixpkgs/archive/40f79f003b6377bd2f4ed4027dde1f8f922995dd.tar.gz";
    sha256 = "1javsbaxf04fjygyp5b9c9hb9dkh5gb4m4h9gf9gvqlanlnms4n5";
  }) {};

in {

  home.packages = with pkgs; [
    tectonic  ## to be overridden below
  ];

  ## equivalent to ~/.config/nixpkgs/config.nix
  nixpkgs.config = {
    packageOverrides = pkgs: with pkgs; {
      tectonic = tectonic.override {
        ## overriding depedent biber to v2.17
        biber = nixpkgs_biber217.biber;
      };
    };
  };

}

Although this works on my end, I hope this could be upstreamed to nixpkgs itself so that we can make use of the hydra cache with no need to locally rebuild tectonic; cc maintainers: @lluchs @doronbehar. Thank you very much!

@doronbehar
Copy link
Contributor

Tectonic is tracking this issue in tectonic-typesetting/tectonic#893 . In general, we sort of rely on Tectonic's bundles to follow texlive releases. That's why we don't embed such hardcoding of the biber version in Tectonic - since Tectonic could update it's bundle without an update to Tectonic itself, which could fix such an issue if it arises after a Tectonic release.

Perhaps also the following Tectonic nixpkgs update will help: #237900

@bryango
Copy link
Member

bryango commented Jun 16, 2023

Indeed... Is it then possible to create some tectonic-standalone package without the biber dependency, so that we can install the appropriate versions of biber and tectonic-standalone separately, without the need to recompile the package? 🤔 Thanks!

@doronbehar
Copy link
Contributor

Indeed... Is it then possible to create some tectonic-standalone package without the biber dependency, so that we can install the appropriate versions of biber and tectonic-standalone separately, without the need to recompile the package? thinking Thanks!

You have a point. I was the one who introduced the wrapping of tectonic with biber in #128071 ... I tend to think now that it shouldn't be that way, especially with this frequent issue of incompatibility. I pushed that as well to #237900 .

@bryango
Copy link
Member

bryango commented Jun 17, 2023

Wow nice! Thank you very much!

@bryango
Copy link
Member

bryango commented Jun 18, 2023

I have hence created a wrapper tectonic-with-biber so that one can combine the two into a single package, where the tectonic-specific biber is renamed biber-${version} to prevent conflict with the texlive biber:

## see: https://github.com/bryango/nixpkgs-config/blob/master/pkgs/tectonic-with-biber.nix
{ lib
, symlinkJoin
, makeBinaryWrapper
, tectonic
, biber
}:

symlinkJoin {
  name = "tectonic-with-biber-${biber.version}";

  ## biber is **not** directly exposed in paths
  paths = [ tectonic ];

  nativeBuildInputs = [ makeBinaryWrapper ];

  # Tectonic runs biber when it detects it needs to run it, see:
  # https://github.com/tectonic-typesetting/tectonic/releases/tag/tectonic%400.7.0
  postBuild = ''
    wrapProgram $out/bin/tectonic \
      --prefix PATH : "${lib.getBin biber}/bin"
    makeBinaryWrapper "${lib.getBin biber}/bin/biber" \
      $out/bin/biber-${biber.version}
  '';
  ## the biber executable is exposed as `biber-${biber.version}`

  inherit (tectonic) meta;
}

I am far from proficient in nix, so the package is created following https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/graphics/gimp/wrapper.nix along with the previous revision of tectonic. It can be used e.g. as an override:

{
  tectonic-with-biber = pkgs.callPackage ./pkgs/tectonic-with-biber.nix {
    ## `pkgs_biber` defined as in https://github.com/NixOS/nixpkgs/issues/88067#issuecomment-1592592840
    biber = pkgs_biber217.biber;
  };
}
## see e.g. https://github.com/bryango/nixpkgs-config/blob/master/flake.nix

I don't know whether it's good to upstream this or not. In any case, I think it may be useful to others like me, so it would be good to share this here haha.

@bryango
Copy link
Member

bryango commented Dec 13, 2023

Update: I am now trying to upstream a more polished solution via #273740. @doronbehar would you be interested in a review? 🥺 The PR will close this issue.

doronbehar added a commit that referenced this issue Dec 21, 2023
tectonic, biber-for-tectonic: wrap tectonic with biber-2.17, fix #88067
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: TeX Issues regarding texlive and TeX in general
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants