Skip to content

Commit

Permalink
Merge pull request #1298 from hyperledger/support/1.2.x
Browse files Browse the repository at this point in the history
1.3-rc release candidate

Signed-off-by: kamilsa <[email protected]>
  • Loading branch information
kamilsa authored Sep 2, 2021
2 parents 9458be9 + 2b7b3f6 commit 7123e2b
Show file tree
Hide file tree
Showing 554 changed files with 33,148 additions and 21,378 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ DerivePointerAlignment: false
PointerAlignment: Right
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false

2 changes: 2 additions & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CMakeLists.txt
*.cmake
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
<!-- We must be able to understand the design of your change from this description. If we can't get a good idea of what the code will be doing from the description here, the pull request may be closed at the maintainers' discretion. -->
<!-- Keep in mind that the maintainer reviewing this PR may not be familiar with or have worked with the code here recently, so please walk us through the concepts. -->

### Issue

<!-- Put in the note about what issue is resolved by this PR, especially if it is a GitHub issue. It should be in the form of "Resolves #N" ("Closes", "Fixes" also work), where N is the number of the issue.
More information about this is available in GitHub documentation: https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword -->

<!-- If it is not a GitHub issue but a JIRA issue, just put the link here -->

### Benefits

<!-- What benefits will be realized by the code change? -->
Expand Down
File renamed without changes.
510 changes: 267 additions & 243 deletions .github/iroha1.inc.yml → .github/build-iroha1.src.yml

Large diffs are not rendered by default.

101 changes: 65 additions & 36 deletions .github/chatops-gen-matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
set -euo pipefail
shopt -s lastpipe

if test $(uname) = Darwin ;then
set -a # export the following funcs instead of aliases
sed() { gsed "$@"; }
grep() { ggrep "$@"; }
set +a # stop exporting
fi

echowarn(){
echo >&2 '::warning::'"$@"
}
Expand All @@ -21,6 +28,8 @@ EXAMPLE build_spec:
/build ubuntu release gcc10
/build macos llvm release
/build all
/build ubuntu all ## build all possible configurations on Ubuntu
/build ubuntu burrow all ## build all possible configurations on Ubuntu with Burrow
AVAILABLE build_spec keywords:
END
awk '/^\s*## BUILDSPEC ARGUMENTS/,/^\s*## END BUILDSPEC ARGUMENTS/ ' $0 | sed -n 's,).*,,gp' | sed -E 's,^ +, ,'
Expand All @@ -35,6 +44,7 @@ END
--help-buildspec
}

cmdline=
while [[ $# > 0 ]] ;do
case "$1" in
## ARGUMENTS
Expand All @@ -43,33 +53,16 @@ while [[ $# > 0 ]] ;do
;;
## END ARGUMENTS
*)
cmdline+="$1 "
;;
-*)
echoerr "Unknown argument '$1'"
exit 1
;;
esac
shift
done

generate(){
declare -rn DEFAULT_compilers=DEFAULT_${os}_compilers
declare -rn AVAILABLE_compilers=AVAILABLE_${os}_compilers
local compilers=${compilers:-$DEFAULT_compilers}
local cc bt op used_compilers=
for cc in $compilers ;do
if ! [[ " $AVAILABLE_compilers " = *" $cc "* ]] ;then
continue
fi
used_compilers+=$cc' '
for bt in $build_types ;do
for co in $cmake_opts ;do
MATRIX+="$os $cc $bt $co"$'\n'
done
done
done
if test "$used_compilers" = ''; then
echowarn "No available compilers for '$os' among '$compilers', available: '$AVAILABLE_compilers'"
fi
}

handle_user_line(){
if [[ "$@" = '' ]] ;then
return
Expand All @@ -95,20 +88,23 @@ handle_user_line(){
debug|Debug) build_types+=" Debug" ;;
gcc|gcc-9|gcc9) compilers+=" gcc-9 " ;;
gcc-10|gcc10) compilers+=" gcc-10 " ;;
clang|clang-10|clang10) compilers+=" clang-10" ;;
clang|clang-10|clang10) compilers+=" clang clang-10" ;;
llvm) compilers+=" $1 " ;;
clang) compilers+=" $1 " ;;
msvc) compilers+=" $1 " ;;
mingw) compilers+=" $1 " ;;
cygwin) compilers+=" $1 " ;;
dockerpush) dockerpush=yes ;;
nodockerpush) dockerpush=no ;;
all|everything|before_merge|before-merge)
oses="$ALL_oses" build_types="$ALL_build_types" cmake_opts="$ALL_cmake_opts" compilers="$ALL_compilers"
all|everything|beforemerge|before_merge|before-merge|readytomerge|ready-to-merge|ready_to_merge)
oses=${oses:-"$ALL_oses"}
build_types=${build_types:-"$ALL_build_types"}
cmake_opts=${cmake_opts:-"$ALL_cmake_opts"}
compilers=${compilers:-"$ALL_compilers"}
;;
## END BUILDSPEC ARGUMENTS
\#*)
break ## stop parsing buildspec
;;
*)
echoerr "Unknown /build argument '$1'"
echoerr "Unknown /build argument $(printf %q "$1")"
return 1
;;
esac
Expand All @@ -118,20 +114,53 @@ handle_user_line(){
oses=${oses:-$DEFAULT_oses}
build_types=${build_types:-$DEFAULT_build_types}
cmake_opts=${cmake_opts:-$DEFAULT_cmake_opts}

for os in $oses ;do
generate
declare -n DEFAULT_compilers=DEFAULT_${os}_compilers
declare -n AVAILABLE_compilers=AVAILABLE_${os}_compilers
local compilers=${compilers:-$DEFAULT_compilers}
local cc bt op used_compilers=
for cc in $compilers ;do
if ! [[ " $AVAILABLE_compilers " = *" $cc "* ]] ;then
continue
fi
used_compilers+=$cc' '
for bt in $build_types ;do
for co in $cmake_opts ;do
if test $os = macos -a $co = burrow; then continue; fi ##Reduce macos load on CI
if test $os = macos -a $co = ursa; then continue; fi ##Reduce macos load on CI
MATRIX+="$os $cc $bt $co"$'\n'
done
done
done
if test "$used_compilers" = ''; then
echowarn "No available compilers for '$os' among '$compilers', available: '$AVAILABLE_compilers'"
fi
done
}

while read input_line ;do
# if [[ "$input_line" =~ ^/build\ .* ]] ;then
handle_user_line $input_line || continue
# fi
done
{ test -n "$cmdline" && echo "$cmdline" || cat; } |
tr ';' '\n' | while read input_line ;do
handle_user_line $input_line || continue
done

test -n "${MATRIX:-}" ||
{ echoerr "MATRIX is empty!"; --help-buildspec >&2; exit 1; }
{ echoerr "MATRIX is empty!"$'\n'; --help-buildspec >&2; exit 1; }


############# FIXME remove this after build fixed #############
quoted(){
while read line ;do echo -n "'$line' " ;done
}
ignored=$(mktemp)
echo "$MATRIX" | awk -v IGNORECASE=1 '/clang-10/ && /release/' >$ignored
MATRIX="$( grep -Fvx -f $ignored <<<"$MATRIX" )"
if test -s $ignored
then cat $ignored | quoted | echowarn "FIXME At the moment NOT able to build Release with Clang-10," \
"because civetweb-cpp from vcpkg. Buildspecs are dropped: $(cat)"
fi
rm -f $ignored
############# END fixme remove this after build fixed #########


to_json(){
echo "{
Expand Down
5 changes: 0 additions & 5 deletions .github/iroha1-on-issue-comment.src.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/iroha1-on-pull-request.src.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .github/iroha1-on-push.src.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .github/iroha1-on-schedule.src.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .github/iroha1-on-workflow-dispatch.src.yml

This file was deleted.

18 changes: 2 additions & 16 deletions .github/make-workflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,6 @@ make-workflows:
Deals only with Git cached/indexed files until --no-git-index passed.
DEBUG: use option -x
NOTE: spaces in filenames are not allowed to keep code simplicity
TODO: report "xxx.yaml in output directory 'workflows' has no source"
FIXME: Merge operation on two YAMLs has bug in latest version 4, so version 3 required
On Mac
wget https://github.com/mikefarah/yq/releases/download/3.4.1/yq_darwin_amd64 -O /usr/local/bin/yq-3 &&
chmod +x /usr/local/bin/yq-3
On Linux
wget https://github.com/mikefarah/yq/releases/download/3.4.1/yq_linux_amd64 -O /usr/local/bin/yq-3 &&
chmod +x /usr/local/bin/yq-3
END
cat<<END
Usage:
Expand All @@ -37,6 +28,7 @@ END

files_list(){
git diff --cached --name-only --relative --diff-filter=d -- "$@"
## NOTE: --diff-filter=d to exclude deleted files
}
file_contents(){
git show $(printf ":%s " $@)
Expand Down Expand Up @@ -86,10 +78,8 @@ readonly dir_to=$(realpath $dir_to)
edited_files=

for dir_from in $dirs_from ;do
#echo >&2 "-- make-workflows: Processing directory '$dir_from'"
pushd $dir_from >/dev/null
for f in $(files_list '*.src.yml') ;do
echo >&2 "-- make-workflows: Processing file '$f'"
out=$(echo $f | sed 's|.src.yml$|.yml|')
wout=$dir_to/$out
tempout=$(mktemp)
Expand All @@ -98,11 +88,7 @@ for dir_from in $dirs_from ;do
echo >>$tempout "## Generated from $f with $(basename $0)"
echo >>$tempout ""
## Take cached content from index
file_contents ./$f |
yq-3 merge -x *.inc.yml - |
yq-3 read --explodeAnchors - >>$tempout
#FIXME yq eval-all '. as $item ireduce ({}; (. *+ $item) | .on = $item.on)' \
#FIXME *.inc.yml - >>$tempout
file_contents ./$f | yq eval 'explode(.)' - >>$tempout
if ! diff -q $wout $tempout &>/dev/null ;then
mv $tempout $wout
edited_files+="'$(realpath --relative-to=$OLDPWD $wout)' "
Expand Down
Loading

0 comments on commit 7123e2b

Please sign in to comment.