fix windows builds

This commit is contained in:
Dmitriy Ryajov 2024-02-06 11:36:07 -06:00
parent 39c8891291
commit fa513b123e
No known key found for this signature in database
GPG Key ID: DA8C680CE7C657A4
3 changed files with 46 additions and 28 deletions

View File

@ -3,28 +3,39 @@ name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
build:
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
nim: [1.6.18, 1.4.8, 1.2.18]
toolchain:
- stable
# - beta
# - nightly
nim:
- '1.6.18'
- '1.6.14'
os:
- ubuntu-latest
- windows-latest
- macOS-latest
name: Build nim circom compat ${{ matrix.nim }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install Nim
uses: asdf-vm/actions/install@v3
with:
tool_versions: |
nim ${{ matrix.nim }}
- name: Set rust ${{ matrix.os }}
if: matrix.os == 'windows-latest'
run: |
rustup set default-host x86_64-pc-windows-gnu
rustup update stable && rustup default stable
- name: Build
run: nimble install -y
- name: Test
run: nimble test -y
- name: Set rust ${{ matrix.os }}
if: matrix.os != 'windows-latest'
run: rustup update stable && rustup default stable
- name: Setup nim
uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ matrix.nim }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: nimble install -y
- run: nimble test -y

View File

@ -10,14 +10,21 @@ const
libPath* = libDir/"libcircom_compat_ffi.a"
static:
let cmd = "cd vendor/circom-compat-ffi && cargo build --release"
warning "\nBuilding circom compat ffi: " & cmd
let (output, exitCode) = gorgeEx cmd
for ln in output.splitLines():
warning("cargo> " & ln)
if exitCode != 0:
raiseAssert("Failed to build circom-compat-ffi")
let
cmd = "cargo build --release --manifest-path=vendor/circom-compat-ffi/Cargo.toml"
{.passl: "-lcircom_compat_ffi -lm" & " -L" & libDir.}
warning "\nBuilding circom compat ffi: "
warning cmd
let (output, exitCode) = gorgeEx cmd
if exitCode != 0:
for ln in output.splitLines():
warning("rust error> " & ln)
raiseAssert("Failed to build circom-compat-ffi")
warning "circom compat ffi built successfully\n"
when defined(windows):
{.passl: "-lcircom_compat_ffi -lm -lws2_32 -luserenv -lntdll -lbcrypt " & " -L" & libDir.}
else:
{.passl: "-lcircom_compat_ffi -lm" & " -L" & libDir.}
include circomcompatffi

@ -1 +1 @@
Subproject commit b1755a2b2e8d3978925cb5815c1564f62756b29d
Subproject commit 190adb8c2362c3189a37858e6070ff8fed538e8b