From 9f2e84976e1ecfb180063142e93aefcf2741873b Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 09:31:06 -0700 Subject: [PATCH 01/18] Version to 0.3.6 --- kmd/linux/verus-cli/README.txt | 2 +- kmd/mac/verus-cli/README.txt | 2 +- kmd/windows/verus-cli/README.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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/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 From 464a17ce6924c27ff457f5a052130cde64e91825 Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 10:18:08 -0700 Subject: [PATCH 02/18] Get recursive dependencies --- makeRelease.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/makeRelease.sh b/makeRelease.sh index 510314e97..bcc37028a 100755 --- a/makeRelease.sh +++ b/makeRelease.sh @@ -15,3 +15,40 @@ do for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` src/$binary; done; chmod +x src/$binary done + +libaries=("libgcc_s.1.dylib" "libgomp.1.dylib" "libidn2.0.dylib" "ibstdc++.6.dylib") + +for binary in "${libraries[@]}"; +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 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 binary or dylib 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 +done + +indirectlibaries=("libintl.8.dylib" "libunistring.2.dylib") + +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 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 binary or dylib 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 +done + From 17eb369969b83c70a2d09c5816874208d5232b58 Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 10:47:23 -0700 Subject: [PATCH 03/18] Get dependencies of dependencies to the second generation. --- kmd/mac/verus-cli/Brewfile | 5 ----- makeRelease.sh | 43 +++++++++++++++----------------------- 2 files changed, 17 insertions(+), 31 deletions(-) delete mode 100644 kmd/mac/verus-cli/Brewfile 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/makeRelease.sh b/makeRelease.sh index bcc37028a..8a3696d4a 100755 --- a/makeRelease.sh +++ b/makeRelease.sh @@ -1,54 +1,45 @@ #!/bin/sh - + +KMD_DIR=kmd/mac/verus-cli binaries=("komodo-cli" "komodod") for binary in "${binaries[@]}"; do - # find the dylibs to copy for komodod + # find the dylibs to copy for komodod DYLIBS=`otool -L src/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` - echo "copying $DYLIBS to $src" + echo "copying $DYLIBS to $KMD_DIR" # copy the dylibs to the srcdir - for dylib in $DYLIBS; do cp -rf $dylib src/; done + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; done # modify komodod 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 $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/$binary; done; + chmod +x $KMD_DIR/$binary done -libaries=("libgcc_s.1.dylib" "libgomp.1.dylib" "libidn2.0.dylib" "ibstdc++.6.dylib") +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 src/$binary - # find the dylibs to copy for komodod - DYLIBS=`otool -L src/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` - echo "copying $DYLIBS to $src" + 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 src/; done - - # modify binary or dylib 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 $DYLIBS; do cp -rf $dylib $KMD_DIR; done done -indirectlibaries=("libintl.8.dylib" "libunistring.2.dylib") +indirectlibraries=("libintl.8.dylib" "libunistring.2.dylib") 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 src/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` - echo "copying $DYLIBS to $src" + 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 src/; done - - # modify binary or dylib 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 $DYLIBS; do cp -rf $dylib $KMD_DIR; done done From 7f21e75135386c022cba2703ab553868c9483723 Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 11:01:49 -0700 Subject: [PATCH 04/18] Clean up makeRelease more. --- makeRelease.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/makeRelease.sh b/makeRelease.sh index 8a3696d4a..700961a83 100755 --- a/makeRelease.sh +++ b/makeRelease.sh @@ -23,11 +23,16 @@ 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 + # 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" + echo "copying indirect $DYLIBS to $KMD_DIR" # copy the dylibs to the srcdir for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; done + echo "modifying komodod to use local libraries" + for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/komodod; done; + chmod +x $KMD_DIR/komodod + for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/komodo-cli; done; + chmod +x $KMD_DIR/komodo-cli done indirectlibraries=("libintl.8.dylib" "libunistring.2.dylib") @@ -41,5 +46,11 @@ do echo "copying $DYLIBS to $KMD_DIR" # copy the dylibs to the srcdir for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; done + # fix binary references to it + echo "modifying komodod to use local libraries" + for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/komodod; done; + chmod +x $KMD_DIR/komodod + for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/komodo-cli; done; + chmod +x $KMD_DIR/komodo-cli done From c444a898ec29952f66a025d3a2641024d9628bee Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 11:35:00 -0700 Subject: [PATCH 05/18] Fi makeRelease: get libs over, then tweak komodod and komodo-cli. --- makeRelease.sh | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/makeRelease.sh b/makeRelease.sh index 700961a83..f2ba567d8 100755 --- a/makeRelease.sh +++ b/makeRelease.sh @@ -2,19 +2,14 @@ KMD_DIR=kmd/mac/verus-cli binaries=("komodo-cli" "komodod") - +alllibs=() 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 $KMD_DIR" # copy the dylibs to the srcdir - for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; done - - # modify komodod 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` $KMD_DIR/$binary; done; - chmod +x $KMD_DIR/$binary + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; allibs+=dylib; done done libraries=("libgcc_s.1.dylib" "libgomp.1.dylib" "libidn2.0.dylib" "libstdc++.6.dylib") @@ -27,12 +22,7 @@ do 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 srcdir - for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; done - echo "modifying komodod to use local libraries" - for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/komodod; done; - chmod +x $KMD_DIR/komodod - for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/komodo-cli; done; - chmod +x $KMD_DIR/komodo-cli + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; allibs+=dylib; done done indirectlibraries=("libintl.8.dylib" "libunistring.2.dylib") @@ -45,12 +35,14 @@ do 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 - # fix binary references to it - echo "modifying komodod to use local libraries" - for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/komodod; done; - chmod +x $KMD_DIR/komodod - for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/komodo-cli; done; - chmod +x $KMD_DIR/komodo-cli + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; allibs+=dylib; done +done + +for binary in "${binaries[@]}"; +do + # modify komodod to point to dylibs + echo "modifying $binary to use local libraries" + for dylib in "${allibs[@]}"; do install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/$binary; done; + chmod +x $KMD_DIR/$binary done From 238baa0995e98beead2b56029db0548946954112 Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 11:43:17 -0700 Subject: [PATCH 06/18] Fix scrupting issues. --- makeRelease.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/makeRelease.sh b/makeRelease.sh index f2ba567d8..c985890b2 100755 --- a/makeRelease.sh +++ b/makeRelease.sh @@ -9,7 +9,7 @@ do DYLIBS=`otool -L src/$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; allibs+=dylib; done + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; allibs+=($dylib); done done libraries=("libgcc_s.1.dylib" "libgomp.1.dylib" "libidn2.0.dylib" "libstdc++.6.dylib") @@ -22,7 +22,7 @@ do 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 srcdir - for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; allibs+=dylib; done + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; allibs+=($dylib); done done indirectlibraries=("libintl.8.dylib" "libunistring.2.dylib") @@ -35,14 +35,18 @@ do 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; allibs+=dylib; done + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; allibs+=($dylib); done done for binary in "${binaries[@]}"; do # modify komodod to point to dylibs echo "modifying $binary to use local libraries" - for dylib in "${allibs[@]}"; do install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/$binary; done; + for dylib in "${allibs[@]}"; + 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 From c2d0ef72e8658477b3a559fe0ed682879b89bc75 Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 13:38:33 -0700 Subject: [PATCH 07/18] Closing in on correct parameters. --- makeRelease.sh | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/makeRelease.sh b/makeRelease.sh index c985890b2..6686278f3 100755 --- a/makeRelease.sh +++ b/makeRelease.sh @@ -1,15 +1,18 @@ #!/bin/sh KMD_DIR=kmd/mac/verus-cli + binaries=("komodo-cli" "komodod") alllibs=() for binary in "${binaries[@]}"; do - # find the dylibs to copy for komodod - DYLIBS=`otool -L src/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` + # 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; allibs+=($dylib); done + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; done done libraries=("libgcc_s.1.dylib" "libgomp.1.dylib" "libidn2.0.dylib" "libstdc++.6.dylib") @@ -20,9 +23,9 @@ do 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 indirect $DYLIBS to $KMD_DIR" + echo "copying $DYLIBS to $KMD_DIR" # copy the dylibs to the srcdir - for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; allibs+=($dylib); done + for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; alllibs+=($dylib); done done indirectlibraries=("libintl.8.dylib" "libunistring.2.dylib") @@ -33,20 +36,23 @@ do 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 $DYLIBS to $KMD_DIR" - # copy the dylibs to the srcdir - for dylib in $DYLIBS; do cp -rf $dylib $KMD_DIR; allibs+=($dylib); done + 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+=(i$dylib); done done for binary in "${binaries[@]}"; do # modify komodod to point to dylibs echo "modifying $binary to use local libraries" - for dylib in "${allibs[@]}"; + i=0 + for dylib in "${alllibs[@]}" do - echo "Next lib is $dylib " - install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/$binary; - done; + let i=i+1 + echo "Next lib is $dylib " + + install_name_tool -change $dylib @executable_path/`basename $dylib` $KMD_DIR/$binary + done chmod +x $KMD_DIR/$binary done From f88321215b71f2965cd8cf70082e7fcfc034c94c Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 14:21:51 -0700 Subject: [PATCH 08/18] More fiddling. --- makeRelease.sh | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/makeRelease.sh b/makeRelease.sh index 6686278f3..0cfecf8ed 100755 --- a/makeRelease.sh +++ b/makeRelease.sh @@ -13,6 +13,9 @@ do 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") @@ -26,11 +29,15 @@ do 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") -for binary in "${indirectlibraries[@]}"; +newlibs=() +for binary in "${indirectlibraries[@]}" do # Need to undo this for the dylibs when we are done chmod 755 src/$binary @@ -38,19 +45,48 @@ do 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+=(i$dylib); done + 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 - # modify komodod to point to dylibs + # modify komododi or komodo-cli to point to dylibs echo "modifying $binary to use local libraries" - i=0 for dylib in "${alllibs[@]}" do - let i=i+1 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 From c5a53ecb243bf6134589d9755c4766bb765843fd Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 15:45:01 -0700 Subject: [PATCH 09/18] Use Windows specific __cpuid() for Windows. --- src/crypto/verus_hash.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/crypto/verus_hash.h b/src/crypto/verus_hash.h index 85f3c4830..e68b0b35e 100644 --- a/src/crypto/verus_hash.h +++ b/src/crypto/verus_hash.h @@ -11,7 +11,9 @@ This provides the PoW hash function for Verus, enabling CPU mining. #include #include +#if !XERCES_HAVE_INTRIN_H #include +#endif extern "C" { @@ -94,8 +96,16 @@ extern void verus_hash(void *result, const void *data, size_t len); inline bool IsCPUVerusOptimized() { unsigned int eax,ebx,ecx,edx; - +#ifdef _WIN32 + int CPUInfo[4]; + CPUInfo[0] = &eax; + CPUInfo[1] = &ebx; + CPUInfo[2] = &ecx; + CPUInfo[3] = &edx; + if (!__get_cpuid(CPUInfo, 1)) +#else if (!__get_cpuid(1,&eax,&ebx,&ecx,&edx)) +#endif { return false; } From 8ef8d54b0d98d705bcb19b1de16a6037111f36f4 Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 15:52:30 -0700 Subject: [PATCH 10/18] Unsigned, dang it. --- src/crypto/verus_hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/verus_hash.h b/src/crypto/verus_hash.h index e68b0b35e..c66d75e79 100644 --- a/src/crypto/verus_hash.h +++ b/src/crypto/verus_hash.h @@ -97,7 +97,7 @@ inline bool IsCPUVerusOptimized() { unsigned int eax,ebx,ecx,edx; #ifdef _WIN32 - int CPUInfo[4]; + unsigned int CPUInfo[4]; CPUInfo[0] = &eax; CPUInfo[1] = &ebx; CPUInfo[2] = &ecx; From 8271276fd22a53bc1eb3e04982fde32c9882deff Mon Sep 17 00:00:00 2001 From: Asher Dawes Date: Sat, 16 Jun 2018 16:01:44 -0700 Subject: [PATCH 11/18] Troubleshooting Windows cpu id --- src/crypto/verus_hash.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/crypto/verus_hash.h b/src/crypto/verus_hash.h index c66d75e79..9025e053b 100644 --- a/src/crypto/verus_hash.h +++ b/src/crypto/verus_hash.h @@ -98,11 +98,11 @@ inline bool IsCPUVerusOptimized() unsigned int eax,ebx,ecx,edx; #ifdef _WIN32 unsigned int CPUInfo[4]; - CPUInfo[0] = &eax; - CPUInfo[1] = &ebx; - CPUInfo[2] = &ecx; - CPUInfo[3] = &edx; - if (!__get_cpuid(CPUInfo, 1)) + CPUInfo[0] = (unsigned int) &eax; + CPUInfo[1] = (unsigned int) &ebx; + CPUInfo[2] = (unsigned int) &ecx; + CPUInfo[3] = (unsigned int) &edx; + if (!__get_cpuid(CPUInfo, (unsigned int) 1)) #else if (!__get_cpuid(1,&eax,&ebx,&ecx,&edx)) #endif From 3fd40915ac2fd464175e958775749bd28b7f9660 Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 16:13:37 -0700 Subject: [PATCH 12/18] Approach not helping, trying the other direction. --- src/crypto/verus_hash.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/crypto/verus_hash.h b/src/crypto/verus_hash.h index c66d75e79..9b2c79b86 100644 --- a/src/crypto/verus_hash.h +++ b/src/crypto/verus_hash.h @@ -11,9 +11,7 @@ This provides the PoW hash function for Verus, enabling CPU mining. #include #include -#if !XERCES_HAVE_INTRIN_H #include -#endif extern "C" { @@ -96,16 +94,7 @@ extern void verus_hash(void *result, const void *data, size_t len); inline bool IsCPUVerusOptimized() { unsigned int eax,ebx,ecx,edx; -#ifdef _WIN32 - unsigned int CPUInfo[4]; - CPUInfo[0] = &eax; - CPUInfo[1] = &ebx; - CPUInfo[2] = &ecx; - CPUInfo[3] = &edx; - if (!__get_cpuid(CPUInfo, 1)) -#else if (!__get_cpuid(1,&eax,&ebx,&ecx,&edx)) -#endif { return false; } From 16201a68c71bc63e28cdd72623a05b5c656cbc65 Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 16:23:42 -0700 Subject: [PATCH 13/18] Undo inadvertent delete --- src/crypto/verus_hash.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/crypto/verus_hash.h b/src/crypto/verus_hash.h index 9b2c79b86..d58827519 100644 --- a/src/crypto/verus_hash.h +++ b/src/crypto/verus_hash.h @@ -94,6 +94,7 @@ extern void verus_hash(void *result, const void *data, size_t len); inline bool IsCPUVerusOptimized() { unsigned int eax,ebx,ecx,edx; + if (!__get_cpuid(1,&eax,&ebx,&ecx,&edx)) { return false; From 4b054f2494d4f374f31ba7abca8a81b55b8642ff Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 16:24:20 -0700 Subject: [PATCH 14/18] Undo the changes --- src/crypto/verus_hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/verus_hash.h b/src/crypto/verus_hash.h index d58827519..85f3c4830 100644 --- a/src/crypto/verus_hash.h +++ b/src/crypto/verus_hash.h @@ -94,7 +94,7 @@ extern void verus_hash(void *result, const void *data, size_t len); inline bool IsCPUVerusOptimized() { unsigned int eax,ebx,ecx,edx; - + if (!__get_cpuid(1,&eax,&ebx,&ecx,&edx)) { return false; From 553727a86b272f8cb5a810f7c0f837484107a4ff Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 17:08:59 -0700 Subject: [PATCH 15/18] Fiddling with __cpuid --- src/support/pagelocker.h | 1 + 1 file changed, 1 insertion(+) 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 From 8d3dd709dae89edfe3dcebd18d0d9671349fd0c3 Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 17:19:25 -0700 Subject: [PATCH 16/18] Remove another __cpuid conflict. --- src/sync.h | 1 + 1 file changed, 1 insertion(+) 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 From 9892a1762a6444afa0df301dd418db7f95be66fd Mon Sep 17 00:00:00 2001 From: Asher Dawes Date: Sat, 16 Jun 2018 17:24:33 -0700 Subject: [PATCH 17/18] Removing unnecessary step in build mac job and adding sast and code quality check --- .gitlab-ci.yml | 60 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 16 deletions(-) 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] From 67edc9df031b99fa1cf929b4c0e12010163ae531 Mon Sep 17 00:00:00 2001 From: David Dawes Date: Sat, 16 Jun 2018 17:31:54 -0700 Subject: [PATCH 18/18] Another __cpuid() conflict. --- src/script/serverchecker.cpp | 1 + 1 file changed, 1 insertion(+) 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