Skip to content

yosys*: cleanup, update#397611

Merged
GaetanLepage merged 3 commits intoNixOS:masterfrom
GaetanLepage:yosys
Jul 10, 2025
Merged

yosys*: cleanup, update#397611
GaetanLepage merged 3 commits intoNixOS:masterfrom
GaetanLepage:yosys

Conversation

@GaetanLepage
Copy link
Contributor

@GaetanLepage GaetanLepage commented Apr 10, 2025

Things done

  • yosys: move to by-name
  • yosys: cleanup
  • yosys: 0.51 -> 0.54

cc @VShell @thoughtpolice @Luflosi @oliverbunting @hzeller

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Apr 10, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. and removed 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. labels Apr 12, 2025
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 17, 2025
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 18, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. labels Apr 18, 2025
@GaetanLepage GaetanLepage force-pushed the yosys branch 2 times, most recently from 86c72b1 to 5a31d6c Compare June 17, 2025 20:00
Copy link
Contributor

@drupol drupol left a comment

Choose a reason for hiding this comment

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

Diff LGTM but I haven't tested.

@nix-owners nix-owners bot requested review from Luflosi and thoughtpolice June 17, 2025 20:08
@github-actions github-actions bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jun 17, 2025
@GaetanLepage GaetanLepage marked this pull request as draft June 17, 2025 21:29
Copy link
Contributor

@Luflosi Luflosi left a comment

Choose a reason for hiding this comment

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

I have two questions but other than that, this looks good.

Comment on lines 135 to 137
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens without these propagatedBuildInputs? And are they required even when enablePython is false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They should probably not be added unless enablePython is true.

@Luflosi
Copy link
Contributor

Luflosi commented Jun 28, 2025

Did you want to revert the change to enablePython?

@GaetanLepage
Copy link
Contributor Author

Did you want to revert the change to enablePython?

Sorry, I forgot to come back to this.
I just reverted it :)

I think that now it builds nowhere :/

@Emin017
Copy link
Member

Emin017 commented Jun 29, 2025

Do we really need to clean up these yosys plugins?

@GaetanLepage
Copy link
Contributor Author

Do we really need to clean up these yosys plugins?

We don't need to, but I don't think the cleanup is breaking the package. The update is more likely to be the culprit.

@GaetanLepage GaetanLepage requested a review from Liamolucko July 7, 2025 08:25
@Liamolucko
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 397611
Commit: 8d7e077a129f30fb5b5a5d9c7b7393c8606403cb


aarch64-darwin

❌ 5 packages failed to build:
  • fusesoc
  • fusesoc.dist
  • glasgow
  • glasgow.dist
  • openroad
✅ 35 packages built:
  • cynthion (python313Packages.cynthion)
  • cynthion.dist (python313Packages.cynthion.dist)
  • mcy
  • python312Packages.amaranth
  • python312Packages.amaranth-boards
  • python312Packages.amaranth-boards.dist
  • python312Packages.amaranth-soc
  • python312Packages.amaranth-soc.dist
  • python312Packages.amaranth.dist
  • python312Packages.cynthion
  • python312Packages.cynthion.dist
  • python312Packages.edalize
  • python312Packages.edalize.dist
  • python312Packages.luna-soc
  • python312Packages.luna-soc.dist
  • python312Packages.luna-usb
  • python312Packages.luna-usb.dist
  • python312Packages.yosys
  • python313Packages.amaranth
  • python313Packages.amaranth-boards
  • python313Packages.amaranth-boards.dist
  • python313Packages.amaranth-soc
  • python313Packages.amaranth-soc.dist
  • python313Packages.amaranth.dist
  • python313Packages.edalize
  • python313Packages.edalize.dist
  • python313Packages.luna-soc
  • python313Packages.luna-soc.dist
  • python313Packages.luna-usb
  • python313Packages.luna-usb.dist
  • yosys (python313Packages.yosys)
  • sby
  • silice
  • yosys-bluespec
  • yosys-synlig

Error logs: `aarch64-darwin`
glasgow
                            "--pin-dck", "15", "--columns", "160", "--rows", "144",
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                            "--vblank", "960e-6"])
                            ^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/var/nix/builds/nix-build-glasgow-0-unstable-2025-01-26.drv-0/source/software/glasgow/applet/__init__.py", line 286, in assertBuilds
    target.build_plan().get_bitstream()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/nix/var/nix/builds/nix-build-glasgow-0-unstable-2025-01-26.drv-0/source/software/glasgow/target/hardware.py", line 241, in get_bitstream
    bitstream_data, stdout_data = self.execute(debug=debug)
                                  ~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/nix/var/nix/builds/nix-build-glasgow-0-unstable-2025-01-26.drv-0/source/software/glasgow/target/hardware.py", line 193, in execute
    raise GatewareBuildError(
        f"gateware build failed with exit code {proc.returncode}; "
        f"re-run `glasgow` without `-q` to view build log")
glasgow.gateware.GatewareBuildError: gateware build failed with exit code 1; re-run `glasgow` without `-q` to view build log

Ran 263 tests in 261.893s

FAILED (errors=1, skipped=6)

openroad
      |                       ^
/nix/var/nix/builds/nix-build-openroad-2.0-unstable-2025-03-01.drv-0/source/third-party/abc/src/bdd/dsd/dsdProc.c:1572:15: warning: variable 'bRes' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
 1572 |     else if ( pR->Type == DSD_NODE_PRIME )
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/var/nix/builds/nix-build-openroad-2.0-unstable-2025-03-01.drv-0/source/third-party/abc/src/bdd/dsd/dsdProc.c:1603:15: note: uninitialized use occurs here
 1603 |     Cudd_Ref( bRes );
      |               ^~~~
/nix/var/nix/builds/nix-build-openroad-2.0-unstable-2025-03-01.drv-0/source/third-party/abc/src/bdd/dsd/dsdProc.c:1572:10: note: remove the 'if' if its condition is always true
 1572 |     else if ( pR->Type == DSD_NODE_PRIME )
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1573 |     {
/nix/var/nix/builds/nix-build-openroad-2.0-unstable-2025-03-01.drv-0/source/third-party/abc/src/bdd/dsd/dsdProc.c:1565:18: note: initialize the variable 'bRes' to silence this warning
 1565 |     DdNode * bRes;
      |                  ^
      |                   = nullptr
1 warning generated.
2 warnings generated.
[ 79%] Built target libabc
[ 79%] Built target rsz_lib
make: *** [Makefile:146: all] Error 2

Copy link
Contributor

@Liamolucko Liamolucko left a comment

Choose a reason for hiding this comment

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

The outdated comment on fix-clang-build.patch should probably be removed, but otherwise LGTM.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jul 7, 2025
@GaetanLepage
Copy link
Contributor Author

The outdated comment on fix-clang-build.patch should probably be removed, but otherwise LGTM.

Thanks! Removed/

@GaetanLepage GaetanLepage requested review from drupol and kirillrdy July 7, 2025 11:54
@GaetanLepage GaetanLepage merged commit 8e95c8a into NixOS:master Jul 10, 2025
27 of 28 checks passed
@GaetanLepage GaetanLepage deleted the yosys branch July 10, 2025 09:43
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 3+ This PR was reviewed and approved by three or more persons. and removed 12.approvals: 2 This PR was reviewed and approved by two persons. labels Jul 10, 2025
@flokli
Copy link
Member

flokli commented Jul 23, 2025

This broke at least the glasgow package, maybe also openroad (didn't bisect that one). Bisect of glasgow:

5c40143e100d6b47dc03e6ce003ba256b0784520 is the first bad commit
commit 5c40143e100d6b47dc03e6ce003ba256b0784520 (HEAD)
Author: Gaetan Lepage <[email protected]>
Date:   Thu Apr 10 10:00:03 2025 +0200

    yosys: 0.51 -> 0.54
    
    Diff:
    https://github.com/YosysHQ/yosys/compare/refs/tags/v0.51...refs/tags/v0.54
    
    Changelog: https://github.com/YosysHQ/yosys/releases/tag/v0.54

 pkgs/by-name/yo/yosys/fix-clang-build.patch | 14 ++++---
 pkgs/by-name/yo/yosys/package.nix           | 35 ++++++------------
 2 files changed, 19 insertions(+), 30 deletions(-)
git bisect start
# status: waiting for both good and bad commits
# good: [5c8499934295dd5b0ad89472f9f6b91a773d8643] ocamlPackages.gen_js_api: 1.1.4 -> 1.1.5
git bisect good 5c8499934295dd5b0ad89472f9f6b91a773d8643
# status: waiting for bad commit, 1 good commit known
# bad: [c1bdb17d00d772ffe08b78e9912d13b5700ae170] bootc: 1.1.2 -> 1.4.0; follow upstream redirect (#424643)
git bisect bad c1bdb17d00d772ffe08b78e9912d13b5700ae170
# bad: [3b5f1a4b7bfefd0a2aaa74a27d67e7ab42cd1c62] python3Packages.google-cloud-dataproc: 5.20.0 -> 5.21.0 (#422781)
git bisect bad 3b5f1a4b7bfefd0a2aaa74a27d67e7ab42cd1c62
# good: [940d0c87309bdb0ac24aaff1d116d65cdcf3217c] keymapper: 4.12.1 -> 4.12.2 (#420995)
git bisect good 940d0c87309bdb0ac24aaff1d116d65cdcf3217c
# bad: [0bbef13b67e67375d5377e17c00338ba13a4169e]  firefox-{devedition,beta}-unwrapped: 141.0b5 -> 141.0b8  (#424122)
git bisect bad 0bbef13b67e67375d5377e17c00338ba13a4169e
# bad: [7ccf79b43b5db3ae2e2e9cf8a2ca27155976205c] terraform-providers.pocketid: init at 0.1.2
git bisect bad 7ccf79b43b5db3ae2e2e9cf8a2ca27155976205c
# bad: [5a552832ae1b16c45ba62e368989e08874312574] phrase-cli: 2.42.0 -> 2.42.2 (#421244)
git bisect bad 5a552832ae1b16c45ba62e368989e08874312574
# good: [d4c73df9ed7fae6fbb0659f4241c7f99feb267f2] dezoomify-rs: 2.13.0 -> 2.15.0 (#423739)
git bisect good d4c73df9ed7fae6fbb0659f4241c7f99feb267f2
# bad: [9ef9c482e3e641d7d407d84d584fed7dcf05613b] ddns-go: 6.10.0 -> 6.11.2 (#420129)
git bisect bad 9ef9c482e3e641d7d407d84d584fed7dcf05613b
# bad: [6763e4da84d85e2b08baf05adc44ff85bf556522] remnote: 1.19.35 -> 1.19.56 (#423753)
git bisect bad 6763e4da84d85e2b08baf05adc44ff85bf556522
# good: [0404e655b5d42258c7fc20b2fd29a962b4ca9fbd] duckduckgo-search: 8.0.4 -> 8.1.1 (#423546)
git bisect good 0404e655b5d42258c7fc20b2fd29a962b4ca9fbd
# bad: [8e95c8ab6ab75c7ff5ca73d7fc184e7514b493d0] yosys*: cleanup, update (#397611)
git bisect bad 8e95c8ab6ab75c7ff5ca73d7fc184e7514b493d0
# good: [4d18d2d1ce3ab662c9d6214d6f4f5e6e0c9ac7db] yosys: cleanup
git bisect good 4d18d2d1ce3ab662c9d6214d6f4f5e6e0c9ac7db
# bad: [5c40143e100d6b47dc03e6ce003ba256b0784520] yosys: 0.51 -> 0.54
git bisect bad 5c40143e100d6b47dc03e6ce003ba256b0784520
# first bad commit: [5c40143e100d6b47dc03e6ce003ba256b0784520] yosys: 0.51 -> 0.54

@whitequark
Copy link

whitequark commented Jul 26, 2025

Every released version of Yosys since Yosys 0.52 0.54 is unsuitable for building Amaranth code due to this bug. All Amaranth packages will be broken as a result of merging this PR.

The versions of Yosys that are able to correctly translate Amaranth code are 0.53 or current HEAD.

@GaetanLepage
Copy link
Contributor Author

Every released version of Yosys since Yosys 0.52 0.54 is unsuitable for building Amaranth code due to this bug. All Amaranth packages will be broken as a result of merging this PR.

The versions of Yosys that are able to correctly translate Amaranth code are 0.53 or current HEAD.

Thank you for this information. So we have three choices regarding yosys:

  1. Wait for the next stable release, which should work (as the current HEAD is working)
  2. Revert to 0.53.0
  3. Bump to 0.54.0-unstable-2025-07-XX

Do you have an opinion on those options?

@whitequark
Copy link

Any of these options are fine IMO. I would personally bump to 0.54.0-unstable-2025-07-XX (where XX >= 09) and this is what I recommended to downstream users in the past when someone else encountered the same problem. I do not know what the nixpkgs policy is.

@GaetanLepage
Copy link
Contributor Author

GaetanLepage commented Jul 26, 2025

Any of these options are fine IMO. I would personally bump to 0.54.0-unstable-2025-07-XX (where XX >= 09) and this is what I recommended to downstream users in the past when someone else encountered the same problem. I do not know what the nixpkgs policy is.

Ok! I just realized that 0.55.0 was released. Is it also having the same issue? If so, then I'll update yosys to 0.55.0-unstable-2025-07-25.

@whitequark
Copy link

Ok! I just realized that 0.55.0 was released. Is it also having the same issue?

Release 0.55 has the same issue as release 0.54; the PR with the bugfix was merged the day after the 0.55 release.

If so, then I'll update yosys to 0.55.0-unstable-2025-07-25.

This is referring to essentially current HEAD, right? If so, that sounds right to me.

@GaetanLepage
Copy link
Contributor Author

Ok! I just realized that 0.55.0 was released. Is it also having the same issue?

Release 0.55 has the same issue as release 0.54; the PR with the bugfix was merged the day after the 0.55 release.

If so, then I'll update yosys to 0.55.0-unstable-2025-07-25.

This is referring to essentially current HEAD, right? If so, that sounds right to me.

Ok thanks. Well if there is a specific PR that fixes the PR, I will probably simply fetch the relevant patch.

@whitequark
Copy link

You can apply this patch, yes.

GaetanLepage added a commit to GaetanLepage/nixpkgs that referenced this pull request Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 3+ This PR was reviewed and approved by three or more persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants