Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.81k stars 12.48k forks source link

biber 2.20 is incompatible with texlive 2024's biblatex #172769

Closed thomwiggers closed 4 months ago

thomwiggers commented 6 months ago

brew gist-logs <formula> link OR brew config AND brew doctor output

> brew config
HOMEBREW_VERSION: 4.3.1-63-gf1a7d97
ORIGIN: https://github.com/Homebrew/brew
HEAD: f1a7d971f2e5d04097d7a360aa1f9a910ccc20f3
wLast commit: 69 minutes ago
Core tap HEAD: f1e6445bf32504e0e3a50169a2ee7f8e7ccba76a
Core tap last commit: 4 days ago
Core tap JSON: 24 May 20:32 UTC
Core cask tap JSON: 24 May 20:32 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_BAT: set
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_NO_ENV_HINTS: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.3.1 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.1/bin/ruby
CPU: 10-core 64-bit arm_blizzard_avalanche
 Clang: 15.0.0 build 1500
Git: 2.45.1 => /opt/homebrew/bin/git
Curl: 8.6.0 => /usr/bin/curl
macOS: 14.5-arm64
dCLT: 15.3.0.0.1.1708646388
Xcode: 15.4
Rosetta 2: false
> brew doctor
Your system is ready to brew.

Verification

What were you trying to do (and why)?

Biber is a LaTeX bibliography tool, and heavily relies on compatibility with the biblatex LaTeX package. biblatex is packaged as part of TeXlive and thus only updated once a year. The update to Biber 2.20 (#166841) that was merged recently is incompatible with biblatex that is part of TeXlive 2024, thus made biber inoperable.

This issue was previously reported in #121738 and #95856 but those issues are stale and were closed.

What happened (include all command output)?

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

What did you expect to happen?

My bibliography to compile

Step-by-step reproduction instructions (by running brew commands)

brew install texlive biber
cat > test.tex <<EOF
\begin{filecontents}{\jobname.bib}
@book{Labov1972,
    Address = {Philadelphia},
    Author = {William Labov},
    Publisher = {University of Pennsylvania Press},
    Title = {Sociolinguistic Patterns},
    Year = {1972}}

@book{Chomsky1957,
    Address = {The Hague},
    Author = {Noam Chomsky},
    Publisher = {Mouton},
    Title = {Syntactic Structures},
    Year = {1957}}
}
\end{filecontents}

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\addbibresource{\jobname.bib}
\begin{document}
Some famous linguists wrote a couple of books \autocite{Labov1972,Chomsky1957}.
\printbibliography
\end{document}
EOF
pdflatex test
biber test
p-linnane commented 6 months ago

Thanks for the report @thomwiggers.

@Homebrew/core We've seen this issue before: https://github.com/Homebrew/homebrew-core/issues/121738. Any ideas on how we can deal with this? Do we need to start versioning?

ZhongRuoyu commented 6 months ago

If versioning means adding a separate biber@2.19 that works for the latest texlive (while keeping the unversioned biber): users can still do brew install biber without knowing its existence.

I propose that we have two versioned formulae -- one for the latest stable biber, and one for latest biber that's compatible with our texlive. Then we make biber an alias of the latter. This is similar to how we handle python and should work for the intuitive brew install biber use case. I would like to note that not all of the criteria for versioned formulae are met (e.g., no release branch for minor versions) so we'd need to consider this as an exception.

Alternatively we can downgrade biber to the latest version that works with texlive. In that case we avoid updating it until texlive is updated.

SMillerDev commented 6 months ago

Alternatively we can downgrade biber to the latest version that works with texlive. In that case we avoid updating it until texlive is updated.

At the very least we should probably add a test for this specific case. Maybe we can patch texlive to work with a newer version?

nwhetsell commented 6 months ago

I wanted to mention that creating versioned biber formulae may be complicated by the need for Linux bottles. The biber formula includes a workaround for a linking issue on Linux:

https://github.com/Homebrew/homebrew-core/blob/8eedd25a348ed5d328d0f3663649ad373482aa46/Formula/b/biber.rb#L645-L650

However, this workaround doesn’t seem to work when biber is keg-only (which will probably be the case if biber is versioned). This was an issue with https://github.com/Homebrew/homebrew-core/pull/123295 (unsuccessful attempt to add a biber@2.17 formula) and will probably be an issue for a biber@2.19 formula (link is to my tap).

thomwiggers commented 6 months ago

TeXLive can also be set up to include biber directly; then this package could be deleted (or made so that it is not linked if texlive is present or something like that). Then all headaches are avoided in one stroke.

MikeMcQuaid commented 6 months ago

TeXLive can also be set up to include biber directly

This is what I came in here thinking, too.

nwhetsell commented 6 months ago

I’m pretty sure that TeX Live can include biber in the sense that some TeX Live distributions (like MacTeX) bundle biber with TeX Live, but, as far as I’m aware, the TeX Live installer doesn’t include a setting to install biber. I believe what projects like MacTeX do is build biber separately and then just include the binaries (this is described at https://tug.org/texlive/build.html#biber).

I’d be happy to attempt a pull request to add biber 2.19 to the texlive formula, but here’s what that would entail (from https://github.com/Homebrew/homebrew-core/issues/121738#issuecomment-1408821500):

…the biber formula includes 122 resources, all Perl packages. The texlive formula currently depends on 45 Perl packages; adding biber to texlive would make texlive depend on 139 Perl packages (biber and texlive have 28 Perl resources in common), which seems like a pretty steep increase. In addition, if biber then becomes keg-only, there would effectively be two independent, resource-heavy versions of biber in homebrew-core.

(The last part about biber being keg-only becomes moot if the biber formula is deleted.)

carlocab commented 6 months ago

texlive is already a gigantic formula and regularly fails dependent testing because the runners run out of storage space. I'd rather split it into separate pieces (where sensible) instead of making it bigger.

I'd prefer an update to biber's test block that makes sure it works with texlive.

MikeMcQuaid commented 6 months ago

I'd rather split it into separate pieces (where sensible) instead of making it bigger.

Given the above: yes, I agree.

I'd prefer an update to biber's test block that makes sure it works with texlive.

This seems like a good idea.

nwhetsell commented 6 months ago

@carlocab I’m wondering what is the best way to add a test in this case.

Adding a test to the current biber formula won’t work, because biber 2.20 is incompatible with what’s installed with the texlive formula (so the test is sure to fail).

The most straightforward possibility is probably to rollback the biber formula to 2.19, but I believe this would require adding version_scheme 1 in the biber formula, like this—

class Biber < Formula
  desc "Backend processor for BibLaTeX"
  homepage "https://sourceforge.net/projects/biblatex-biber/"
  url "https://github.com/plk/biber/archive/refs/tags/v2.19.tar.gz"
  sha256 "1c1266bc8adb1637c4c59e23c47d919c5a38da4e53544a3c22c21de4a68fc9fe"
  license "Artistic-2.0"
  version_scheme 1

—and I’m not sure using version_scheme when the version scheme hasn’t really changed (or, for that matter, rolling back biber) would be acceptable for homebrew-core.

Another possibility is to add a biber@2.19 formula that includes a texlive test (and then delete biber@2.19 when TeX Live 2025 is released). However, I’m nearly certain that a biber@2.19 formula could not be keg-only because of an issue with bottling keg-only biber on Linux.

Another possibility is to wait for TeX Live 2025 and add a test then, although that would mean having an incompatible biber in homebrew-core until next March.

SMillerDev commented 6 months ago

Adding a test to the current biber formula won’t work, because biber 2.20 is incompatible with what’s installed with the texlive formula (so the test is sure to fail).

That sounds good, and from there we can work towards a solution

Cerebus commented 6 months ago

I feel like the biber formula should roll back to 2.19, then patch the test suite to track texlive compatibility.

brabalan commented 5 months ago

Is there a workaround to use biber + texlive installed with homebrew in the meantime?

nwhetsell commented 5 months ago

@brabalan If you’re on a Mac, you can install biber v2.19 from here:

brew install nwhetsell/biber/biber@2.19

Note: This is my own tap, not an official Homebrew tap.

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

p-linnane commented 4 months ago

This will be fixed by https://github.com/Homebrew/homebrew-core/pull/173159. I'm monitoring the PR to ensure we get it merged ASAP.