mirror of https://github.com/status-im/nim-eth.git
build_nim.sh and build_rocksdb.sh
This commit is contained in:
parent
1cb1168aec
commit
f70f87b78f
|
@ -6,7 +6,7 @@ cache:
|
||||||
- sqlite-dll-win32-x86-3240000.zip -> .appveyor.yml
|
- sqlite-dll-win32-x86-3240000.zip -> .appveyor.yml
|
||||||
- sqlite-dll-win64-x64-3240000.zip -> .appveyor.yml
|
- sqlite-dll-win64-x64-3240000.zip -> .appveyor.yml
|
||||||
- nimbus-deps.zip -> .appveyor.yml
|
- nimbus-deps.zip -> .appveyor.yml
|
||||||
- Nim -> .appveyor.yml
|
- NimBinaries
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
# We always want 32 and 64-bit compilation
|
# We always want 32 and 64-bit compilation
|
||||||
|
@ -16,6 +16,9 @@ platform:
|
||||||
- x86
|
- x86
|
||||||
- x64
|
- x64
|
||||||
|
|
||||||
|
# when multiple CI builds are queued, the tested commit needs to be in the last X commits cloned with "--depth X"
|
||||||
|
clone_depth: 10
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- setlocal EnableExtensions EnableDelayedExpansion
|
- setlocal EnableExtensions EnableDelayedExpansion
|
||||||
|
|
||||||
|
@ -55,52 +58,17 @@ install:
|
||||||
- SET "LMDB_ARCHIVE=LMDB_%LMDB_VER%.tar.gz"
|
- SET "LMDB_ARCHIVE=LMDB_%LMDB_VER%.tar.gz"
|
||||||
- SET "LMDB_PATH=lmdb-LMDB_%LMDB_VER%\libraries\liblmdb"
|
- SET "LMDB_PATH=lmdb-LMDB_%LMDB_VER%\libraries\liblmdb"
|
||||||
- appveyor DownloadFile "%LMDB_URL%\%LMDB_ARCHIVE%" - FileName "%LMDB_ARCHIVE%"
|
- appveyor DownloadFile "%LMDB_URL%\%LMDB_ARCHIVE%" - FileName "%LMDB_ARCHIVE%"
|
||||||
- tar xvf %LMDB_ARCHIVE%
|
- tar xzf %LMDB_ARCHIVE%
|
||||||
- cd %LMDB_PATH%
|
- cd %LMDB_PATH%
|
||||||
- gcc -shared -o lmdb.dll mdb.c midl.c -lntdll
|
- gcc -march=native -O3 -pipe -shared -o lmdb.dll mdb.c midl.c -lntdll
|
||||||
- cd ..\..\..
|
- cd ..\..\..
|
||||||
- copy %LMDB_PATH%\lmdb.dll %CD%\bin\lmdb.dll
|
- copy %LMDB_PATH%\lmdb.dll %CD%\bin\lmdb.dll
|
||||||
|
|
||||||
# build nim from our own branch - this to avoid the day-to-day churn and
|
# build nim from our own branch - this to avoid the day-to-day churn and
|
||||||
# regressions of the fast-paced Nim development while maintaining the
|
# regressions of the fast-paced Nim development while maintaining the
|
||||||
# flexibility to apply patches
|
# flexibility to apply patches
|
||||||
- SET "NEED_REBUILD="
|
- curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus/devel/build_nim.sh
|
||||||
|
- env MAKE="mingw32-make -j2" ARCH_OVERRIDE=%PLATFORM% bash build_nim.sh Nim csources dist/nimble NimBinaries
|
||||||
- IF NOT EXIST "Nim\\.git\\" (
|
|
||||||
git clone https://github.com/status-im/Nim.git
|
|
||||||
) ELSE (
|
|
||||||
( cd Nim ) &
|
|
||||||
( git pull ) &
|
|
||||||
( cd .. )
|
|
||||||
)
|
|
||||||
|
|
||||||
# Rebuild Nim if HEAD has moved or if we don't yet have a cached version
|
|
||||||
- IF NOT EXIST "Nim\\ver.txt" (
|
|
||||||
SET NEED_REBUILD=1
|
|
||||||
) ELSE (
|
|
||||||
( CD Nim ) &
|
|
||||||
( git rev-parse HEAD > ..\\cur_ver.txt ) &
|
|
||||||
( fc ver.txt ..\\cur_ver.txt || SET NEED_REBUILD=1 ) &
|
|
||||||
( cd .. )
|
|
||||||
)
|
|
||||||
|
|
||||||
- IF NOT EXIST "Nim\\bin\\nim.exe" SET NEED_REBUILD=1
|
|
||||||
- IF NOT EXIST "Nim\\bin\\nimble.exe" SET NEED_REBUILD=1
|
|
||||||
|
|
||||||
# after building nim, wipe csources to save on cache space
|
|
||||||
- IF DEFINED NEED_REBUILD (
|
|
||||||
cd Nim &
|
|
||||||
( IF EXIST "csources" rmdir /s /q csources ) &
|
|
||||||
git clone --depth 1 https://github.com/nim-lang/csources &
|
|
||||||
cd csources &
|
|
||||||
( IF "%PLATFORM%" == "x64" ( build64.bat ) else ( build.bat ) ) &
|
|
||||||
cd .. &
|
|
||||||
bin\nim c koch &
|
|
||||||
koch boot -d:release &
|
|
||||||
koch nimble &
|
|
||||||
git rev-parse HEAD > ver.txt &
|
|
||||||
rmdir /s /q csources
|
|
||||||
)
|
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- cd C:\projects\%APPVEYOR_PROJECT_SLUG%
|
- cd C:\projects\%APPVEYOR_PROJECT_SLUG%
|
||||||
|
|
58
.travis.yml
58
.travis.yml
|
@ -1,63 +1,43 @@
|
||||||
language: c # or other C/C++ variants
|
language: c
|
||||||
|
|
||||||
sudo: false
|
|
||||||
|
|
||||||
# https://docs.travis-ci.com/user/caching/
|
# https://docs.travis-ci.com/user/caching/
|
||||||
#
|
|
||||||
# Caching the whole nim folder is better than relying on ccache - this way, we
|
|
||||||
# skip the expensive bootstrap process and linking
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- nim
|
- NimBinaries
|
||||||
- rocksdb
|
- rocksdbCache
|
||||||
|
|
||||||
|
git:
|
||||||
|
# when multiple CI builds are queued, the tested commit needs to be in the last X commits cloned with "--depth X"
|
||||||
|
depth: 10
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
sudo: required
|
sudo: required
|
||||||
before_install:
|
before_install:
|
||||||
- export INSTALL_PATH=/usr
|
- export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
|
||||||
- export NPROC=$(nproc)
|
|
||||||
- os: osx
|
- os: osx
|
||||||
before_install:
|
before_install:
|
||||||
- export INSTALL_PATH=$HOME # included in DYLD_FALLBACK_LIBRARY_PATH
|
- launchctl setenv LIBRARY_PATH /usr/local/lib # for RocksDB
|
||||||
- export NPROC=$(sysctl -n hw.ncpu)
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# build nim from our own branch - this to avoid the day-to-day churn and
|
# build nim from our own branch - this to avoid the day-to-day churn and
|
||||||
# regressions of the fast-paced Nim development while maintaining the
|
# regressions of the fast-paced Nim development while maintaining the
|
||||||
# flexibility to apply patches
|
# flexibility to apply patches
|
||||||
#
|
- curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus/devel/build_nim.sh
|
||||||
# check version of remote branch
|
- env MAKE="make -j2" bash build_nim.sh Nim csources dist/nimble NimBinaries
|
||||||
- "export NIMVER=$(git ls-remote https://github.com/status-im/nim.git HEAD | cut -f 1)"
|
- export PATH=$PWD/Nim/bin:$PATH
|
||||||
|
|
||||||
# after building nim, wipe csources to save on cache space
|
|
||||||
- "{ [ -f nim/$NIMVER/bin/nim ] && [ -f nim/$NIMVER/bin/nimble ] ; } ||
|
|
||||||
{ rm -rf nim ;
|
|
||||||
mkdir -p nim ;
|
|
||||||
git clone --depth=1 https://github.com/status-im/nim.git nim/$NIMVER ;
|
|
||||||
cd nim/$NIMVER ;
|
|
||||||
sh build_all.sh ;
|
|
||||||
rm -rf csources ;
|
|
||||||
cd ../.. ;
|
|
||||||
}"
|
|
||||||
- "export PATH=$PWD/nim/$NIMVER/bin:$PATH"
|
|
||||||
|
|
||||||
# build our own rocksdb to test with a fixed version that we think works
|
# build our own rocksdb to test with a fixed version that we think works
|
||||||
- "export ROCKSDBVER=5.14.2"
|
- curl -O -L -s -S https://raw.githubusercontent.com/status-im/nimbus/devel/build_rocksdb.sh
|
||||||
- "[ -f rocksdb/rocksdb-$ROCKSDBVER/Makefile ] || { rm -rf rocksdb ; mkdir -p rocksdb; cd rocksdb; wget https://github.com/facebook/rocksdb/archive/v$ROCKSDBVER.tar.gz && tar xvf v$ROCKSDBVER.tar.gz; cd ..; }"
|
- bash build_rocksdb.sh rocksdbCache
|
||||||
- cd rocksdb/rocksdb-$ROCKSDBVER
|
|
||||||
- "[ -f util/build_version.cc ] || { make util/build_version.cc ; }" # use cached version if possible
|
|
||||||
- export NO_UPDATE_BUILD_VERSION=1
|
|
||||||
- make shared_lib -j$NPROC && sudo make install-shared
|
|
||||||
- cd ../..
|
|
||||||
|
|
||||||
# no need to cache, lmdb is small and compile very fast
|
# no need to cache, lmdb is small and compiles very fast
|
||||||
- "export LMDBVER=0.9.22"
|
- export LMDBVER="0.9.22"
|
||||||
- "wget https://github.com/LMDB/lmdb/archive/LMDB_$LMDBVER.tar.gz && tar xvf LMDB_$LMDBVER.tar.gz;"
|
- "wget https://github.com/LMDB/lmdb/archive/LMDB_$LMDBVER.tar.gz && tar xzf LMDB_$LMDBVER.tar.gz;"
|
||||||
- cd lmdb-LMDB_$LMDBVER/libraries/liblmdb && make
|
- cd lmdb-LMDB_$LMDBVER/libraries/liblmdb && make -j2
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sed -i 's| liblmdb.a||' Makefile && sudo make prefix=/usr install; fi
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sed -i 's| liblmdb.a||' Makefile && sudo make prefix=/usr install; fi
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo cp liblmdb.so /usr/local/lib/liblmdb.dylib; fi
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo cp -a liblmdb.so /usr/local/lib/liblmdb.dylib; fi
|
||||||
- cd ../../..
|
- cd ../../..
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
|
Loading…
Reference in New Issue