14 Commits

Author SHA1 Message Date
Nadja Yang
03752ca7ca lean4, leanPackages.lean4: fix darwin build by adding libtool
Lake 4.30.0 uses libtool -static on macOS for static library targets
instead of ar.
d024af099c/src/lake/Lake/Build/Library.lean (L87-L95)

See Hydra Build No. 330752454, lean4.aarch64-darwin (June 4, 2026),
https://hydra.nixos.org/build/330752454; Hydra Build No. 330752481,
leanPackages.lean4.aarch64-darwin (June 4, 2026),
https://hydra.nixos.org/build/330752481.

Breakage introduced in
a26b66330f
2026-06-04 23:56:27 -04:00
Nadja Yang
d63d353258 leanPackages.mathlib: add comment for leangz-raw
Co-authored-by: Mauricio Collares <mauricio@collares.org>
2026-06-04 17:13:18 -04:00
Nadja Yang
bdea40b4ed leanPackages.mathlib: lgz preprocessing
Per-module leantar strips olean structural overhead. See
https://github.com/NixOS/nixpkgs/pull/511524#issuecomment-4615610073
2026-06-04 16:48:52 -04:00
Nadja Yang
b606786817 leanPackages: 4.29.1 -> 4.30.0
Add leangz (leantar) as a new build and runtime dependency.

https://github.com/leanprover/lean4/releases/tag/v4.30.0
https://github.com/leanprover-community/mathlib4/blob/v4.30.0/lake-manifest.json
2026-06-04 16:48:52 -04:00
Nadja Yang
5d81234142 leanPackages.lean4: pin cadical to 2.1.3, add smoke test
cadical >= 2.2.0 produces LRAT proofs Lean's checker does not
yet handle, breaking bv_decide.

0eced05aae
2026-06-04 16:48:52 -04:00
Nadja Yang
fb169268a3 leanPackages.mathlib: harmonize output with Hydra strictures via artifact pre-densification
Rejecting an unwieldy originalist interpretation of the max_output_size
infrastructure mandate [1] — which, by checking NAR size pre-compression,
might be read to foreclose in-NAR densification — this commit resolves
the tension between binary cache availability and statutory size
discipline through equitable artifact pre-densification.

Specifically, we execute xz compression during the postInstall phase
of an intermediate derivation, coupled with a non-Hydra wrapper that
decompresses the payload transparently. This insulates end-users from
the underlying .tar.xz monolith while satisfying the strict procedural
requirements of the build farm's sensors.

We acknowledge reservations regarding the broader applicability of the
unorthodox pattern incepted herein.

See also Jakštys, commit msg. to bbd0655ae8 (2024) ("[intending]
to replace the `passthru.data-compressed` derivations that ha[d]
accumulated in nixpkgs with something more reusable"),
bbd0655ae8

Cf. Luna Nova, hipblaslt/default.nix ll. 113-114 (2026) (patching
hipblaslt C++ runtime to transparently decompress zstd-compressed
.dat files, as "required to keep [the] output under [H]ydra size
limit"), fc1f8110e8/pkgs/development/rocm-modules/hipblaslt/default.nix (L113-L114)

Cf. SuperSandro2000, Review of NixOS/nixpkgs#511524 (this PR) (2026)
("[w]hy not compress the well compressable [.olean] files in nix
with zstd?") (in dicta; a fortiori),
https://github.com/NixOS/nixpkgs/pull/511524#discussion_r3137725277

But cf. Yureka, gclient2nix.py ll. 162-167 (2025) (characterizing
recompression as "bypassing the size limit (making it count the
compressed instead of uncompressed size) rather than complying with
it"), 4dc9b83879/pkgs/by-name/gc/gclient2nix/gclient2nix.py (L162-L167)

[1] NixOS Infrastructure Cap., 170012a468/build/hydra.nix (L116)
2026-06-04 16:48:52 -04:00
Nadja Yang
cefae5621e leanPackages.lean4: use nixpkgs cadical, patch all binaries
Lean binaries derive sysroot from IO.appPath; patch all of them
rather than just lean and lake. Add cadical to symlinkJoin paths
instead of bundling a copy via INSTALL_CADICAL.

ed10debb3c
2026-06-04 16:48:52 -04:00
Nadja Yang
6987e3afbe leanPackages.lean4: 4.29.0 -> 4.29.1
Strip ephemeral setup.json build artifacts from library outputs.
These are produced per-module during compilation and not included
in upstream cache distributions
(https://github.com/NixOS/nixpkgs/issues/510957).

Disable Hydra builds for mathlib since the output exceeds the NAR
size limit.

Pre-build static library for batteries so downstream executables
can link against it.

Refactor update.sh to pin each dependency to the rev from mathlib's
lake-manifest.json.
2026-06-04 16:48:52 -04:00
Nadja Yang
590ccdb420 leanPackages: partially revert a26b66330f
In favor of https://github.com/NixOS/nixpkgs/pull/511524
(72b8bcfd8e).

Retains pkgs.lean4 at 4.30.0.
2026-06-04 16:48:52 -04:00
Niklas Halonen
a26b66330f lean4: update leanPackages and lean4 4.29.0/1 -> 4.30.0
As reported on FreeBSD forums, updating lean4 to 4.30.0 fails to a
leantar related issue.  We follow the patch mentioned on the FreeBSD
forums and depend on digama0/leangz (that comes with leantar).
However, there doesn't seem to be a reason to disable installing
leantar, so we don't set INSTALL_LEANTAR=OFF like the patch.

References:
- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=295656
- https://cgit.freebsd.org/ports/commit/?id=516f8a5764de5c7bdd0e9f7810601a5057bbc650
- https://lean-lang.org/doc/reference/latest/releases/v4.30.0/#release-v4___30___0
- leanprover/lean4#12822
2026-06-01 22:28:05 +03:00
Archit Gupta
ed10debb3c lean4: remove cadical copy
By default, lean4's cmake copies the cadical binary from PATH to its
build output directory. Disabling this behavior does not keep Lean from
using cadical.
2026-04-24 01:39:20 -07:00
Nadja Yang
3c2a3b804d leanPackages: structural reimagining — own toolchain, lake --packages, Hydra visibility
Give leanPackages its own lean4, independent of pkgs.lean4. Binary-
patch the toolchain so the language server discovers the wrapped lake
despite lake serve deriving LAKE from IO.appPath unconditionally.
Supplant Lake's config trace validation for /nix/store/ dependencies,
deferring cache coherence to Nix.

Migrate Nix-managed dependency injection from package-overrides.json
to lake --packages. Patch Cli to pre-build static library for
downstream executables. Add recurseIntoAttrs for Hydra.

Upstream accepted FetchContent for mimalloc vendoring:
a145b9c11a
2026-04-01 11:13:44 -04:00
Nadja Yang
9f1cb0f57c buildLakePackage: add weak-minimax test
Verifies that buildLakePackage works with nix-only deps (no
lake-manifest.json).  Builds a proof of the weak minimax inequality
from Mathlib.Order.CompleteLattice.Basic using leanDeps = [ mathlib ].
2026-03-21 17:53:43 -04:00
Nadja Yang
84206e18a3 leanPackages: init at 4.28.0
Lean 4 package set providing the mathlib dependency tree:
batteries, aesop, Qq, proofwidgets, plausible, LeanSearchClient,
Cli, importGraph, and mathlib itself.

All lockstep packages are versioned with lean4.  ProofWidgets and
LeanSearchClient follow their own versioning, pinned via mathlib's
lake-manifest.json.

Includes update.sh which updates all packages to match the lean4
version in nixpkgs, with a dependency-set check to detect upstream
changes.
2026-03-21 17:52:54 -04:00