Skip to content

Commit

Permalink
Win build patch (erigontech#2027)
Browse files Browse the repository at this point in the history
* Add MDBX build files to ignore list

* Delete previous tg.exe binary if present
(see erigontech#2023)
  • Loading branch information
AndreaLanfranchi authored May 27, 2021
1 parent 2c01612 commit 804e337
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ docs/readthedocs/build
.project
.settings

# Used by mdbx Makefile
/ethdb/mdbx/dist/CMakeFiles/*
/ethdb/mdbx/dist/CMakeCache*
/ethdb/mdbx/dist/*.cmake
/ethdb/mdbx/dist/*.dll
/ethdb/mdbx/dist/*.exe
/ethdb/mdbx/dist/Makefile

# used by the Makefile
/build/_workspace/
/build/cache/
Expand Down Expand Up @@ -58,4 +66,4 @@ docker-compose.dev.yml
/build
*.tmp

/ethdb/*.fail
/ethdb/*.fail
7 changes: 6 additions & 1 deletion win-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ If(!$chocolateyHasCmake -or !$chocolateyHasMake -or !$chocolateyHasMingw) {
# 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
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
if($LASTEXITCODE) {
Write-Host "An error has occurred while configuring MDBX dll"
return
Expand Down Expand Up @@ -176,6 +176,11 @@ $Erigon.Build = "go build -v -trimpath -tags=mdbx -ldflags ""-X main.gitCommit
$Erigon.BinPath = [string](Join-Path $MyContext.StartDir "\build\bin")
$env:GO111MODULE = "on"

# Remove previous 'tg.exe' executable (if present)
if (Test-Path -Path (Join-Path $Erigon.BinPath "tg.exe") -PathType Leaf) {
Remove-Item -Path (Join-Path $Erigon.BinPath "tg.exe")
}

Write-Host " Building Erigon ..."
$outExecutable = [string](Join-Path $Erigon.BinPath "erigon.exe")
$BuildCommand = "$($Erigon.Build) -o ""$($outExecutable)"" ./cmd/erigon"
Expand Down

0 comments on commit 804e337

Please sign in to comment.