Add poseidon2 dependency (#625)

* [build] add nim-poseidon2

* [build] Workaround incompatibility constantine and secp256k1

Constantine sets compiler flag that is incompatible
with the assembly code in secp256k1:
5f7ba18f2e/constantine/platforms/isa/macro_assembler_x86.nim (L19)

---------

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
This commit is contained in:
markspanbroek 2023-11-20 09:51:36 +01:00 committed by GitHub
parent 750fe2392f
commit 374e6b645b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 0 deletions

6
.gitmodules vendored
View File

@ -193,3 +193,9 @@
[submodule "vendor/npeg"] [submodule "vendor/npeg"]
path = vendor/npeg path = vendor/npeg
url = https://github.com/zevv/npeg url = https://github.com/zevv/npeg
[submodule "vendor/nim-poseidon2"]
path = vendor/nim-poseidon2
url = https://github.com/codex-storage/nim-poseidon2.git
[submodule "vendor/constantine"]
path = vendor/constantine
url = https://github.com/mratsim/constantine.git

View File

@ -30,5 +30,6 @@ requires "leopard >= 0.1.0 & < 0.2.0"
requires "blscurve" requires "blscurve"
requires "libp2pdht" requires "libp2pdht"
requires "eth" requires "eth"
requires "https://github.com/codex-storage/nim-poseidon2.git >= 0.1.0 & < 0.2.0"
include "build.nims" include "build.nims"

View File

@ -113,6 +113,9 @@ switch("define", "libp2p_pki_schemes=secp256k1")
# we can't use it. And codex.cfg doesn't work # we can't use it. And codex.cfg doesn't work
switch("define", "chronicles_sinks=textlines[dynamic],json[dynamic],textlines[dynamic]") switch("define", "chronicles_sinks=textlines[dynamic],json[dynamic],textlines[dynamic]")
# Workaround for assembler incompatibility between constantine and secp256k1
switch("define", "use_asm_syntax_intel=false")
# begin Nimble config (version 1) # begin Nimble config (version 1)
when system.fileExists("nimble.paths"): when system.fileExists("nimble.paths"):
include "nimble.paths" include "nimble.paths"

1
vendor/constantine vendored Submodule

@ -0,0 +1 @@
Subproject commit 5f7ba18f2ed351260015397c9eae079a6decaee1

1
vendor/nim-poseidon2 vendored Submodule

@ -0,0 +1 @@
Subproject commit af6737492971dd05b2a6b03404e490f865266f15