diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index edecb6629..9ad37a695 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,10 +1,9 @@ stages: - build + - test -build_linux: +build:linux: image: asherd/veruscoin-cross-compiler:linux - services: - - docker:dind variables: DOCKER_DRIVER: overlay2 stage: build @@ -12,7 +11,7 @@ build_linux: key: ${CI_JOB_NAME} paths: - depends/built - - .ccache + - .ccache - .zcash-params before_script: - mkdir .ccache || echo ccache exists @@ -20,7 +19,7 @@ build_linux: - mkdir .zcash-params || echo zcash-params exists - ln -s $PWD/.zcash-params /root/.zcash-params - script: + script: - "./zcutil/fetch-params.sh" - "./zcutil/build.sh" - "cp src/komodod src/komodo-cli kmd/linux/verus-cli && chmod -R +x kmd/linux/verus-cli/" @@ -29,10 +28,8 @@ build_linux: - kmd/linux/verus-cli expire_in: 1 week -build_windows: +build:windows: image: asherd/veruscoin-cross-compiler:latest - services: - - docker:dind variables: DOCKER_DRIVER: overlay2 stage: build @@ -40,7 +37,7 @@ build_windows: key: ${CI_JOB_NAME} paths: - depends/built - - .ccache + - .ccache - .cargo - .zcash-params before_script: @@ -50,7 +47,7 @@ build_windows: - ln -s $PWD/.zcash-params /root/.zcash-params - mkdir .cargo || echo .cargo exists - ln -s $PWD/.cargo /root/.cargo - script: + script: - "./zcutil/fetch-params.sh" - "./zcutil/build-win.sh" - "cp src/komodod.exe src/komodo-cli.exe src/komodo-tx.exe kmd/windows/verus-cli" @@ -59,22 +56,53 @@ build_windows: - kmd/windows/verus-cli expire_in: 1 week -build_mac: +build:mac: stage: build tags: ["osx"] cache: key: ${CI_JOB_NAME} paths: - depends/built - - .ccache - before_script: - - mkdir .ccache || echo ccache exists - script: + + script: - "./zcutil/fetch-params.sh" - "./zcutil/build-mac.sh | xcpretty" - "./makeRelease.sh" - - "cp src/komodod src/komodo-cli kmd/mac/verus-cli && chmod +x kmd/mac/verus-cli/komodod && chmod +x kmd/mac/verus-cli/komodo-cli" artifacts: paths: - kmd/mac/verus-cli expire_in: 1 week + +code_quality: + image: docker:stable + variables: + DOCKER_DRIVER: overlay2 + allow_failure: true + services: + - docker:stable-dind + script: + - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') + - docker run + --env SOURCE_CODE="$PWD" + --volume "$PWD":/code + --volume /var/run/docker.sock:/var/run/docker.sock + "registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code + artifacts: + paths: [gl-code-quality-report.json] + +sast: + image: docker:stable + variables: + DOCKER_DRIVER: overlay2 + allow_failure: true + services: + - docker:stable-dind + script: + - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') + - docker run + --env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}" + --volume "$PWD:/code" + --volume /var/run/docker.sock:/var/run/docker.sock + "registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code + artifacts: + paths: [gl-sast-report.json] diff --git a/kmd/linux/verus-cli/README.txt b/kmd/linux/verus-cli/README.txt index 3d643bf8b..6998ac32d 100644 --- a/kmd/linux/verus-cli/README.txt +++ b/kmd/linux/verus-cli/README.txt @@ -1,4 +1,4 @@ -VerusCoin Command Line Tools v0.3.4-beta +VerusCoin Command Line Tools v0.3.6-beta Contents: komodod - VerusCoin's enhanced Komodo daemon komodo-cli - VerusCoin's Komodo command line utility diff --git a/kmd/mac/verus-cli/Brewfile b/kmd/mac/verus-cli/Brewfile deleted file mode 100644 index fbb8f7622..000000000 --- a/kmd/mac/verus-cli/Brewfile +++ /dev/null @@ -1,5 +0,0 @@ -tap "homebrew/bundle" -tap "homebrew/cask" -tap "homebrew/core" -brew "gcc@5" -brew "libidn2" diff --git a/kmd/mac/verus-cli/README.txt b/kmd/mac/verus-cli/README.txt index 2c12d4b0a..7a96fae1b 100644 --- a/kmd/mac/verus-cli/README.txt +++ b/kmd/mac/verus-cli/README.txt @@ -1,4 +1,4 @@ -VerusCoin Command Line Tools v0.3.4-beta +VerusCoin Command Line Tools v0.3.6-beta Contents: Brewfile - configuration for brew that specifies verus-cli requirements. Used via a "brew Brewfile" command. komodod - VerusCoin's enhanced Komodo daemon. diff --git a/kmd/windows/verus-cli/README.txt b/kmd/windows/verus-cli/README.txt index 3693a3882..0ce675ca3 100644 --- a/kmd/windows/verus-cli/README.txt +++ b/kmd/windows/verus-cli/README.txt @@ -1,4 +1,4 @@ -VerusCoin Command Line Tools v0.3.4-beta +VerusCoin Command Line Tools v0.3.6-beta Contents: komodod.exe - VerusCoin's enhanced Komodo daemon komodo-cli.exe - iVerusCoin's Komodo command line utility diff --git a/makeRelease.sh b/makeRelease.sh index 510314e97..0cfecf8ed 100755 --- a/makeRelease.sh +++ b/makeRelease.sh @@ -1,17 +1,94 @@ #!/bin/sh - + +KMD_DIR=kmd/mac/verus-cli + binaries=("komodo-cli" "komodod") +alllibs=() +for binary in "${binaries[@]}"; +do + # do the work in the destination directory + cp src/$binary $KMD_DIR + # find the dylibs to copy for komodod + DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` + echo "copying $DYLIBS to $KMD_DIR" + # copy the dylibs to the srcdir + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; done + #DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/lib" | awk -F' ' '{ print $1 }'` + # copy the other dylibs to the srcdir + #for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; alllibs+=($dylib); done +done + +libraries=("libgcc_s.1.dylib" "libgomp.1.dylib" "libidn2.0.dylib" "libstdc++.6.dylib") + +for binary in "${libraries[@]}"; +do + # Need to undo this for the dylibs when we are done + chmod 755 $KMD_DIR/$binary + # find the dylibs to copy for komodod + DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` + echo "copying $DYLIBS to $KMD_DIR" + # copy the dylibs to the srcdir + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; alllibs+=($dylib); done + #DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/lib" | awk -F' ' '{ print $1 }'` + # copy the other dylibs to the srcdir + #for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; alllibs+=($dylib); newlibs+=(`basename $dylib`); done +done + +indirectlibraries=("libintl.8.dylib" "libunistring.2.dylib") + +newlibs=() +for binary in "${indirectlibraries[@]}" +do + # Need to undo this for the dylibs when we are done + chmod 755 src/$binary + # find the dylibs to copy for komodod + DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` + echo "copying indirect $DYLIBS to $KMD_DIR" + # copy the dylibs to the dest dir + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; alllibs+=($dylib); done + #DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/lib" | awk -F' ' '{ print $1 }'` + # copy the other dylibs to the srcdir + #for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; alllibs+=($dylib); newlibs+=(`basename $dylib`); done +done + +# now process all the new libs we found indirectly +for binary in "${newlibs[@]}"; +do + # Need to undo this for the dylibs when we are done + chmod 755 src/$binary + # find the dylibs to copy for komodod + DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` + echo "copying indirect $DYLIBS to $KMD_DIR" + # copy the dylibs to the dest dir + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; alllibs+=($dylib); done + #DYLIBS=`otool -L $KMD_DIR/$binary | grep "/usr/lib" | awk -F' ' '{ print $1 }'` + # copy the other dylibs to the srcdir + #for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; alllibs+=($dylib); done +done for binary in "${binaries[@]}"; do - # find the dylibs to copy for komodod - DYLIBS=`otool -L src/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` - echo "copying $DYLIBS to $src" - # copy the dylibs to the srcdir - for dylib in $DYLIBS; do cp -rf $dylib src/; done - - # modify komodod to point to dylibs + # modify komododi or komodo-cli to point to dylibs echo "modifying $binary to use local libraries" - for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` src/$binary; done; - chmod +x src/$binary + for dylib in "${alllibs[@]}" + do + echo "Next lib is $dylib " + install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/$binary + done + chmod +x $KMD_DIR/$binary done + +libs=("${libraries[@]}" "${indirectlibraries[@]}" "${newlibs[@]}") +for binary in "${libs[@]}"; +do + # modify dylibs to point to dylibs + echo "modifying $binary to use local libraries" + for dylib in "${alllibs[@]}" + do + echo "Next lib is $dylib " + chmod 755 $KMD_DIR/$binary + install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/$binary + done + chmod +x $KMD_DIR/$binary +done + diff --git a/src/script/serverchecker.cpp b/src/script/serverchecker.cpp index 4de69001a..acff88450 100644 --- a/src/script/serverchecker.cpp +++ b/src/script/serverchecker.cpp @@ -12,6 +12,7 @@ #include "uint256.h" #include "util.h" +#undef __cpuid #include #include diff --git a/src/support/pagelocker.h b/src/support/pagelocker.h index cf42e3dfd..7385bc444 100644 --- a/src/support/pagelocker.h +++ b/src/support/pagelocker.h @@ -10,6 +10,7 @@ #include +#undef __cpuid #include #include diff --git a/src/sync.h b/src/sync.h index 68a944308..c9ba7f8b0 100644 --- a/src/sync.h +++ b/src/sync.h @@ -8,6 +8,7 @@ #include "threadsafety.h" +#undef __cpuid #include #include #include