From 3f0de7d77889e5ed2999f45c06039ec2dd152c5f Mon Sep 17 00:00:00 2001 From: Samuel Balco Date: Tue, 3 Sep 2024 09:01:55 +0100 Subject: [PATCH] Set up `ksoroban`/`komet` binary via kup/nix (#30) * Make flake functional, based on kasmer-multiversx repo * add dev shell containing cargo/rust with wasm target and the stellar-cli package * Set Version: 0.1.23 * paassing filtered source to poetry mkPython causes infinite recursion on newer versions of nix, hence passing unfitered source as it will be filtered by poetry2nix anyway --------- Co-authored-by: devops --- flake.lock | 1126 +++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 195 +++++++- package/version | 2 +- pyproject.toml | 2 +- 4 files changed, 1303 insertions(+), 22 deletions(-) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..473b628 --- /dev/null +++ b/flake.lock @@ -0,0 +1,1126 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_7" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "fmt-src": { + "flake": false, + "locked": { + "lastModified": 1661615830, + "narHash": "sha256-rP6ymyRc7LnKxUXwPpzhHOQvpJkpnRFOt2ctvUNlYI0=", + "owner": "fmtlib", + "repo": "fmt", + "rev": "a33701196adfad74917046096bf5a2aa0ab0bb50", + "type": "github" + }, + "original": { + "owner": "fmtlib", + "ref": "9.1.0", + "repo": "fmt", + "type": "github" + } + }, + "fmt-src_2": { + "flake": false, + "locked": { + "lastModified": 1661615830, + "narHash": "sha256-rP6ymyRc7LnKxUXwPpzhHOQvpJkpnRFOt2ctvUNlYI0=", + "owner": "fmtlib", + "repo": "fmt", + "rev": "a33701196adfad74917046096bf5a2aa0ab0bb50", + "type": "github" + }, + "original": { + "owner": "fmtlib", + "ref": "9.1.0", + "repo": "fmt", + "type": "github" + } + }, + "haskell-backend": { + "inputs": { + "nixpkgs": [ + "k-framework", + "llvm-backend", + "nixpkgs" + ], + "rv-utils": [ + "k-framework", + "llvm-backend", + "rv-utils" + ], + "stacklock2nix": "stacklock2nix", + "z3": "z3" + }, + "locked": { + "lastModified": 1722860063, + "narHash": "sha256-5K3BIIbwkMpN4idvAHRrw0JzHRL6Au4ui+7NqkX+c3w=", + "owner": "runtimeverification", + "repo": "haskell-backend", + "rev": "7047b0964349727e54425c2c81478caf3dad757c", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "ref": "v0.1.58", + "repo": "haskell-backend", + "type": "github" + } + }, + "haskell-backend_2": { + "inputs": { + "nixpkgs": [ + "wasm-semantics", + "k-framework", + "llvm-backend", + "nixpkgs" + ], + "rv-utils": [ + "wasm-semantics", + "k-framework", + "llvm-backend", + "rv-utils" + ], + "stacklock2nix": "stacklock2nix_2", + "z3": "z3_2" + }, + "locked": { + "lastModified": 1722860063, + "narHash": "sha256-5K3BIIbwkMpN4idvAHRrw0JzHRL6Au4ui+7NqkX+c3w=", + "owner": "runtimeverification", + "repo": "haskell-backend", + "rev": "7047b0964349727e54425c2c81478caf3dad757c", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "ref": "v0.1.58", + "repo": "haskell-backend", + "type": "github" + } + }, + "immer-src": { + "flake": false, + "locked": { + "lastModified": 1708038459, + "narHash": "sha256-aV/mQFuPzioy1PxROc85ypeP7/d0nn+xcBPzy9taw2s=", + "owner": "runtimeverification", + "repo": "immer", + "rev": "4b0914f0b2acb33befe0ba4cd3a7954f2687e9bb", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "repo": "immer", + "rev": "4b0914f0b2acb33befe0ba4cd3a7954f2687e9bb", + "type": "github" + } + }, + "immer-src_2": { + "flake": false, + "locked": { + "lastModified": 1708038459, + "narHash": "sha256-aV/mQFuPzioy1PxROc85ypeP7/d0nn+xcBPzy9taw2s=", + "owner": "runtimeverification", + "repo": "immer", + "rev": "4b0914f0b2acb33befe0ba4cd3a7954f2687e9bb", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "repo": "immer", + "rev": "4b0914f0b2acb33befe0ba4cd3a7954f2687e9bb", + "type": "github" + } + }, + "k-framework": { + "inputs": { + "flake-utils": [ + "k-framework", + "llvm-backend", + "utils" + ], + "haskell-backend": "haskell-backend", + "llvm-backend": "llvm-backend", + "nixpkgs": [ + "k-framework", + "llvm-backend", + "nixpkgs" + ], + "poetry2nix": "poetry2nix", + "rv-utils": [ + "k-framework", + "llvm-backend", + "rv-utils" + ] + }, + "locked": { + "lastModified": 1723222636, + "narHash": "sha256-V4rRuc7QN7rbtFS6d76kM0AZJJJp8vsXqXYz5nQebIk=", + "owner": "runtimeverification", + "repo": "k", + "rev": "0643095937a08f26e94d58cd8c2651ab1b0b4a07", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "ref": "v7.1.103", + "repo": "k", + "type": "github" + } + }, + "k-framework_2": { + "inputs": { + "flake-utils": [ + "wasm-semantics", + "k-framework", + "llvm-backend", + "utils" + ], + "haskell-backend": "haskell-backend_2", + "llvm-backend": "llvm-backend_2", + "nixpkgs": [ + "wasm-semantics", + "k-framework", + "llvm-backend", + "nixpkgs" + ], + "poetry2nix": "poetry2nix_3", + "rv-utils": [ + "wasm-semantics", + "k-framework", + "llvm-backend", + "rv-utils" + ] + }, + "locked": { + "lastModified": 1723222636, + "narHash": "sha256-V4rRuc7QN7rbtFS6d76kM0AZJJJp8vsXqXYz5nQebIk=", + "owner": "runtimeverification", + "repo": "k", + "rev": "0643095937a08f26e94d58cd8c2651ab1b0b4a07", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "ref": "v7.1.103", + "repo": "k", + "type": "github" + } + }, + "llvm-backend": { + "inputs": { + "flake-compat": "flake-compat", + "fmt-src": "fmt-src", + "immer-src": "immer-src", + "nixpkgs": [ + "k-framework", + "llvm-backend", + "rv-utils", + "nixpkgs" + ], + "pybind11-src": "pybind11-src", + "rapidjson-src": "rapidjson-src", + "rv-utils": "rv-utils", + "utils": "utils" + }, + "locked": { + "lastModified": 1723094785, + "narHash": "sha256-JPe1rZkx4/q7wyEGIOitt3slEHpue5gSnT9x9tbnNMs=", + "owner": "runtimeverification", + "repo": "llvm-backend", + "rev": "e7266f7e0082b5a90ccf47ceed47ba1811bdc636", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "ref": "v0.1.77", + "repo": "llvm-backend", + "type": "github" + } + }, + "llvm-backend_2": { + "inputs": { + "flake-compat": "flake-compat_2", + "fmt-src": "fmt-src_2", + "immer-src": "immer-src_2", + "nixpkgs": [ + "wasm-semantics", + "k-framework", + "llvm-backend", + "rv-utils", + "nixpkgs" + ], + "pybind11-src": "pybind11-src_2", + "rapidjson-src": "rapidjson-src_2", + "rv-utils": "rv-utils_4", + "utils": "utils_2" + }, + "locked": { + "lastModified": 1723094785, + "narHash": "sha256-JPe1rZkx4/q7wyEGIOitt3slEHpue5gSnT9x9tbnNMs=", + "owner": "runtimeverification", + "repo": "llvm-backend", + "rev": "e7266f7e0082b5a90ccf47ceed47ba1811bdc636", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "ref": "v0.1.77", + "repo": "llvm-backend", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "k-framework", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1693660503, + "narHash": "sha256-B/g2V4v6gjirFmy+I5mwB2bCYc0l3j5scVfwgl6WOl8=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "bd5bdbb52350e145c526108f4ef192eb8e554fa0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nix-github-actions_2": { + "inputs": { + "nixpkgs": [ + "pyk", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1693660503, + "narHash": "sha256-B/g2V4v6gjirFmy+I5mwB2bCYc0l3j5scVfwgl6WOl8=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "bd5bdbb52350e145c526108f4ef192eb8e554fa0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nix-github-actions_3": { + "inputs": { + "nixpkgs": [ + "wasm-semantics", + "k-framework", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1693660503, + "narHash": "sha256-B/g2V4v6gjirFmy+I5mwB2bCYc0l3j5scVfwgl6WOl8=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "bd5bdbb52350e145c526108f4ef192eb8e554fa0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1716457947, + "narHash": "sha256-Y+exebcqeprnhEpoPJrEUZmNeO60qeOxkVHhqG/OEwQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "69493a13eaea0dc4682fd07e8a084f17813dbeeb", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "69493a13eaea0dc4682fd07e8a084f17813dbeeb", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1716457947, + "narHash": "sha256-Y+exebcqeprnhEpoPJrEUZmNeO60qeOxkVHhqG/OEwQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "69493a13eaea0dc4682fd07e8a084f17813dbeeb", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "69493a13eaea0dc4682fd07e8a084f17813dbeeb", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1718428119, + "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1716457947, + "narHash": "sha256-Y+exebcqeprnhEpoPJrEUZmNeO60qeOxkVHhqG/OEwQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "69493a13eaea0dc4682fd07e8a084f17813dbeeb", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "69493a13eaea0dc4682fd07e8a084f17813dbeeb", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1716457947, + "narHash": "sha256-Y+exebcqeprnhEpoPJrEUZmNeO60qeOxkVHhqG/OEwQ=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "69493a13eaea0dc4682fd07e8a084f17813dbeeb", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "rev": "69493a13eaea0dc4682fd07e8a084f17813dbeeb", + "type": "github" + } + }, + "poetry2nix": { + "inputs": { + "flake-utils": "flake-utils", + "nix-github-actions": "nix-github-actions", + "nixpkgs": [ + "k-framework", + "llvm-backend", + "nixpkgs" + ], + "systems": "systems_3", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1698640399, + "narHash": "sha256-mXzyx79/iFLZ0UDuSkqgFfejYRcSJfsCnJ9WlMusaI0=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "626111646fe236cb1ddc8191a48c75e072a82b7c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "626111646fe236cb1ddc8191a48c75e072a82b7c", + "type": "github" + } + }, + "poetry2nix_2": { + "inputs": { + "flake-utils": "flake-utils_2", + "nix-github-actions": "nix-github-actions_2", + "nixpkgs": [ + "pyk", + "nixpkgs" + ], + "systems": "systems_5", + "treefmt-nix": "treefmt-nix_2" + }, + "locked": { + "lastModified": 1698640399, + "narHash": "sha256-mXzyx79/iFLZ0UDuSkqgFfejYRcSJfsCnJ9WlMusaI0=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "626111646fe236cb1ddc8191a48c75e072a82b7c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "626111646fe236cb1ddc8191a48c75e072a82b7c", + "type": "github" + } + }, + "poetry2nix_3": { + "inputs": { + "flake-utils": "flake-utils_3", + "nix-github-actions": "nix-github-actions_3", + "nixpkgs": [ + "wasm-semantics", + "k-framework", + "llvm-backend", + "nixpkgs" + ], + "systems": "systems_8", + "treefmt-nix": "treefmt-nix_3" + }, + "locked": { + "lastModified": 1698640399, + "narHash": "sha256-mXzyx79/iFLZ0UDuSkqgFfejYRcSJfsCnJ9WlMusaI0=", + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "626111646fe236cb1ddc8191a48c75e072a82b7c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "poetry2nix", + "rev": "626111646fe236cb1ddc8191a48c75e072a82b7c", + "type": "github" + } + }, + "pybind11-src": { + "flake": false, + "locked": { + "lastModified": 1657936673, + "narHash": "sha256-/X8DZPFsNrKGbhjZ1GFOj17/NU6p4R+saCW3pLKVNeA=", + "owner": "pybind", + "repo": "pybind11", + "rev": "0ba639d6177659c5dc2955ac06ad7b5b0d22e05c", + "type": "github" + }, + "original": { + "owner": "pybind", + "repo": "pybind11", + "rev": "0ba639d6177659c5dc2955ac06ad7b5b0d22e05c", + "type": "github" + } + }, + "pybind11-src_2": { + "flake": false, + "locked": { + "lastModified": 1657936673, + "narHash": "sha256-/X8DZPFsNrKGbhjZ1GFOj17/NU6p4R+saCW3pLKVNeA=", + "owner": "pybind", + "repo": "pybind11", + "rev": "0ba639d6177659c5dc2955ac06ad7b5b0d22e05c", + "type": "github" + }, + "original": { + "owner": "pybind", + "repo": "pybind11", + "rev": "0ba639d6177659c5dc2955ac06ad7b5b0d22e05c", + "type": "github" + } + }, + "pyk": { + "inputs": { + "flake-utils": [ + "pyk", + "poetry2nix", + "flake-utils" + ], + "nixpkgs": [ + "pyk", + "rv-utils", + "nixpkgs" + ], + "poetry2nix": "poetry2nix_2", + "rv-utils": "rv-utils_2" + }, + "locked": { + "dir": "pyk", + "lastModified": 1723222636, + "narHash": "sha256-V4rRuc7QN7rbtFS6d76kM0AZJJJp8vsXqXYz5nQebIk=", + "owner": "runtimeverification", + "repo": "k", + "rev": "0643095937a08f26e94d58cd8c2651ab1b0b4a07", + "type": "github" + }, + "original": { + "dir": "pyk", + "owner": "runtimeverification", + "ref": "v7.1.103", + "repo": "k", + "type": "github" + } + }, + "rapidjson-src": { + "flake": false, + "locked": { + "lastModified": 1472111945, + "narHash": "sha256-SxUXSOQDZ0/3zlFI4R84J56/1fkw2jhge4mexNF6Pco=", + "owner": "Tencent", + "repo": "rapidjson", + "rev": "f54b0e47a08782a6131cc3d60f94d038fa6e0a51", + "type": "github" + }, + "original": { + "owner": "Tencent", + "repo": "rapidjson", + "rev": "f54b0e47a08782a6131cc3d60f94d038fa6e0a51", + "type": "github" + } + }, + "rapidjson-src_2": { + "flake": false, + "locked": { + "lastModified": 1472111945, + "narHash": "sha256-SxUXSOQDZ0/3zlFI4R84J56/1fkw2jhge4mexNF6Pco=", + "owner": "Tencent", + "repo": "rapidjson", + "rev": "f54b0e47a08782a6131cc3d60f94d038fa6e0a51", + "type": "github" + }, + "original": { + "owner": "Tencent", + "repo": "rapidjson", + "rev": "f54b0e47a08782a6131cc3d60f94d038fa6e0a51", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": [ + "k-framework", + "flake-utils" + ], + "k-framework": "k-framework", + "nixpkgs": [ + "k-framework", + "nixpkgs" + ], + "nixpkgs-pyk": [ + "pyk", + "nixpkgs" + ], + "poetry2nix": [ + "pyk", + "poetry2nix" + ], + "pyk": "pyk", + "rust-overlay": "rust-overlay", + "rv-utils": "rv-utils_3", + "wasm-semantics": "wasm-semantics" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1724293269, + "narHash": "sha256-x/XhOAszT/ejditCHUtGOjQcVg2AQhrC/QVew3i7kTI=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "6dc6d34a3a217457d7044dcce32b6d537480a6a1", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rv-utils": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1716459074, + "narHash": "sha256-IpahO+EkWdGl9QP7B2YXfJWpSfghjxgpz4ab47nRJY4=", + "owner": "runtimeverification", + "repo": "rv-nix-tools", + "rev": "a65058865cda201de504f5546271b8e997a0be9c", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "repo": "rv-nix-tools", + "type": "github" + } + }, + "rv-utils_2": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1716459074, + "narHash": "sha256-IpahO+EkWdGl9QP7B2YXfJWpSfghjxgpz4ab47nRJY4=", + "owner": "runtimeverification", + "repo": "rv-nix-tools", + "rev": "a65058865cda201de504f5546271b8e997a0be9c", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "repo": "rv-nix-tools", + "type": "github" + } + }, + "rv-utils_3": { + "inputs": { + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1716459074, + "narHash": "sha256-IpahO+EkWdGl9QP7B2YXfJWpSfghjxgpz4ab47nRJY4=", + "owner": "runtimeverification", + "repo": "rv-nix-tools", + "rev": "a65058865cda201de504f5546271b8e997a0be9c", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "repo": "rv-nix-tools", + "type": "github" + } + }, + "rv-utils_4": { + "inputs": { + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1716459074, + "narHash": "sha256-IpahO+EkWdGl9QP7B2YXfJWpSfghjxgpz4ab47nRJY4=", + "owner": "runtimeverification", + "repo": "rv-nix-tools", + "rev": "a65058865cda201de504f5546271b8e997a0be9c", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "repo": "rv-nix-tools", + "type": "github" + } + }, + "stacklock2nix": { + "locked": { + "lastModified": 1705051190, + "narHash": "sha256-xgH0gaD3dNtOzZzX3A40hZTiHJP5cIGmifbmfcS2OGI=", + "owner": "cdepillabout", + "repo": "stacklock2nix", + "rev": "22676dfc45fa1c33899ba1da1a23665172a18ba7", + "type": "github" + }, + "original": { + "owner": "cdepillabout", + "repo": "stacklock2nix", + "type": "github" + } + }, + "stacklock2nix_2": { + "locked": { + "lastModified": 1705051190, + "narHash": "sha256-xgH0gaD3dNtOzZzX3A40hZTiHJP5cIGmifbmfcS2OGI=", + "owner": "cdepillabout", + "repo": "stacklock2nix", + "rev": "22676dfc45fa1c33899ba1da1a23665172a18ba7", + "type": "github" + }, + "original": { + "owner": "cdepillabout", + "repo": "stacklock2nix", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "id": "systems", + "type": "indirect" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "id": "systems", + "type": "indirect" + } + }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_7": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "id": "systems", + "type": "indirect" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "k-framework", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1697388351, + "narHash": "sha256-63N2eBpKaziIy4R44vjpUu8Nz5fCJY7okKrkixvDQmY=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "aae39f64f5ecbe89792d05eacea5cb241891292a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "pyk", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1697388351, + "narHash": "sha256-63N2eBpKaziIy4R44vjpUu8Nz5fCJY7okKrkixvDQmY=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "aae39f64f5ecbe89792d05eacea5cb241891292a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "treefmt-nix_3": { + "inputs": { + "nixpkgs": [ + "wasm-semantics", + "k-framework", + "poetry2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1697388351, + "narHash": "sha256-63N2eBpKaziIy4R44vjpUu8Nz5fCJY7okKrkixvDQmY=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "aae39f64f5ecbe89792d05eacea5cb241891292a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_2": { + "inputs": { + "systems": "systems_6" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "wasm-semantics": { + "inputs": { + "flake-utils": [ + "wasm-semantics", + "k-framework", + "flake-utils" + ], + "k-framework": "k-framework_2", + "nixpkgs": [ + "wasm-semantics", + "k-framework", + "nixpkgs" + ], + "poetry2nix": [ + "wasm-semantics", + "k-framework", + "poetry2nix" + ], + "rv-utils": [ + "wasm-semantics", + "k-framework", + "rv-utils" + ] + }, + "locked": { + "lastModified": 1723228022, + "narHash": "sha256-uCBfMwU3KHGv8dDVP32dlaTCig0zjzPjEgENW1xcbsk=", + "owner": "runtimeverification", + "repo": "wasm-semantics", + "rev": "8b29c636dd8a78ca25f4ceaa8cec2409ae9b99a0", + "type": "github" + }, + "original": { + "owner": "runtimeverification", + "ref": "v0.1.98", + "repo": "wasm-semantics", + "type": "github" + } + }, + "z3": { + "flake": false, + "locked": { + "lastModified": 1674011426, + "narHash": "sha256-7cuUf29TMpX62PwO1ab3ZuzmzlcrRjTKB1CyXnYgYus=", + "owner": "Z3Prover", + "repo": "z3", + "rev": "3012293c35eadbfd73e5b94adbe50b0cc44ffb83", + "type": "github" + }, + "original": { + "owner": "Z3Prover", + "ref": "z3-4.12.1", + "repo": "z3", + "type": "github" + } + }, + "z3_2": { + "flake": false, + "locked": { + "lastModified": 1674011426, + "narHash": "sha256-7cuUf29TMpX62PwO1ab3ZuzmzlcrRjTKB1CyXnYgYus=", + "owner": "Z3Prover", + "repo": "z3", + "rev": "3012293c35eadbfd73e5b94adbe50b0cc44ffb83", + "type": "github" + }, + "original": { + "owner": "Z3Prover", + "ref": "z3-4.12.1", + "repo": "z3", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index aa99be6..3abb239 100644 --- a/flake.nix +++ b/flake.nix @@ -1,24 +1,122 @@ { - description = "ksoroban - K tooling for the Soroban platform"; + description = "komet - K tooling for the Soroban platform"; + inputs = { - nixpkgs.url = "nixpkgs/nixos-22.05"; - flake-utils.url = "github:numtide/flake-utils"; - poetry2nix.url = "github:nix-community/poetry2nix"; + wasm-semantics.url = "github:runtimeverification/wasm-semantics/v0.1.98"; + k-framework.url = "github:runtimeverification/k/v7.1.103"; + pyk.url = "github:runtimeverification/k/v7.1.103?dir=pyk"; + nixpkgs.follows = "k-framework/nixpkgs"; + flake-utils.follows = "k-framework/flake-utils"; + rv-utils.url = "github:runtimeverification/rv-nix-tools"; + nixpkgs-pyk.follows = "pyk/nixpkgs"; + poetry2nix.follows = "pyk/poetry2nix"; + rust-overlay.url = "github:oxalica/rust-overlay"; }; - outputs = { self, nixpkgs, flake-utils, poetry2nix }: + + outputs = { self, k-framework, nixpkgs, flake-utils, rv-utils, pyk + , nixpkgs-pyk, poetry2nix, wasm-semantics, rust-overlay }@inputs: let - allOverlays = [ - poetry2nix.overlay - (final: prev: { - ksoroban = prev.poetry2nix.mkPoetryApplication { - python = prev.python310; + overlay = (final: prev: + let + src = prev.lib.cleanSource (prev.nix-gitignore.gitignoreSourcePure [ + "/.github" + "flake.nix" + "flake.lock" + ./.gitignore + ] ./.); + + version = self.rev or "dirty"; + + nixpkgs-pyk = import inputs.nixpkgs-pyk { + system = prev.system; + overlays = [ pyk.overlay ]; + }; + + python310-pyk = nixpkgs-pyk.python310; + + poetry2nix = + inputs.poetry2nix.lib.mkPoetry2Nix { pkgs = nixpkgs-pyk; }; + in rec { + komet = prev.stdenv.mkDerivation { + pname = "komet"; + inherit src version; + + buildInputs = with final; [ + nixpkgs-pyk.pyk-python310 + k-framework.packages.${system}.k + komet-pyk + ]; + + dontUseCmakeConfigure = true; + + nativeBuildInputs = [ prev.makeWrapper ]; + + enableParallelBuilding = true; + + buildPhase = '' + export XDG_CACHE_HOME=$(pwd) + ${ + prev.lib.optionalString + (prev.stdenv.isAarch64 && prev.stdenv.isDarwin) + "APPLE_SILICON=true" + } K_OPTS="-Xmx8G -Xss512m" kdist -v build soroban-semantics.* -j$NIX_BUILD_CORES + ''; + + installPhase = '' + mkdir -p $out + cp -r ./kdist-*/* $out/ + + makeWrapper ${komet-pyk}/bin/ksoroban $out/bin/ksoroban --prefix PATH : ${ + prev.lib.makeBinPath [ k-framework.packages.${prev.system}.k ] + } --set KDIST_DIR $out + ''; + }; + + komet-pyk = poetry2nix.mkPoetryApplication { + python = nixpkgs-pyk.python310; projectDir = ./.; - groups = []; - # We remove `dev` from `checkGroups`, so that poetry2nix does not try to resolve dev dependencies. - checkGroups = []; - }; - }) - ]; + src = rv-utils.lib.mkSubdirectoryAppSrc { + pkgs = import nixpkgs { system = prev.system; }; + src = ./.; + subdirectories = [ "pykwasm" ]; + cleaner = poetry2nix.cleanPythonSources; + }; + overrides = poetry2nix.overrides.withDefaults + (finalPython: prevPython: { + cmd2 = prevPython.cmd2.overridePythonAttrs (old: { + propagatedBuildInputs = prev.lib.filter + (x: !(prev.lib.strings.hasInfix "exceptiongroup" x.name)) + old.propagatedBuildInputs ++ [ finalPython.exceptiongroup ]; + }); + pytest = prevPython.pytest.overridePythonAttrs (old: { + propagatedBuildInputs = prev.lib.filter + (x: !(prev.lib.strings.hasInfix "attrs" x.name)) + old.propagatedBuildInputs ++ [ finalPython.attrs ]; + }); + kframework = nixpkgs-pyk.pyk-python310.overridePythonAttrs + (old: { + propagatedBuildInputs = prev.lib.filter (x: + !(prev.lib.strings.hasInfix "hypothesis" x.name) + && !(prev.lib.strings.hasInfix "pytest" x.name) + && !(prev.lib.strings.hasInfix "cmd2" x.name)) + old.propagatedBuildInputs ++ [ + finalPython.hypothesis + finalPython.pytest + finalPython.cmd2 + ]; + }); + pykwasm = + wasm-semantics.packages.${prev.system}.kwasm-pyk.overridePythonAttrs + (old: { + propagatedBuildInputs = prev.lib.filter + (x: !(prev.lib.strings.hasInfix "kframework" x.name)) + old.propagatedBuildInputs ++ [ finalPython.kframework ]; + }); + }); + groups = [ ]; + checkGroups = [ ]; + }; + }); in flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" @@ -28,14 +126,71 @@ let pkgs = import nixpkgs { inherit system; - overlays = allOverlays; + overlays = [ overlay (import rust-overlay) ]; }; + + rustWithWasmTarget = pkgs.rust-bin.stable.latest.default.override { + targets = [ "wasm32-unknown-unknown" ]; + }; + + rustPlatformWasm = pkgs.makeRustPlatform { + cargo = rustWithWasmTarget; + rustc = rustWithWasmTarget; + }; + + version = "21.4.0"; + stellar-src = pkgs.fetchFromGitHub { + owner = "stellar"; + repo = "stellar-cli"; + rev = "v${version}"; + hash = "sha256-yPg0Tsnb7H7S1MbVvfWrAmTWehWqwJYSqYLqLWVNq0Y="; + }; + + stellar-cli = rustPlatformWasm.buildRustPackage rec { + pname = "stellar-cli"; + inherit version; + src = stellar-src; + + nativeBuildInputs = [ pkgs.pkg-config ] + ++ (if pkgs.stdenv.isDarwin then + [ pkgs.darwin.apple_sdk.frameworks.SystemConfiguration ] + else + [ ]); + + buildInputs = [ pkgs.openssl pkgs.openssl.dev ]; + + OPENSSL_NO_VENDOR = 1; + GIT_REVISION = "v${version}"; + + doCheck = false; + + cargoLock = { + lockFile = "${stellar-src}/Cargo.lock"; + outputHashes = { + "testcontainers-0.15.0" = + "sha256-v9HJ0cgDgTCRwB6lPm425EmVq3L9oNI8NVCzv4T2HOQ="; + }; + }; + + }; + in { packages = rec { - inherit (pkgs) ksoroban; - default = ksoroban; + inherit (pkgs) komet komet-pyk; + default = pkgs.komet; + }; + + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ stellar-cli komet rustWithWasmTarget ]; + + shellHook = '' + ${pkgs.lib.strings.optionalString + (pkgs.stdenv.isAarch64 && pkgs.stdenv.isDarwin) + "export APPLE_SILICON=true"} + ''; }; + }) // { - overlay = nixpkgs.lib.composeManyExtensions allOverlays; + overlays.default = overlay; }; } diff --git a/package/version b/package/version index 7e72641..001d752 100644 --- a/package/version +++ b/package/version @@ -1 +1 @@ -0.1.22 +0.1.23 diff --git a/pyproject.toml b/pyproject.toml index 456af4c..3a8bfb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "ksoroban" -version = "0.1.22" +version = "0.1.23" description = "K tooling for the Soroban platform" authors = [ "Runtime Verification, Inc. ",