fix: use libtool instead of ar for static libs on macOS#12957
Conversation
c0359e2 to
7f86d69
Compare
This PR fixes a build failure on macOS introduced by #12540. macOS BSD `ar` does not support the `@file` response file syntax that #12540 enabled unconditionally. On macOS, when no archiver has been explicitly configured (via `LEAN_AR`, bundled `llvm-ar`, or `AR`), `compileStaticLib` now uses `libtool -static -filelist` instead, which handles long argument lists natively. When an archiver has been explicitly configured, it is used directly with response files as before. To track this, `LeanInstall.ar` is changed to `LeanInstall.ar?` (an `Option FilePath`), with `none` meaning no archiver was found and the system default should be used. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7f86d69 to
b9f8f00
Compare
|
If I understand correctly, this is just for core, right? I do not like that this makes the Instead, for example, the Lean library in In essence, I think we should make this as local as possible to the case where things break (i.e., bootstrapping core) and minimally impact the API in doing so. |
|
Mathlib CI status (docs):
|
|
Reference manual CI status:
|
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This PR fixes a build failure on macOS introduced by #12540. macOS BSD
ardoes not support the@fileresponse file syntax that #12540 enabled unconditionally. On macOS, when building core (i.e.,bootsrap := true),recBuildStaticnow useslibtool -static -filelist, which handles long argument lists natively.Includes a
stage0/src/stdlib_flags.htrigger so CI will automatically runupdate-stage0after merge.🤖 Prepared with Claude Code
Implementation adjusted by @tydeu