把黎曼猜想的 Lean 证明,写成人能读懂的证明
把黎曼猜想的 Lean 证明写成数学家能读的证明文章,以及人人能看懂的证明思路
Extract the verified Linux toolchain with native symlink support
Browse files+5 −2 routes/cogito-source-provenance/prepare_toolchain.py View file
| @@ -5,6 +5,7 @@ import hashlib | ||
| 5 | 5 | import json |
| 6 | 6 | from pathlib import Path |
| 7 | 7 | import subprocess |
| 8 | +import tarfile | |
| 8 | 9 | |
| 9 | 10 | URL = 'https://github.com/leanprover/lean4/releases/download/v4.33.1/lean-4.33.1-linux.tar.zst' |
| 10 | 11 | SIZE = 570405234 |
| @@ -51,8 +52,10 @@ def main(): | ||
| 51 | 52 | if archive.stat().st_size != SIZE or h.hexdigest() != SHA256: |
| 52 | 53 | raise ValueError('official release digest/size mismatch; nothing extracted') |
| 53 | 54 | print('progress: 80/100 official release digest matched; extracting private toolchain',flush=True) |
| 54 | - # Windows libarchive can unpack zstd without installing system packages in WSL. | |
| 55 | - subprocess.run(['tar.exe','-xf',windows_path(archive),'-C',windows_path(root)],check=True) | |
| 55 | + # Extract under Linux so relative Linux symlinks are preserved. | |
| 56 | + # Python 3.14 provides zstd support without a system package installation. | |
| 57 | + with tarfile.open(archive, mode='r:zst') as package: | |
| 58 | + package.extractall(root, filter='data') | |
| 56 | 59 | binary = root / 'lean-4.33.1-linux/bin/lean' |
| 57 | 60 | version = subprocess.check_output([str(binary),'--version'],text=True).strip() |
| 58 | 61 | if '4.33.1' not in version or '819816b2' not in version: |