Skip to content

yosys-slang: init at 0-unstable-2025-12-15#472800

Open
luciengaitskell wants to merge 2 commits intoNixOS:masterfrom
luciengaitskell:yosys-slang
Open

yosys-slang: init at 0-unstable-2025-12-15#472800
luciengaitskell wants to merge 2 commits intoNixOS:masterfrom
luciengaitskell:yosys-slang

Conversation

@luciengaitskell
Copy link

@luciengaitskell luciengaitskell commented Dec 20, 2025

Add yosys-slang yosys plugin: https://github.com/povik/yosys-slang
This plugin is provided in the OSS CAD Suite and therefore would be nice to have as a nixpkg.

Can show the plugin loaded with:

yosys -m result/share/yosys/plugins/slang.so -p "help read_slang"

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • 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.

Add a 👍 reaction to pull requests you find important.

@luciengaitskell luciengaitskell marked this pull request as draft December 20, 2025 20:05
@nixpkgs-ci nixpkgs-ci bot added the 12.first-time contribution This PR is the author's first one; please be gentle! label Dec 20, 2025
@luciengaitskell
Copy link
Author

(fixing commit history)

@luciengaitskell luciengaitskell marked this pull request as ready for review December 20, 2025 20:10
@luciengaitskell luciengaitskell force-pushed the yosys-slang branch 2 times, most recently from 1446af5 to 4ddb153 Compare December 20, 2025 20:31
@luciengaitskell
Copy link
Author

luciengaitskell commented Dec 20, 2025

Updated to use the new by-name mechanism instead of callPackage (used by existing Yosys plugins)

https://github.com/NixOS/nixpkgs/actions/runs/20399639009/job/58620137360#logs

@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. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Dec 20, 2025
Copy link
Member

@Emin017 Emin017 left a comment

Choose a reason for hiding this comment

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

Most of it LGTM, but there are a few minor issues.

And I also noticed that yosys-slang/GitRevision appears to retrieve the revision via Git, but the packaging approach in this PR does not currently support that. It would be great if this could be supported.

@nixpkgs-ci nixpkgs-ci bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Dec 30, 2025
@povik
Copy link
Contributor

povik commented Jan 5, 2026

And I also noticed that yosys-slang/GitRevision appears to retrieve the revision via Git, but the packaging approach in this PR does not currently support that. It would be great if this could be supported.

Is the issue that fetchFromGithub is not a git checkout per se and does not populate .git? Version information can also be supplied to cmake with -DYOSYS_SLANG_REVISION=foo -DSLANG_REVISION=bar.

If you'd like to see something changed upstream to make packaging easier feel free to make suggestions.

@Emin017
Copy link
Member

Emin017 commented Jan 5, 2026

And I also noticed that yosys-slang/GitRevision appears to retrieve the revision via Git, but the packaging approach in this PR does not currently support that. It would be great if this could be supported.

Is the issue that fetchFromGithub is not a git checkout per se and does not populate .git? Version information can also be supplied to cmake with -DYOSYS_SLANG_REVISION=foo -DSLANG_REVISION=bar.

If you'd like to see something changed upstream to make packaging easier feel free to make suggestions.

@povik I think this can be addressed by setting leaveDotGit = true in fetchFromGithub, which would preserve the .git directory (Sorry, I forgot about this option earlier). With that in place, we wouldn’t need to make any changes upstream.

@povik
Copy link
Contributor

povik commented Jan 5, 2026

Sounds good

@luciengaitskell luciengaitskell force-pushed the yosys-slang branch 4 times, most recently from eb57f82 to c0bf17a Compare January 10, 2026 19:59
@luciengaitskell
Copy link
Author

@Emin017 added leaveDotGit = true

@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 10, 2026
Copy link
Member

@Emin017 Emin017 left a comment

Choose a reason for hiding this comment

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

Perhaps yosys-slang could also be added to Yosys’s allPlugins attribute set:

allPlugins = {
bluespec = yosys-bluespec;
ghdl = yosys-ghdl;
}

@luciengaitskell
Copy link
Author

Rebased from master

@nixpkgs-ci nixpkgs-ci bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Jan 11, 2026
@luciengaitskell
Copy link
Author

@Emin017

Perhaps yosys-slang could also be added to Yosys’s allPlugins attribute set:

Happy to add it (just did). I was cautious because synlig, the existing SystemVerilog plugin, isn't in that list.

@luciengaitskell
Copy link
Author

Bump to latest povik/yosys-slang@64b4461

@Emin017
Copy link
Member

Emin017 commented Jan 11, 2026

@Emin017

Perhaps yosys-slang could also be added to Yosys’s allPlugins attribute set:

Happy to add it (just did). I was cautious because synlig, the existing SystemVerilog plugin, isn't in that list.

@luciengaitskell #473242

@Emin017
Copy link
Member

Emin017 commented Jan 11, 2026

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 472800
Commit: 5e848add09d52da4f967d435e866c6335694c62f (subsequent changes)
Merge: d98524b88c8c31cab99166c1232c23f013fa7f04

Logs: https://github.com/Emin017/nixpkgs-review-gha/actions/runs/20895283307


x86_64-linux

❌ 1 package failed to build:
  • yosys-slang

aarch64-linux

❌ 1 package failed to build:
  • yosys-slang

aarch64-darwin (sandbox = true)

❌ 1 package failed to build:
  • yosys-slang

Copy link
Member

Choose a reason for hiding this comment

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

Still got hash mismatch:

Total 130 (delta 6), reused 123 (delta 0), pack-reused 0 (from 0)
Enumerating objects: 130, done.
Nothing new to pack.
error: hash mismatch in fixed-output derivation '/nix/store/pwlipqm4ykbd7zr3cly26xf5f0r8d78b-source.drv':
         specified: sha256-kfu59/M3+IM+5ZMd+Oy4IZf4JWuVtPDlkHprk0FB8t4=
            got:    sha256-5y1fQLXLUv9R98CVezYvPpxRSzJyeAKh8g++yTZVlgQ=
error: Cannot build '/nix/store/h1a9ivy7wqqzq67kqh5b2x7v97r0dw5h-yosys-slang-0-unstable-2025-12-15.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/248c0xdrwgihwj3qxvp32jcj1spvdkxy-yosys-slang-0-unstable-2025-12-15

https://github.com/NixOS/nixpkgs/pull/472800/checks?check_run_id=60026979158

Copy link
Member

@Emin017 Emin017 Jan 11, 2026

Choose a reason for hiding this comment

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

It looks like we’re running into some non-reproducible behavior — the hash values differ across machines in CI. https://github.com/Emin017/nixpkgs-review-gha/actions/runs/20895283307

Copy link
Member

@Emin017 Emin017 Jan 11, 2026

Choose a reason for hiding this comment

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

In yosys-slang, cmake/GitRevision.cmake runs git -C <dir> rev-parse HEAD to retrieve the commit IDs of both the main repository and third_party/slang. These values are used in src/CMakeLists.txt to generate version.h, which causes the hash of the build outputs to differ on every build.

I think we can remove the leaveDotGit = true option for now, so that the version information becomes unknown(But this can fix hash mismatch). After that, we may need to make some changes upstream to fix this generation issue properly.

@luciengaitskell Could you try removing the leaveDotGit = true option first?

Copy link
Author

Choose a reason for hiding this comment

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

@Emin017 I removed the leaveDotGit = true and set the YOSYS_SLANG_REVISION directly from the yosys-slang revision that we choose to fetch from GitHub.

However, the SLANG_REVISION would need to be determined based on the submodule, which I don't think I can get access to. @povik any ideas how we can get around this?

https://github.com/povik/yosys-slang/blob/64b44616a3798f07453b14ea03e4ac8a16b77313/src/CMakeLists.txt#L4-L5

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest setting "SLANG_REVISION=unknown" for now. The only purpose of the version variables is to print the version to the user if they ask. In theory one can always find what the submodule version was from the yosys-slang revision.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see you are already setting it to unknown. I think that's fine.

@Emin017 Emin017 mentioned this pull request Jan 16, 2026
@nixpkgs-ci nixpkgs-ci bot added the 8.has: package (new) This PR adds a new package label Jan 27, 2026
@luciengaitskell luciengaitskell force-pushed the yosys-slang branch 2 times, most recently from 8e809ab to ca57176 Compare January 31, 2026 22:30
@luciengaitskell
Copy link
Author

Bump to latest povik/yosys-slang@4e1ad7c

@Emin017
Copy link
Member

Emin017 commented Feb 1, 2026

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 472800
Commit: ca571768fd58633b8400c227080dad000f8cbc53 (subsequent changes)
Merge: f93460ddf76ca4369cd52238bdf5b6ab175138f3

Logs: https://github.com/Emin017/nixpkgs-review-gha/actions/runs/21558626213


x86_64-linux

❌ 1 package failed to build:
  • yosys-slang

aarch64-linux

❌ 1 package failed to build:
  • yosys-slang

x86_64-darwin

No rebuilds


aarch64-darwin (sandbox = relaxed)

❌ 1 package failed to build:
  • yosys-slang

Copy link
Member

@Emin017 Emin017 left a comment

Choose a reason for hiding this comment

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

The non-reproducible behavior has been fixed. We just need to update the hash and clean up some dead code.

@luciengaitskell
Copy link
Author

Rebased from master

@Emin017
Copy link
Member

Emin017 commented Feb 1, 2026

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 472800
Commit: ca86215dbdf6ff26bd47b4fe5cdfc9967f870f65 (subsequent changes)
Merge: fd3863171a82fec7fa815f3497b7ae6892f10922

Logs: https://github.com/Emin017/nixpkgs-review-gha/actions/runs/21564372680


x86_64-linux

✅ 1 package built:
  • yosys-slang

aarch64-linux

✅ 1 package built:
  • yosys-slang

x86_64-darwin

No rebuilds


aarch64-darwin (sandbox = relaxed)

✅ 1 package built:
  • yosys-slang

Copy link
Member

@Emin017 Emin017 left a comment

Choose a reason for hiding this comment

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

Approved automatically following the successful run of nixpkgs-review.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: package (new) This PR adds a new package 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. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants