Skip to content

Commit

Permalink
Foundry/forge+solc nix fixes (#2008)
Browse files Browse the repository at this point in the history
* Fix solc version

* cleanup

* Set Version: 1.0.251

* switch to patched version of solc.nix

* switched back to github:hellwolf/solc.nix

* Set Version: 1.0.252

---------

Co-authored-by: devops <[email protected]>
Co-authored-by: Everett Hildenbrandt <[email protected]>
  • Loading branch information
3 people authored Aug 11, 2023
1 parent 5672e27 commit 5cda4c7
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 301 deletions.
39 changes: 38 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 15 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@
pyk.inputs.flake-utils.follows = "k-framework/flake-utils";
pyk.inputs.nixpkgs.follows = "k-framework/nixpkgs";
foundry.url = "github:shazow/foundry.nix/monthly"; # Use monthly branch for permanent releases
solc = {
url = "github:hellwolf/solc.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, k-framework, haskell-backend, nixpkgs, flake-utils
, poetry2nix, blockchain-k-plugin, ethereum-tests, ethereum-legacytests
, rv-utils, pyk, foundry }:
, rv-utils, pyk, foundry, solc }:
let
nixLibs = pkgs:
with pkgs;
Expand All @@ -47,7 +51,7 @@
procps
protobuf
python310
solc
(solc.mkDefault pkgs solc_0_8_13)
time
] ++ lib.optional (!stdenv.isDarwin) elfutils;

Expand Down Expand Up @@ -109,7 +113,7 @@
mkdir -p $out
mv .build/usr/* $out/
wrapProgram $out/bin/kevm --prefix PATH : ${
prev.lib.makeBinPath [ final.solc prev.which k ]
prev.lib.makeBinPath [ (solc.mkDefault final final.solc_0_8_13) final.foundry-bin prev.which k ]
} --set NIX_LIBS "${nixLibs prev}"
ln -s ${k} $out/lib/kevm/kframework
Expand All @@ -125,7 +129,7 @@

enableParallelBuilding = true;

buildInputs = [ (final.kevm k) prev.which prev.git prev.foundry-bin prev.solc ];
buildInputs = [ (final.kevm k) prev.which prev.git ];

buildPhase = ''
mkdir -p tests/ethereum-tests/LegacyTests
Expand All @@ -148,6 +152,12 @@
kevm-pyk = prev.poetry2nix.mkPoetryApplication {
python = prev.python310;
projectDir = ./kevm-pyk;

postPatch = ''
substituteInPlace ./src/kevm_pyk/foundry.py \
--replace "'forge', 'build'," "'forge', 'build', '--no-auto-detect',"
'';

overrides = prev.poetry2nix.overrides.withDefaults
(finalPython: prevPython: { pyk = prev.pyk-python310; });
groups = [ ];
Expand All @@ -167,15 +177,12 @@
inherit system;
overlays = [
(final: prev: { llvm-backend-release = false; })
(final: prev: {
# https://github.com/NixOS/nixpkgs/pull/219240
solc = prev.callPackage ./nix/solc/default.nix { };
})
k-framework.overlay
blockchain-k-plugin.overlay
poetry2nix.overlay
pyk.overlay
foundry.overlay
solc.overlay
overlay
];
};
Expand Down
2 changes: 1 addition & 1 deletion kevm-pyk/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "kevm-pyk"
version = "1.0.251"
version = "1.0.252"
description = ""
authors = [
"Runtime Verification, Inc. <[email protected]>",
Expand Down
138 changes: 0 additions & 138 deletions nix/solc/default.nix

This file was deleted.

14 changes: 0 additions & 14 deletions nix/solc/tests.patch

This file was deleted.

2 changes: 1 addition & 1 deletion package/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
kevm (1.0.251) unstable; urgency=medium
kevm (1.0.252) unstable; urgency=medium

* Initial Release.

Expand Down
Loading

0 comments on commit 5cda4c7

Please sign in to comment.