Skip to content

sv-lang_10: fix build against fmt 12 - #551902

Merged
GaetanLepage merged 2 commits into
NixOS:masterfrom
gonsolo:sv-lang-fmt-fix
Aug 16, 2026
Merged

sv-lang_10: fix build against fmt 12#551902
GaetanLepage merged 2 commits into
NixOS:masterfrom
gonsolo:sv-lang-fmt-fix

Conversation

@gonsolo

@gonsolo gonsolo commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes sv-lang_10 (the slang 10.0 build pinned specifically for circt's firtool-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 the
Borg toolchain and hitting this as a build blocker for circt.

fmt 12 moved fmt::format's declaration out of the lightweight fmt/core.h into
fmt/format.h. format.h is a strict superset of core.h, so swapping the include is safe
everywhere 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 in
nixpkgs, applied for the same reason via MikePopoloski/slang@5a898b4.
sv-lang_10 pins an older slang release (10.0, required specifically by circt's
firtool-1.147.0) that predates that fix and can't just be swapped for 11.0, so this
backports the same one-line-per-file change to the 10.0 source tree via postPatch
(verified via git apply --check against the upstream commit that most of the individual
hunks apply cleanly to 10.0's tree too, just with slightly different surrounding #include
context in a few files, hence backporting as a mechanical sed over all affected files
instead of reusing the patch file directly).

Verification

nix build .#circt — previously failed during sv-lang_10's build — now succeeds. firtool --version on the resulting binary reports 1.147.0 as expected.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, [pkgs/README.md], maintainers/README.md and other READMEs.
  • Follows the automation/AI policy.

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, testing
patch applicability, identifying the mechanical include-swap pattern) and the fix content were
done with that assistance and verified via the local circt build described above.

@nixpkgs-ci
nixpkgs-ci Bot requested review from SharzyL and carlossless August 12, 2026 14:32
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. llm-assisted Contributions that include code generation with LLMs labels Aug 12, 2026
@gonsolo
gonsolo requested a review from GaetanLepage August 12, 2026 14:45
Comment thread pkgs/by-name/sv/sv-lang_10/package.nix Outdated
@gonsolo gonsolo mentioned this pull request Aug 12, 2026
13 tasks
@gonsolo

gonsolo commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

@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

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 551902
Commit: 520bc423d70b3a4b2b86a4a4e163630f99c99de4


x86_64-linux

✅ 2 packages built:
  • circt
  • sv-lang_10

aarch64-linux

✅ 2 packages built:
  • circt
  • sv-lang_10

aarch64-darwin

✅ 1 package built:
  • sv-lang_10

@GaetanLepage GaetanLepage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
@gonsolo

gonsolo commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. Please squash the two commits that deal with postPatch.

Done. (Real Andreas speaking. 😉 )

@GaetanLepage

Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 551902
Commit: 722cbd34a75605510eb79758412e9f0cc9cb494c


x86_64-linux

✅ 2 packages built:
  • circt
  • sv-lang_10

aarch64-linux

✅ 2 packages built:
  • circt
  • sv-lang_10

aarch64-darwin

✅ 1 package built:
  • sv-lang_10

@GaetanLepage GaetanLepage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@GaetanLepage
GaetanLepage added this pull request to the merge queue Aug 16, 2026
Merged via the queue into NixOS:master with commit 055f428 Aug 16, 2026
26 checks passed
@gonsolo

gonsolo commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Thank you!

Thanks for merging! (Again: Real Andreas!)

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". labels Aug 16, 2026
gonsolo added a commit to gonsolo/Borg that referenced this pull request Aug 17, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge-bot eligible This PR can be merged by commenting "@NixOS/nixpkgs-merge-bot merge". 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. llm-assisted Contributions that include code generation with LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants