Skip to content

Commit 22111da

Browse files
donnmole99
andauthored
chore: update yosys (+ plugins) to 0.60 (#42)
Signed-off-by: Leo Moser <[email protected]> Co-authored-by: Leo Moser <[email protected]>
1 parent 2a8043b commit 22111da

File tree

8 files changed

+45
-19
lines changed

8 files changed

+45
-19
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,34 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
os:
12-
[
11+
os: [
1312
{
1413
name: "Ubuntu 24.04",
1514
family: "linux",
1615
runner: "ubuntu-24.04",
1716
archs: "x86_64",
17+
nix_double: "x86_64-linux",
1818
},
1919
{
2020
name: "Ubuntu 22.04",
2121
family: "linux",
2222
runner: "ubuntu-22.04-arm",
2323
archs: "aarch64",
24+
nix_double: "aarch64-linux",
2425
},
2526
{
2627
name: "macOS 15",
2728
family: "macos",
28-
runner: "macos-15-intel",
29+
runner: "macos-15", # with rosetta
2930
archs: "x86_64",
31+
nix_double: "x86_64-darwin",
3032
},
3133
{
3234
name: "macOS 15",
3335
family: "macos",
3436
runner: "macos-15",
3537
archs: "arm64",
38+
nix_double: "aarch64-darwin",
3639
},
3740
]
3841
name: Nix Builds | ${{ matrix.os.name }} | ${{ matrix.os.archs }}
@@ -48,7 +51,7 @@ jobs:
4851
- id: enumerate_packages
4952
name: Get all packages
5053
run: |
51-
echo "FLAKE_OUTPUTS=$(python3 ./.github/workflows/get_all_packages.py | tr '\n' ' ')" >> $GITHUB_ENV
54+
echo "FLAKE_OUTPUTS=$(python3 ./.github/workflows/get_all_packages.py ${{ matrix.os.nix_double }} | tr '\n' ' ')" >> $GITHUB_ENV
5255
- name: Build All
5356
run: |
5457
set +e

.github/workflows/get_all_packages.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ def run(purpose, *args):
1717
exit(-1)
1818
return process.stdout
1919

20+
system = tuple()
21+
if len(sys.argv) > 1:
22+
system = ("--system", sys.argv[1])
2023

21-
flake_meta = json.load(run("get flake metadata", "nix", "flake", "show", "--json"))
24+
flake_meta = json.load(run("get flake metadata", "nix", "flake", "show", *system, "--json"))
2225
packages = flake_meta["packages"]
2326
for platform, packages in packages.items():
2427
for package, package_info in packages.items():

nix/fetch_github_snapshot.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
repo,
3131
rev,
3232
hash,
33+
add-gitcommit ? false,
3334
}:
3435
stdenvNoCC.mkDerivation {
3536
name = "github-${repo}-${rev}-snapshot";
@@ -45,7 +46,7 @@ stdenvNoCC.mkDerivation {
4546
phases = [ "installPhase" ];
4647
installPhase = ''
4748
python3 ${./supporting/download_github_snapshot.py} \
48-
--out-dir $out \
49+
${lib.optionalString add-gitcommit "--add-gitcommit"} --out-dir $out \
4950
https://github.com/${owner}/${repo} \
5051
${rev}
5152
'';

nix/supporting/download_github_snapshot.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,13 @@ def extract_tarball(tarball_path: str, extract_to: str):
130130
tar.extract(member, path=extract_to, filter="tar")
131131

132132

133-
def fetch_tarball_and_submodules(repo_url, commit, base_path=None, filter="."):
133+
def fetch_tarball_and_submodules(
134+
repo_url,
135+
commit,
136+
base_path=None,
137+
filter=".",
138+
add_gitcommit=False,
139+
):
134140
if base_path is None:
135141
base_path = urllib.parse.urlsplit(repo_url).path.split("/")[-1]
136142
key = (repo_url, commit)
@@ -155,6 +161,10 @@ def fetch_tarball_and_submodules(repo_url, commit, base_path=None, filter="."):
155161
tree_resp.raise_for_status()
156162
tree_data = tree_resp.json()
157163

164+
if add_gitcommit:
165+
with open(os.path.join(base_path, ".gitcommit"), "w") as f:
166+
f.write(tree_data["sha"])
167+
158168
submodules = {
159169
item["path"]: item["sha"]
160170
for item in tree_data.get("tree", [])
@@ -215,6 +225,7 @@ def fetch_tarball_and_submodules(repo_url, commit, base_path=None, filter="."):
215225
commit=sha,
216226
base_path=sub_path,
217227
filter=filter,
228+
add_gitcommit=add_gitcommit,
218229
)
219230

220231
with open(
@@ -238,9 +249,15 @@ def fetch_tarball_and_submodules(repo_url, commit, base_path=None, filter="."):
238249
default=".",
239250
help="Regex to match submodule paths. Submodules that are not matched will be excluded.",
240251
)
252+
@click.option(
253+
"--add-gitcommit",
254+
default=False,
255+
is_flag=True,
256+
help="Adds a .gitcommit file containing the commit sha256 of each resolved tree",
257+
)
241258
@click.argument("repo_url")
242259
@click.argument("commit")
243-
def main(repo_url, commit, out_dir, filter):
260+
def main(repo_url, commit, out_dir, filter, add_gitcommit):
244261
"""
245262
Downloads a snapshot of a GitHub repo, i.e. with all GitHub-based submodules
246263
recursively downloaded.
@@ -254,6 +271,7 @@ def main(repo_url, commit, out_dir, filter):
254271
commit=commit,
255272
base_path=out_dir,
256273
filter=filter,
274+
add_gitcommit=add_gitcommit,
257275
)
258276

259277

nix/yosys-eqy.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
yosys-sby,
3131
python3,
3232
makeBinaryWrapper,
33-
version ? "0.59",
34-
sha256 ? "sha256-dDDU3ld4e3CcqLzCwcV+AU2C8ZNFStRLpqlD3fIfdMw=",
33+
version ? "0.60",
34+
sha256 ? "sha256-XSN7Flw6uU0SEhAX5pMWIsxxZaBKBjyjR+JKUwdSxw4=",
3535
}:
3636
yosys.stdenv.mkDerivation (finalAttrs: {
3737
pname = "yosys-eqy";

nix/yosys-sby.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
boolector,
2929
z3,
3030
yices,
31-
version ? "0.59",
32-
sha256 ? "sha256-WNJ390nN2+vjWGIc842e/5CX2wKI/cyo+NnuCfbHSbQ=",
31+
version ? "0.60",
32+
sha256 ? "sha256-REK5ZS5iExSlqNazdUCXVJzaXtkPxJweyXro3azrC/8=",
3333
}:
3434
yosys.stdenv.mkDerivation (finalAttrs: {
3535
pname = "yosys-sby";

nix/yosys-slang.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
cmake,
2727
fmt,
2828
jq,
29-
rev ? "76b83eb5b73ba871797e6db7bc5fed10af380be4",
30-
rev-date ? "2025-06-20",
31-
hash ? "sha256-XqBnrwH1C+oxfbIFFUS1s8Ujbcr1VDWHq8FVyL9iGOI=",
29+
rev ? "d4053e825408a25dc2c065cd430b4cc5e71b1b6c",
30+
rev-date ? "2025-12-08",
31+
hash ? "sha256-lSulYjGoW3ngRwKgQg8KdzWanrMos/w2NeqpFr+kkI4=",
3232
}:
3333
clang18Stdenv.mkDerivation {
3434
name = "yosys-slang";

nix/yosys.nix

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
fetchurl,
4040
fetchGitHubSnapshot,
4141
bash,
42-
version ? "0.59.1",
42+
version ? "0.60",
4343
rev ? null,
44-
sha256 ? "sha256-XUQu07i6kBR745OZU/UQTwGbRt/uZHKpBNRrcUP87Bo=",
44+
sha256 ? "sha256-JKxNdc3AXE1IaodM5eg0t3PkkGsnIwFpIbN9Gj56G/k=",
4545
darwin, # To fix codesigning issue for pyosys
4646
# For environments
4747
yosys,
@@ -78,6 +78,7 @@ let
7878
repo = "yosys";
7979
inherit rev;
8080
hash = sha256;
81+
add-gitcommit = true;
8182
}
8283
else
8384
fetchurl {
@@ -152,14 +153,14 @@ let
152153
unpackPhase = ''
153154
runHook preUnpack
154155
if [ -d ${finalAttrs.src} ]; then
155-
cp -r ${finalAttrs.src}/* .
156+
cp -r ${finalAttrs.src}/* ${finalAttrs.src}/.* .
156157
chmod u+w -R .
157158
else
158159
tar -xzC . -f ${finalAttrs.src}
159160
fi
160161
runHook postUnpack
161162
'';
162-
163+
163164
configurePhase = ''
164165
runHook preConfigure
165166
CC=clang CXX=clang++ make config-clang

0 commit comments

Comments
 (0)