[FIX] git: the opt-out is NO_RUST, and Rust is now the default

Removing WITH_RUST=1 changed nothing -- cargo was still invoked:

  CARGO target/release/libgitcore.a
  /bin/sh: line 1: cargo: command not found

The Makefile reads `ifndef NO_RUST`, so Rust is built BY DEFAULT and the opt-out
is NO_RUST. WITH_RUST=1 sets a variable the Makefile never reads. Deleting it was
correct and insufficient, the worst combination: the hook reported success and the
build failed identically.

This is a stopgap, not a decision. Rust IS supportable here, and measured rather
than assumed: rust-1.90.0-s390x-unknown-linux-gnu.tar.xz answers 200, and the
host already carries rustc 1.85.1. The cost is llvm and clang, which Arch's rust
lists as makedepends -- large, not impossible.

It also cannot be avoided for long. ERPLibre's poetry.lock needs cryptography
46.0.5, jiter, orjson, pydantic-core and rpds-py, all of which build Rust from
source where no wheel exists -- and none exists for s390x.

--- FR ---

Retirer WITH_RUST=1 n'a rien changé — cargo était toujours appelé :

  CARGO target/release/libgitcore.a
  /bin/sh: line 1: cargo: command not found

Le Makefile dit `ifndef NO_RUST` : Rust est bâti PAR DÉFAUT et l'échappatoire est
NO_RUST. WITH_RUST=1 définit une variable que le Makefile ne lit jamais. La
supprimer était juste et insuffisant, la pire combinaison : le hook annonçait un
succès et la construction échouait à l'identique.

C'est un palliatif, pas une décision. Rust EST supportable ici, et mesuré plutôt
que supposé : rust-1.90.0-s390x-unknown-linux-gnu.tar.xz répond 200, et l'hôte
porte déjà rustc 1.85.1. Le coût est llvm et clang, que le rust d'Arch liste en
makedepends — lourd, pas impossible.

Et cela ne pourra pas être évité longtemps. Le poetry.lock d'ERPLibre exige
cryptography 46.0.5, jiter, orjson, pydantic-core et rpds-py, qui tous compilent
du Rust depuis les sources là où aucune roue n'existe — et il n'en existe pas pour
s390x.

Assisted-by: Claude Opus 5
This commit is contained in:
Mathieu Benoit 2026-08-23 23:06:54 -04:00
parent 29da076277
commit 111d4c80b3

View file

@ -113,12 +113,34 @@ echo "git: man pages dropped (no asciidoc, four places)"
python3 - <<'ZZPY'
import io, re
lines = io.open("PKGBUILD", encoding="utf-8").read().split("\n")
# NO_RUST=1, not merely dropping WITH_RUST=1.
#
# Removing WITH_RUST=1 changed nothing -- cargo was still invoked:
#
# CARGO target/release/libgitcore.a
# /bin/sh: line 1: cargo: command not found
#
# The Makefile reads
#
# ifndef NO_RUST
# BASIC_CFLAGS += -DWITH_RUST
# GITLIBS += $(RUST_LIB)
#
# so Rust is built BY DEFAULT and the opt-out is NO_RUST. WITH_RUST=1 in the
# PKGBUILD sets a variable the Makefile never reads; deleting it was correct and
# insufficient, which is the worst combination -- the hook reported success and
# the build failed identically.
#
# Worth recording as an upstream change: git now needs a Rust toolchain unless
# told otherwise. For a distribution bootstrapped from source that is a real
# obstacle, because rustc bootstraps from a previous rustc.
hit = [i for i, l in enumerate(lines) if re.match(r"^[ \t]*WITH_RUST=1[ \t]*$", l)]
assert len(hit) == 1, "git: expected one WITH_RUST=1 line, got %d" % len(hit)
del lines[hit[0]]
lines[hit[0]] = re.match(r"^[ \t]*", lines[hit[0]]).group(0) + "NO_RUST=1"
out = [l.replace(" 'rust'", "") if "makedepends" in l else l for l in lines]
io.open("PKGBUILD", "w", encoding="utf-8").write("\n".join(out))
ZZPY
grep -qE "^[[:space:]]*WITH_RUST=1" PKGBUILD && { echo "git: WITH_RUST survived" >&2; exit 1; }
grep -qE "^[[:space:]]*NO_RUST=1" PKGBUILD || { echo "git: NO_RUST=1 was not set" >&2; exit 1; }
grep -q "'rust'" PKGBUILD && { echo "git: rust still in makedepends" >&2; exit 1; }
echo "git: built without Rust (no rustc to bootstrap from on s390x)"