Win build patch 2 (#2054)

* More strict path enforcement for Mingw compilers

* Update Readme about antiviruses

* Update README.md incomplete links

* Incomplete link
This commit is contained in:
Andrea Lanfranchi 2021-05-30 20:14:28 +02:00 committed by GitHub
parent 297e7f44ff
commit aa1f64eb78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 14 deletions

View File

@ -100,7 +100,13 @@ Windows users may run erigon in 3 possible ways:
* [GO Programming Language](https://golang.org/dl/) must be installed. Minimum required version is 1.16
* [Chocolatey package manager](https://chocolatey.org/) for Windows must be installed. By Chocolatey you need to install the following components : `cmake`, `make`, `mingw` by `choco install cmake make mingw`.
Though is still possible to run erigon with LMDB database there's a caveat which might cause your experience with LMDB on Windows uncomfortable: data file allocation is fixed so you need to know in advance how much space you want to allocate for database file using the command line option `--lmdb.mapSize`.
**Important note about Anti-Viruses**
During MinGW's compiler detection phase some temporary executables are generated to test compiler capabilities. It's been reported some anti-virus programs detect
those files as possibly infected by `Win64/Kryptic.CIS` trojan horse (or a variant of it). Although those are false positives we have no control over 100+ vendors of
security products for Windows and their respective detection algorythms and we understand this might make your experience with Windows builds uncomfortable. To
workaround the issue you might either set exlusions for your antivirus specifically for `ethdb\mdbx\dist\CMakeFiles` folder or you can run erigon on Docker or WSL
Though is still possible to run erigon with **LMDB** database there's a caveat which might cause your experience with LMDB on Windows uncomfortable: data file allocation is fixed so you need to know in advance how much space you want to allocate for database file using the command line option `--lmdb.mapSize`.
Please be advised Erigon will completely remove LMDB support in future releases thus we warmly suggest to resync using the default MDBX database.
* Use Docker : see [docker-compose.yml](./docker-compose.yml)
@ -125,13 +131,11 @@ a simple way.
inserting it into the main DB. That reduces write amplification and
DB inserts are orders of magnitude quicker.
<code> 🔬 See our detailed ETL explanation [here](/common/etl/).</code>
<code> 🔬 See our detailed ETL explanation [here](/common/etl/README.md).</code>
**Plain state**.
**Single accounts/state trie**. Erigon uses a single Merkle trie for both
accounts and the storage.
**Single accounts/state trie**. Erigon uses a single Merkle trie for both accounts and the storage.
### Faster Initial Sync
@ -139,7 +143,7 @@ Erigon uses a rearchitected full sync algorithm from
[Go-Ethereum](https://github.com/ethereum/go-ethereum) that is split into
"stages".
<code>🔬 See more detailed explanation in the [Staged Sync Readme](/eth/stagedsync/)</code>
<code>🔬 See more detailed explanation in the [Staged Sync Readme](/eth/stagedsync/README.md)</code>
It uses the same network primitives and is compatible with regular go-ethereum
nodes that are using full sync, you do not need any special sync capabilities

View File

@ -1,6 +1,6 @@
# ETL
ETL framework is most commonly used in [staged sync](../../eth/stagedsync).
ETL framework is most commonly used in [staged sync](../../eth/stagedsync/README.md).
It implements a pattern where we extract some data from a database, transform it,
then put it into temp files and insert back to the database in sorted order.

View File

@ -288,9 +288,28 @@ if (!(Test-Administrator)) {
}
# Enter MDBX directory and build libmdbx.dll
Write-Host " Building libmdbx.dll ..."
Set-Location (Join-Path $MyContext.Directory "ethdb\mdbx\dist")
cmake -G "MinGW Makefiles" . -D CMAKE_MAKE_PROGRAM:PATH=$(Join-Path $chocolateyBinPath "make.exe") -D MDBX_BUILD_SHARED_LIBRARY:BOOL=ON -D MDBX_WITHOUT_MSVC_CRT:BOOOL=OFF -D MDBX_FORCE_ASSERTIONS:INT=0
# Delete CMakeCache.txt and CMakeFiles directory if they exist
if (Test-Path "CMakeCache.txt" -PathType Leaf) {
Write-Host " Removing MDBX CMakeCache.txt ..."
Remove-Item -Path "CMakeCache.txt"
}
if (Test-Path "CMakeFiles") {
Write-Host " Removing MDBX CMakeFiles ..."
Remove-Item -Path "CMakeFiles" -Recurse -Force
}
Write-Host " Building libmdbx.dll ..."
cmake -G "MinGW Makefiles" . `
-D CMAKE_MAKE_PROGRAM:PATH=""$(Join-Path $chocolateyBinPath "make.exe")"" `
-D CMAKE_C_COMPILER:PATH=""$(Join-Path $chocolateyBinPath "gcc.exe")"" `
-D CMAKE_CXX_COMPILER:PATH=""$(Join-Path $chocolateyBinPath "g++.exe")"" `
-D CMAKE_BUILD_TYPE:STRING="Release" `
-D MDBX_BUILD_SHARED_LIBRARY:BOOL=ON `
-D MDBX_WITHOUT_MSVC_CRT:BOOOL=OFF `
-D MDBX_FORCE_ASSERTIONS:INT=0
if($LASTEXITCODE) {
Write-Host "An error has occurred while configuring MDBX dll"
return
@ -305,11 +324,15 @@ if($LASTEXITCODE -or !(Test-Path "libmdbx.dll" -PathType leaf)) {
# Note! default behavior is to overwrite
Copy-Item libmdbx.dll (Join-Path $env:SystemRoot system32)
if(!$?) {
Write-Host " Error ! Could not copy libmdbx.dll to $(Join-Path $env:SystemRoot system32)"
Write-Host " What can you do : "
Write-Host " - Check your permissions to directory "
Write-Host " - Check there's an already existing libmdbx.dll file "
Write-Host " - Check no instance of Erigon with mdbx is currently running "
Write-Host @"
Error ! Could not copy libmdbx.dll to $(Join-Path $env:SystemRoot system32)
What you can try :
- Check your permissions to directory
- Check there's an already existing libmdbx.dll file
- Check no instance of Erigon with mdbx is currently running
"@
return
}