good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 62476f0e authored by Andrea Lanfranchi's avatar Andrea Lanfranchi Committed by GitHub
Browse files

Change MDBX tools build location so it does not dirty submodule (#2223)

* Change MDBX build location so it does not dirty submodule

* Update README.md

* Update README.md
parent 80c2fc6a
No related branches found
No related tags found
No related merge requests found
......@@ -100,13 +100,13 @@ Windows users may run erigon in 3 possible ways:
There are some requirements for a successful native build on windows :
* [Git](https://git-scm.com/downloads) for Windows must be installed. If you're cloning this repository is very likely you already have it
* [GO Programming Language](https://golang.org/dl/) must be installed. Minimum required version is 1.16
* If you need to build MDBX tools then [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`.
* If you need to build MDBX tools (i.e. `.\wmake.ps1 db-tools`) then [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`.
**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
workaround the issue you might either set exlusions for your antivirus specifically for `build\bin\mdbx\CMakeFiles` sub-folder of the cloned repo or you can run erigon using the following other two options
* Use Docker : see [docker-compose.yml](./docker-compose.yml)
......
......@@ -368,21 +368,32 @@ if ($BuildTarget -eq "all" -or $BuildTarget -eq "db-tools") {
exit 1
}
# Enter MDBX directory and build libmdbx.dll
Set-Location (Join-Path $MyContext.Directory "libmdbx")
if(!$?) {
Write-Host @"
Error ! Can't locate ""libmdbx"" folder
Are you sure you have cloned the repository properly ?
$Erigon.MDBXSourcePath = [string](Join-Path $MyContext.StartDir "\libmdbx")
if (!Test-Path -Path $Erigon.MDBXSourcePath -PathType Directory) {
Write-Host @"
Error ! Can't locate ""libmdbx"" folder
Are you sure you have cloned the repository properly ?
"@
exit 1
}
exit 1
}
if (!Test-Path -Path [string](Join-Path $Erigon.MDBXSourcePath "\.git") -PathType Directory) {
git.exe submodule update --init --recursive
if($LASTEXITCODE) {
Write-Host "An error has occurred while updating libmdbx submodule"
exit $LASTEXITCODE
}
}
# Create build directory for mdbx and enter it
$Erigon.MDBXBuildPath = [string](Join-Path $Erigon.BinPath "\mdbx")
New-Item -Path $Erigon.MDBXBuildPath -ItemType Directory -Force | Out-Null
Set-Location $Erigon.MDBXBuildPath
Write-Host " Building db-tools ..."
cmake -G "MinGW Makefiles" . `
cmake -G "MinGW Makefiles" "$($Erigon.MDBXSourcePath)" `
-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")"" `
......@@ -402,14 +413,15 @@ if ($BuildTarget -eq "all" -or $BuildTarget -eq "db-tools") {
-or !(Test-Path "mdbx_copy.exe" -PathType leaf) `
-or !(Test-Path "mdbx_dump.exe" -PathType leaf) `
-or !(Test-Path "mdbx_load.exe" -PathType leaf) `
-or !(Test-Path "mdbx_drop.exe" -PathType leaf)) {
-or !(Test-Path "mdbx_drop.exe" -PathType leaf) `
-or !(Test-Path "mdbx_test.exe" -PathType leaf)) {
Write-Host "An error has occurred while building MDBX tools"
exit $LASTEXITCODE
}
Set-Location $MyContext.Directory
# Eventually move all mdbx_*.exe to ./build/bin directory
Move-Item -Path "./libmdbx/mdbx_*.exe" -Destination $Erigon.BinPath -Force
Move-Item -Path "$($Erigon.MDBXBuildPath)/mdbx_*.exe" -Destination $Erigon.BinPath -Force
}
......@@ -417,11 +429,6 @@ if ($BuildTarget -eq "clean") {
Write-Host " Cleaning ..."
# Clean ./libmdbx/mdbx_*.exe
Remove-Item -Path "./libmdbx/mdbx_*.exe" -Force
Remove-Item -Path "./libmdbx/CMakeCache.txt" -Force
Remove-Item -Path "./libmdbx/CMakeFiles" -Recurse -Force
# Remove ./build/bin directory
Remove-Item -Path "./build" -Recurse -Force
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment