Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Nix flakes #7

Merged
merged 15 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
name: Build on Ubuntu
name: Build and test on Linux

on:
push:
branches: [ "master" ]
branches: [ master ]
pull_request:
branches: [ "master" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
concurrency:
# In master we want to run for every commit, in other branches — only for the last one
group: ${{
( github.ref == 'refs/heads/master' &&
format('{0}/{1}/{2}', github.workflow, github.ref, github.sha) )
||
format('{0}/{1}', github.workflow, github.ref) }}
cancel-in-progress: true

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
build-and-test:
name: Build and run tests

runs-on: [self-hosted, Linux, X64, aws_autoscaling]

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
# https://github.com/actions/checkout/issues/1552
- name: Clean up after previous checkout
run: chmod +w -R ${GITHUB_WORKSPACE}; rm -rf ${GITHUB_WORKSPACE}/*;

- name: Checkout sources
uses: actions/checkout@v3

- name: Build sources
run: nix build -L

- name: Run tests
run: nix flake -L check
12 changes: 0 additions & 12 deletions .gitmodules

This file was deleted.

9 changes: 1 addition & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

cmake_minimum_required(VERSION 3.16...3.27)

if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/evmc/.git)
message(FATAL_ERROR "Git submodules not initialized, execute:\n git submodule update --init")
endif()

option(BUILD_SHARED_LIBS "Build evmone as a shared library" ON)
option(EVMONE_TESTING "Build tests and test tools" OFF)
option(EVMONE_FUZZING "Instrument libraries and build fuzzing tools" OFF)
Expand Down Expand Up @@ -39,10 +35,7 @@ endif()

hunter_add_package(ethash)
find_package(ethash CONFIG REQUIRED)

option(EVMC_TOOLS "Build EVMC test tools" ${EVMONE_TESTING})
option(EVMC_INSTALL "Install EVMC" OFF)
add_subdirectory(evmc)
find_package(evmc REQUIRED)

cable_configure_compiler(NO_STACK_PROTECTION)
if(CABLE_COMPILER_GNULIKE)
Expand Down
36 changes: 33 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# evm1_assigner
# evm-assigner

Simulator of Ethereum Virtual Machine pipeline for fill assignment table associate with evm1 circuit.

Expand All @@ -7,20 +7,50 @@ Created by members of the [Ipsilon] (ex-[Ewasm]) team.

## Dependencies

### Build tools

- CMake 3.16+
- Clang or GCC (tested with GCC 13)
- Ninja (recommended)

### Libraries

- [evmc](https://github.com/ethereum/evmc)
- [intx](https://github.com/chfast/intx)
- [blueprint](https://github.com/NilFoundation/zkllvm-blueprint)
- [crypto3](https://github.com/NilFoundation/crypto3)

## Nix support

`evm-assigner` supports [Nix](https://nixos.org/) flakes. This means that you can get development-ready environment with:

```bash
nix develop
```

Build package:

```bash
nix build
```

Run tests:

```bash
nix flake check
```

## Build

### Configure cmake

```
```bash
cmake -G "Ninja" -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_ASSIGNER_TESTS=TRUE

```

### Build test

```
```bash
cmake --build build -t assigner_tests
```
1 change: 0 additions & 1 deletion evmc
Submodule evmc deleted from 24f939
173 changes: 173 additions & 0 deletions flake.lock

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

Loading
Loading