Skip to content

Commit e80eeae

Browse files
committed
yosys: 2020.10.20 -> 0.9+3675 (new version scheme)
Yosys now has their own official scheme for tagging unstable builds; an automation robot appears from the darkness once every few hours, bumps the version number, and disappears as silently as they came. While Nix packages use a date-based version format for unstable packages, many (most!) users of Yosys use an unstable version. And so synchronizing the version of the Nix package with the repository version is significantly less confusing to users. This also adds a safeguard to ensure others don't forget to bump the version number correctly in the future. The testsuite also saw an overhaul (now parallel to help build time), so some tweaks were needed to get it working again. Signed-off-by: Austin Seipp <aseipp@pobox.com>
1 parent 58a906a commit e80eeae

1 file changed

Lines changed: 31 additions & 8 deletions

File tree

pkgs/development/compilers/yosys/default.nix

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,32 @@
1414
, zlib
1515
}:
1616

17+
# NOTE: as of late 2020, yosys has switched to an automation robot that
18+
# automatically tags their repository Makefile with a new build number every
19+
# day when changes are committed. please MAKE SURE that the version number in
20+
# the 'version' field exactly matches the YOSYS_VER field in the Yosys
21+
# makefile!
22+
#
23+
# if a change in yosys isn't yet available under a build number like this (i.e.
24+
# it was very recently merged, within an hour), wait a few hours for the
25+
# automation robot to tag the new version, like so:
26+
#
27+
# https://github.com/YosysHQ/yosys/commit/71ca9a825309635511b64b3ec40e5e5e9b6ad49b
28+
#
29+
# note that while most nix packages for "unstable versions" use a date-based
30+
# version scheme, synchronizing the nix package version here with the unstable
31+
# yosys version number helps users report better bugs upstream, and is
32+
# ultimately less confusing than using dates.
33+
1734
stdenv.mkDerivation rec {
1835
pname = "yosys";
19-
version = "2020.10.20";
36+
version = "0.9+3675";
2037

2138
src = fetchFromGitHub {
2239
owner = "YosysHQ";
2340
repo = "yosys";
24-
rev = "06347b119b08257eff37cdd10ed802e794c1a3cf";
25-
sha256 = "07058r8095192gwkiy2yyvj9vxv09fcw9bqi2b39wn85lh5kx2k2";
41+
rev = "71ca9a825309635511b64b3ec40e5e5e9b6ad49b";
42+
sha256 = "03jlhfvm5rxx8yybf94nqd3ld2y6brp8r0k6gfi56chv3iqqavy3";
2643
};
2744

2845
enableParallelBuilding = true;
@@ -55,11 +72,17 @@ stdenv.mkDerivation rec {
5572
(cd misc && ${protobuf}/bin/protoc --cpp_out ../backends/protobuf/ ./yosys.proto)
5673
5774
if ! grep -q "ABCREV = ${shortAbcRev}" Makefile; then
58-
echo "yosys isn't compatible with the provided abc (${shortAbcRev}), failing."
75+
echo "ERROR: yosys isn't compatible with the provided abc (${shortAbcRev}), failing."
76+
exit 1
77+
fi
78+
79+
if ! grep -q "YOSYS_VER := ${version}" Makefile; then
80+
echo "ERROR: yosys version in Makefile isn't equivalent to version of the nix package (${version}), failing."
5981
exit 1
6082
fi
6183
'';
6284

85+
checkTarget = "test";
6386
doCheck = true;
6487
checkInputs = [ verilog ];
6588

@@ -68,10 +91,10 @@ stdenv.mkDerivation rec {
6891
# they just assume that 'yosys-abc' is available -- but it's not installed
6992
# when using ABCEXTERNAL
7093
#
71-
# add a symlink to fake things so that both variants work the same way.
72-
postInstall = ''
73-
ln -sfv ${abc-verifier}/bin/abc $out/bin/yosys-abc
74-
'';
94+
# add a symlink to fake things so that both variants work the same way. this
95+
# is also needed at build time for the test suite.
96+
postBuild = "ln -sfv ${abc-verifier}/bin/abc ./yosys-abc";
97+
postInstall = "ln -sfv ${abc-verifier}/bin/abc $out/bin/yosys-abc";
7598

7699
meta = with stdenv.lib; {
77100
description = "Open RTL synthesis framework and tools";

0 commit comments

Comments
 (0)