From 1e699d0536313b7c5c6d5b247a87f5ddb0a03e8f Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Thu, 19 Oct 2023 16:35:02 +0100 Subject: [PATCH] chore: remove unused nix files --- barretenberg/.github/workflows/nix.yml | 56 --------------- barretenberg/flake.lock | 43 ------------ barretenberg/flake.nix | 94 -------------------------- barretenberg/wasi-sdk.nix | 48 ------------- 4 files changed, 241 deletions(-) delete mode 100644 barretenberg/.github/workflows/nix.yml delete mode 100644 barretenberg/flake.lock delete mode 100644 barretenberg/flake.nix delete mode 100644 barretenberg/wasi-sdk.nix diff --git a/barretenberg/.github/workflows/nix.yml b/barretenberg/.github/workflows/nix.yml deleted file mode 100644 index 206aa888fcf..00000000000 --- a/barretenberg/.github/workflows/nix.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Nix builds - -on: - push: - branches: - - acvm-backend-barretenberg - workflow_dispatch: - -# This will cancel previous runs when a branch or PR is updated -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }} - cancel-in-progress: true - -jobs: - nix-build: - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest] - target: [default, wasm32, cross-aarch64] - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: cachix/install-nix-action@v20 - with: - nix_path: nixpkgs=channel:nixos-22.11 - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - - uses: cachix/cachix-action@v12 - with: - name: barretenberg - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - - - name: Check nix flake - run: | - nix flake check - - - name: Build barretenberg as ${{ matrix.target }} - run: | - nix build -L .#${{ matrix.target }} - - - name: Prepare artifact - run: | - mkdir artifacts - cp -a ./result/. artifacts - 7z a -ttar -so -an ./artifacts/* | 7z a -si ./libbarretenberg.tar.gz - - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: libbarretenberg-${{ runner.os }}-${{ matrix.target }}.tar.gz - path: ./libbarretenberg.tar.gz diff --git a/barretenberg/flake.lock b/barretenberg/flake.lock deleted file mode 100644 index d0e2bfe5cee..00000000000 --- a/barretenberg/flake.lock +++ /dev/null @@ -1,43 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "locked": { - "lastModified": 1678901627, - "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1680498889, - "narHash": "sha256-4nGFBm+oILOO6DPoKTPxVlfkZSxCOY4W25zSRHESK48=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "799d153e4f316143a9db0eb869ecf44d8d4c0356", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-22.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/barretenberg/flake.nix b/barretenberg/flake.nix deleted file mode 100644 index 6a672cbf057..00000000000 --- a/barretenberg/flake.nix +++ /dev/null @@ -1,94 +0,0 @@ -{ - description = - "Barretenberg: C++ cryptographic library, BN254 elliptic curve library, and PLONK SNARK prover"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { self, nixpkgs, flake-utils }: - let - barretenbergOverlay = final: prev: { - barretenberg = prev.callPackage ./barretenberg.nix { }; - barretenberg-wasm = prev.callPackage ./barretenberg-wasm.nix { }; - barretenberg-transcript00 = prev.fetchurl { - url = "http://aztec-ignition.s3.amazonaws.com/MAIN%20IGNITION/monomial/transcript00.dat"; - sha256 = "sha256-D5SzlCb1pX0aF3QmJPfTFwoy4Z1sXhbyAigUOdvkhpU="; - }; - }; - in - flake-utils.lib.eachDefaultSystem - (system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ barretenbergOverlay ]; - }; - - optional = pkgs.lib.lists.optional; - - crossTargets = builtins.listToAttrs - ( - [ ] ++ optional (pkgs.hostPlatform.isx86_64 && pkgs.hostPlatform.isLinux) { - name = "cross-aarch64"; - value = pkgs.pkgsCross.aarch64-multiplatform-musl.pkgsLLVM.barretenberg; - } ++ optional (pkgs.hostPlatform.isx86_64 && pkgs.hostPlatform.isDarwin) { - name = "cross-aarch64"; - value = pkgs.pkgsCross.aarch64-darwin.barretenberg; - } - ); - - shellDefaults = { - nativeBuildInputs = [ - pkgs.starship - pkgs.llvmPackages_15.llvm - ]; - - shellHook = '' - eval "$(starship init bash)" - ''; - }; - in - rec { - packages = { - llvm15 = pkgs.barretenberg.override { - llvmPackages = pkgs.llvmPackages_15; - }; - llvm16 = pkgs.barretenberg.override { - llvmPackages = pkgs.llvmPackages_16; - }; - wasm32 = pkgs.barretenberg-wasm; - - default = packages.llvm15; - } // crossTargets; - - # Provide legacyPackages with our overlay so we can run - # > `nix build .#pkgsCross.aarch64-multiplatform.barretenberg` - # Ref https://discourse.nixos.org/t/how-do-i-cross-compile-a-flake/12062/12 - legacyPackages = import nixpkgs { - inherit system; - overlays = [ barretenbergOverlay ]; - crossOverlays = [ barretenbergOverlay ]; - }; - - devShells = { - default = pkgs.mkShell.override { stdenv = packages.default.stdenv; } - ({ - inputsFrom = - [ packages.default ]; - } // shellDefaults); - - wasm32 = pkgs.mkShell.override - { - # TODO: This derivations forces wasi-sdk 12 so the stdenv will have the wrong tools - stdenv = packages.wasm32.stdenv; - } - ({ - inputsFrom = [ packages.wasm32 ]; - } // shellDefaults); - }; - }) // { - overlays.default = barretenbergOverlay; - }; -} diff --git a/barretenberg/wasi-sdk.nix b/barretenberg/wasi-sdk.nix deleted file mode 100644 index b4d9b8c8aa6..00000000000 --- a/barretenberg/wasi-sdk.nix +++ /dev/null @@ -1,48 +0,0 @@ -# Copied from https://github.com/ereslibre/nixities/blob/2c60af777fc863f90e6e4eeffcf3465def93a1f3/packages/wasi-sdk/default.nix -# with a fix for the autoPatchelfHook needing libstdc++.so and some refactor -{ lib, pkgs, stdenv }: -let - pname = "wasi-sdk"; - version = "20"; -in -pkgs.stdenv.mkDerivation { - inherit pname version; - - sourceRoot = "${pname}-${version}.0"; - dontBuild = true; - dontConfigure = true; - dontStrip = true; - - nativeBuildInputs = - lib.optional stdenv.isLinux (with pkgs; [ autoPatchelfHook ]); - - # Needed by autoPatchelfHook to have libstdc++ - # see https://discourse.nixos.org/t/autopatchelfhook-not-patching-all-dependencies/14634/6 - buildInputs = - lib.optional stdenv.isLinux [ stdenv.cc.cc.lib ]; - - installPhase = '' - mkdir -p $out/{bin,lib,share} - mv bin/* $out/bin/ - mv lib/* $out/lib/ - mv share/* $out/share/ - ''; - - src = - let - tarball = - if stdenv.hostPlatform.isDarwin then { - suffix = "macos"; - hash = "sha256-juJfnD/eYY/upcV62tOFFSYmeEtra1L7Vj5e2DK/U+8="; - } else { - suffix = "linux"; - hash = "sha256-cDATnUlaGfvsy5RJFQwrFTHhXY+3RBmHKnGadYCq0Pk="; - }; - in - - pkgs.fetchurl { - url = - "https://github.com/WebAssembly/${pname}/releases/download/${pname}-${version}/${pname}-${version}.0-${tarball.suffix}.tar.gz"; - hash = tarball.hash; - }; -}