Skip to content

Commit 47709e3

Browse files
rslawsonpr2502
andcommitted
Removing hardcoded hashes from Nix flake.
Co-authored-by: max <[email protected]> Signed-off-by: Ryan Slawson <[email protected]>
1 parent 3e3e4f4 commit 47709e3

File tree

4 files changed

+204
-69
lines changed

4 files changed

+204
-69
lines changed

.github/workflows/github-actions-cron-update-OR.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,28 @@ jobs:
2323
git checkout master
2424
git pull
2525
- if: "steps.remote-update.outputs.has_update != ''"
26-
name: Create Draft PR
27-
uses: peter-evans/create-pull-request@v7
28-
with:
29-
token: ${{ github.token }}
30-
signoff: true
31-
delete-branch: true
32-
title: 'Update OpenROAD submodule'
33-
body: |
34-
Automated action to update tools/OpenROAD submodule and tighten CI rule checking.
35-
[ci:rules-tighten]
36-
labels: UpdateRules
37-
reviewers: |
38-
vvbandeira
39-
maliberty
40-
draft: true
41-
branch: update-openroad
42-
commit-message: |
43-
[BOT] Update OpenROAD submodule
26+
steps:
27+
- name: Install Nix
28+
uses: cachix/install-nix-action@v31
29+
with:
30+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
31+
- name: Update flake.lock
32+
run: nix --extra-experimental-features "nix-command flakes" flake update openroad-abc-src openroad-opensta-src openroad-flake
33+
- name: Create Draft PR
34+
uses: peter-evans/create-pull-request@v7
35+
with:
36+
token: ${{ github.token }}
37+
signoff: true
38+
delete-branch: true
39+
title: 'Update OpenROAD submodule'
40+
body: |
41+
Automated action to update tools/OpenROAD submodule and tighten CI rule checking.
42+
[ci:rules-tighten]
43+
labels: UpdateRules
44+
reviewers: |
45+
vvbandeira
46+
maliberty
47+
draft: true
48+
branch: update-openroad
49+
commit-message: |
50+
[BOT] Update OpenROAD submodule

.github/workflows/github-actions-cron-update-yosys.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,23 @@ jobs:
2727
echo "::set-output name=has_update::$(git --no-pager diff --name-only ${latesttag}..HEAD)"
2828
git checkout ${latesttag}
2929
- if: "steps.remote-update.outputs.has_update != ''"
30-
name: Create Draft PR
31-
uses: peter-evans/create-pull-request@v6
32-
with:
33-
token: ${{ github.token }}
34-
signoff: true
35-
delete-branch: true
36-
title: 'Update yosys submodule'
37-
reviewers: |
38-
habibayassin
39-
draft: true
40-
branch: update-yosys
41-
commit-message: |
42-
[BOT] Update yosys submodule
30+
steps:
31+
- name: Install Nix
32+
uses: cachix/install-nix-action@v31
33+
with:
34+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
35+
- name: Update flake.lock
36+
run: nix --extra-experimental-features "nix-command flakes" flake update yosys-abc-src yosys-cxxopts-src yosys-flake
37+
- name: Create Draft PR
38+
uses: peter-evans/create-pull-request@v6
39+
with:
40+
token: ${{ github.token }}
41+
signoff: true
42+
delete-branch: true
43+
title: 'Update yosys submodule'
44+
reviewers: |
45+
habibayassin
46+
draft: true
47+
branch: update-yosys
48+
commit-message: |
49+
[BOT] Update yosys submodule

flake.lock

Lines changed: 80 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 79 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,90 @@
22
inputs = {
33
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
44
flake-utils.url = "github:numtide/flake-utils";
5-
openroad = {
6-
type = "git";
7-
url = "https://github.com/The-OpenROAD-Project/OpenROAD";
8-
submodules = true;
9-
rev = "ec1bf1a13902813b722f8341c432cd09714d9e55";
5+
openroad-abc-src = {
6+
url = "git+file:tools/OpenROAD/third-party/abc";
7+
flake = false;
108
};
11-
yosys = {
12-
type = "git";
13-
url = "https://github.com/The-OpenROAD-Project/yosys";
14-
submodules = true;
15-
rev = "c4b5190229616f7ebf8197f43990b4429de3e420";
9+
openroad-opensta-src = {
10+
url = "git+file:tools/OpenROAD/src/sta";
11+
flake = false;
12+
};
13+
openroad-flake = {
14+
url = "git+file:tools/OpenROAD";
15+
flake = true;
16+
};
17+
yosys-abc-src = {
18+
url = "git+file:tools/yosys/abc";
19+
flake = false;
20+
};
21+
yosys-cxxopts-src = {
22+
url = "git+file:tools/yosys/libs/cxxopts";
23+
flake = false;
24+
};
25+
yosys-flake = {
26+
url = "git+file:tools/yosys";
27+
flake = true;
1628
};
1729
};
18-
outputs = { self, nixpkgs, flake-utils, openroad, yosys }: flake-utils.lib.eachDefaultSystem (
30+
outputs = {
31+
self,
32+
nixpkgs,
33+
flake-utils,
34+
openroad-abc-src,
35+
openroad-opensta-src,
36+
openroad-flake,
37+
yosys-abc-src,
38+
yosys-cxxopts-src,
39+
yosys-flake,
40+
}: flake-utils.lib.eachDefaultSystem (
1941
system:
2042
let
2143
pkgs = nixpkgs.legacyPackages.${system};
22-
in {
44+
openroad = (openroad-flake.packages.${system}.default.overrideAttrs (previousAttrs: {
45+
prePatch = builtins.concatStringsSep "\n" [
46+
(''
47+
cp -r --preserve=mode ${openroad-opensta-src} src/sta
48+
chmod -R +w src/sta
49+
cp -r --preserve=mode ${openroad-abc-src} third-party/abc
50+
chmod -R +w third-party/abc
51+
'')
52+
(previousAttrs.prePatch or "")
53+
];
54+
}));
55+
yosys-abc = pkgs.stdenv.mkDerivation {
56+
name = "yosys-abc";
57+
src = "${yosys-abc-src}";
58+
nativeBuildInputs = [ pkgs.cmake ];
59+
buildInputs = [ pkgs.readline ];
60+
installPhase = ''
61+
runHook preInstall
62+
install -Dm755 'abc' "$out/bin/abc"
63+
install -Dm444 'libabc.a' "$out/lib/libabc.a"
64+
runHook postInstall
65+
'';
66+
buildPhase = ''
67+
make ABC_USE_PIC=1 abc libabc.a
68+
'';
69+
};
70+
yosys = (yosys-flake.packages.${system}.default.overrideAttrs (previousAttrs: {
71+
prePatch = builtins.concatStringsSep "\n" [
72+
(''
73+
cp -r --preserve=mode ${yosys-cxxopts-src} libs/cxxopts
74+
chmod -R +w libs/cxxopts
75+
'')
76+
(previousAttrs.prePatch or "")
77+
];
78+
installPhase = ''
79+
make install PREFIX=$out ABCEXTERNAL=yosys-abc
80+
ln -s ${yosys-abc}/bin/abc $out/bin/yosys-abc
81+
'';
82+
}));
83+
in {
2384
devShells.default = pkgs.mkShell {
2485
buildInputs = [
25-
openroad.packages.${system}.default
26-
yosys.packages.${system}.default
86+
openroad
87+
yosys-abc
88+
yosys
2789
pkgs.time
2890
pkgs.klayout
2991
pkgs.verilator
@@ -37,6 +99,9 @@
3799
pkgs.python3Packages.yamlfix
38100
];
39101
};
102+
packages.openroad = openroad;
103+
packages.yosys-abc = yosys-abc;
104+
packages.yosys = yosys;
40105
}
41106
);
42107
}

0 commit comments

Comments
 (0)