sv-lang_10: fix build against fmt 12 - #551902
Conversation
|
@GaetanLepage re: "can this be submitted upstream?" — checked, and there isn't really a natural upstream target for it: slang doesn't maintain release branches for old versions, and 10.0 is already superseded by 11.0+ (which carries the real fix, commit 5a898b4b9). This fix only exists because nixpkgs' `sv-lang_10` deliberately pins the older 10.0 release specifically for circt's `firtool-1.147.0` compatibility, so it's inherently a downstream/packaging-side backport rather than something upstream slang would want on their own tree. Pushed the postPatch restructuring per your nit. |
|
GaetanLepage
left a comment
There was a problem hiding this comment.
Thanks. Please squash the two commits that deal with postPatch.
fmt 12 moved fmt::format's declaration out of the lightweight
fmt/core.h into fmt/format.h, breaking every file here that used
fmt::format while only including fmt/core.h ('format' is not a member
of 'fmt'). format.h is a strict superset of core.h, so replacing the
include is safe everywhere it's used.
Upstream slang already carries this exact fix for the newer sv-lang
(11.0) package, applied for the same reason in commit
5a898b4b9225d281902fcd59fe4732b1561677d2. nixpkgs pins sv-lang_10
(10.0) specifically for circt's firtool-1.147.0, predating that fix
and unable to just take the 11.0 package instead, so backport it here.
Verified: `nix build .#circt` succeeds (previously failed evaluating
sv-lang_10's checkPhase compile step); `firtool --version` reports
1.147.0 as expected.
Nit: keep the fmt-fix comment out of the embedded shell script text by
splitting postPatch into two concatenated '' strings, one per distinct
patch operation.
Assisted-by: Claude Code (Claude Sonnet 5)
Assisted-by: Claude Code (Claude Sonnet 5)
520bc42 to
722cbd3
Compare
Done. (Real Andreas speaking. 😉 ) |
|
Thanks for merging! (Again: Real Andreas!) |
klayout 0.30.7 (the previous pin) silently misses a real DRC violation (GR.2, sealring corner geometry) that 0.30.10 correctly catches -- traced by isolating the exact KLayout release across three toolchains while investigating wafer-space/gf180mcu-project-template#77. librelane bumps to 3.0.8 along the way (requested once NixOS/nixpkgs#551846 merged). yosys is 0.68 at this pin, which fixes the autoname O(iterations x module size) blowup upstream (YosysHQ/yosys#6050), so the local yosysFixed patch and its packages.${system} export are no longer needed. Pinned nixpkgs just past NixOS/nixpkgs#551902 (sv-lang_10 fix for fmt 12) rather than a same-day master commit or the nixos-unstable channel pointer -- the latter predates that fix by ~8h and hits the exact sv-lang build failure it resolves; a bleeding-edge commit has had no time to build/cache upstream at all. nixpkgs' own default python3 is 3.14 here, which breaks two of our deps with no released fix yet: - or-tools (openroad's dependency, transitively librelane's): its meta.broken is conditioned on pythonAtLeast "3.14" (real pybind11 test failures, NixOS/nixpkgs#551898 still open). Overridden back to python313 directly on that one package rather than the whole set, so openroad/librelane/klayout/yosys/pythonEnv all stay on nixpkgs' own default and keep hitting the binary cache. Also disables or-tools' own checkPhase: even on 3.13 it has one unrelated failure (python_contrib_check_dependencies, a stale pkg_resources/setuptools deprecation check -- 610/611 other tests pass), the same workaround NixOS/nixpkgs#551846's author used. - cocotb: no released Python 3.14 support upstream (cocotb/cocotb's setup.py hard-caps at 3.13; 3.14 support exists only on cocotb's unreleased master). Pinned to python313Packages.cocotb as its own nativeBuildInputs entry rather than folded into pythonEnv -- it doesn't need to share an interpreter with anything else, since test/soc/Makefile drives it via `cocotb-config --makefiles`, which points at cocotb's own bundled interpreter internally. Also: p.peakrdl -> p.peakrdl-cli (upstream rename), and beamer added to borgTexlive for docs/talk (ORConf 2026 slides, next commit). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018nC29cmxJCM5eiBBmWNY9q
Summary
Fixes
sv-lang_10(the slang 10.0 build pinned specifically forcirct'sfirtool-1.147.0),which currently fails to compile against nixpkgs' pinned
fmt(12.2.0):'format' is not a member of 'fmt'across several files. Found and diagnosed while bumping other packages in theBorg toolchain and hitting this as a build blocker for
circt.fmt12 movedfmt::format's declaration out of the lightweightfmt/core.hintofmt/format.h.format.his a strict superset ofcore.h, so swapping the include is safeeverywhere it's used, and can't remove anything a file was already relying on.
Upstream slang already carries this exact fix for the newer
sv-lang(11.0) package innixpkgs, applied for the same reason via MikePopoloski/slang@5a898b4.
sv-lang_10pins an older slang release (10.0, required specifically by circt'sfirtool-1.147.0) that predates that fix and can't just be swapped for 11.0, so thisbackports the same one-line-per-file change to the 10.0 source tree via
postPatch(verified via
git apply --checkagainst the upstream commit that most of the individualhunks apply cleanly to 10.0's tree too, just with slightly different surrounding
#includecontext in a few files, hence backporting as a mechanical
sedover all affected filesinstead of reusing the patch file directly).
Verification
nix build .#circt— previously failed duringsv-lang_10's build — now succeeds.firtool --versionon the resulting binary reports1.147.0as expected.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.AI disclosure: this PR description and the git/gh mechanics (branch, commit, push, PR
creation) were drafted/executed with the assistance of Claude Code (Claude Sonnet 5); see the
Assisted-by:trailer on each commit. Root-causing (finding the upstream fix commit, testingpatch applicability, identifying the mechanical include-swap pattern) and the fix content were
done with that assistance and verified via the local
circtbuild described above.