From 4a7d279a275e6e8241ad80ba6888ce2ebe6e6d32 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 9 Apr 2019 17:43:30 -0700 Subject: [PATCH 1/6] support src-one target and backlevel icus - added some extra .gitignores for other branches Fixes: https://github.com/unicode-org/icu-docker/issues/12 --- .gitignore | 4 ++ Makefile | 39 +++++++++++--- README.md | 4 ++ src/bin/check-icu4c-version.sh | 14 +++++ src/bin/check.sh | 10 +++- src/bin/dist_icu64.mk | 99 ++++++++++++++++++++++++++++++++++ src/bin/icu-dev.sh | 2 + src/bin/makesrc.sh | 46 ++++++++++++++++ 8 files changed, 209 insertions(+), 9 deletions(-) create mode 100755 src/bin/check-icu4c-version.sh create mode 100644 src/bin/dist_icu64.mk create mode 100755 src/bin/makesrc.sh diff --git a/.gitignore b/.gitignore index ba0668b..53d732e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,7 @@ *.log /local src/tmp +/src/bin/cov-* +/Makefile.local +/pretest-run.pl +/src/bin/local-* diff --git a/Makefile b/Makefile index cd8ecf5..c632e13 100644 --- a/Makefile +++ b/Makefile @@ -5,15 +5,22 @@ DIRS=tmp src tmp/.ccache dist ICU_REPO=http://source.icu-project.org/repos/icu/trunk BINPATH=/src/bin/ +# the 'full' list DISTROS=$(shell cd dockerfiles;ls) +# the 'small' list. The first one is primary. DISTROS_SMALL=ubuntu fedora SRC=src/icu -REV:=$(shell (cd $(SRC) && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)) || echo 'unknown') +REV:=$(shell (cd $(SRC) >/dev/null 2>/dev/null && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)) || echo 'unknown') +#icu4c version +ICU4CVER:=$(shell ./$(BINPATH)/check-icu4c-version.sh $(SRC)/icu4c ) all: dirs src/icu #src/icu: src # if [ ! -f src/icu ]; then do cd src ; svn co $(ICU_REPO) icu; done +info: + echo rev $(REV) cver $(ICU4CVER) + dirs: mkdir -p $(DIRS) tmp/.ccache chmod a+rwxt tmp/.ccache dist @@ -27,7 +34,7 @@ build-all: all echo $$distro ; \ ( docker-compose run $$distro bash $(BINPATH)/build.sh || exit 1); \ done - echo all OK + echo all OK $(ICU4CVER) check-all: all for distro in $(DISTROS); do \ @@ -35,7 +42,7 @@ check-all: all rm -f $$distro.fail ; \ ( docker-compose run $$distro bash $(BINPATH)/check.sh || (>$$distro.fail; exit 1)) >&1 | tee $$distro.out; \ done - echo all OK + echo all OK $(ICU4CVER) check-some: all for distro in $(DISTROS_SMALL); do \ @@ -43,37 +50,53 @@ check-some: all rm -f $$distro.fail ; \ ( docker-compose run $$distro bash $(BINPATH)/check.sh || (>$$distro.fail; exit 1)) >&1 | tee $$distro.out; \ done - echo all OK + echo all OK $(ICU4CVER) dist-all: all for distro in $(DISTROS); do \ echo $$distro ; \ ( docker-compose run $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makedist.sh $$distro || exit 1); \ done - echo all OK + echo all OK $(ICU4CVER) dist-some: all for distro in $(DISTROS_SMALL); do \ echo $$distro ; \ ( docker-compose run $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makedist.sh $$distro || exit 1); \ done - echo all OK + echo all OK $(ICU4CVER) dist: sdist dist-some +# just source tarballs. A little more resilient to version changes. +src-some: all + for distro in $(DISTROS_SMALL); do \ + echo $$distro ; \ + ( docker-compose run $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesrc.sh $$distro || exit 1); \ + done + echo all OK $(ICU4CVER) + +# just source tarballs. A little more resilient to version changes. +src-one: all + for distro in $(firstword $(DISTROS_SMALL)); do \ + echo $$distro ; \ + ( docker-compose run $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesrc.sh $$distro || exit 1); \ + done + echo all OK $(ICU4CVER) + sdist: all for distro in $(firstword $(DISTROS_SMALL)); do \ echo $$distro ; \ ( docker-compose run $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesdoc.sh $$distro || exit 1); \ done - echo all OK + echo all OK $(ICU4CVER) perf-all: all for distro in $(DISTROS); do \ echo $$distro ; \ ( docker-compose run $$distro bash $(BINPATH)/perf.sh $$distro || exit 1); \ done - echo all OK + echo all OK $(ICU4CVER) .PHONY: all dirs build-all dbuild diff --git a/README.md b/README.md index f97f8d5..86215c6 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,10 @@ this will make error messages work checking for ICU version numbers... ``` +- just build tarballs (can work on older releases) + + make src-one + ## Author Steven R. Loomis diff --git a/src/bin/check-icu4c-version.sh b/src/bin/check-icu4c-version.sh new file mode 100755 index 0000000..4335084 --- /dev/null +++ b/src/bin/check-icu4c-version.sh @@ -0,0 +1,14 @@ +#!/bin/sh +if [ $# -ne 0 ]; +then + cd $1 + shift +fi + +if [ ! -f ./source/common/unicode/uversion.h ]; +then + echo "unknown-no-uversion" + exit 1 +fi +( grep -h "^#define U_ICU_VERSION " ./source/common/unicode/uvernum.h || echo unknown-no-define) | cut -d' ' -f3 | tr -d '"' +exit 0 diff --git a/src/bin/check.sh b/src/bin/check.sh index e5c560b..8200f11 100755 --- a/src/bin/check.sh +++ b/src/bin/check.sh @@ -6,4 +6,12 @@ then icu-configure.sh || exit 1 fi -exec make -j${CORES} pcheck +# pcheck was added in 52.1 +if [ ${ICU4CMAJ} -gt 51 ]; +then + VERB=pcheck +else + VERB=check +fi + +exec make -j${CORES} ${VERB} diff --git a/src/bin/dist_icu64.mk b/src/bin/dist_icu64.mk new file mode 100644 index 0000000..95e4fdd --- /dev/null +++ b/src/bin/dist_icu64.mk @@ -0,0 +1,99 @@ +# Copyright (C) 2016 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html +#****************************************************************************** +# +# Copyright (C) 2010-2011, International Business Machines Corporation and others. All Rights Reserved. +# +#****************************************************************************** +# This is to be called from ../Makefile.in +# +# This will only work if subversion is installed. +# You must checkout ICU4C at the `/icu` or `/icu/icu4c` level - not just `…/source` +# also note that `make dist` does NOT reflect any local modifications, but pulls from HEAD. + +top_builddir = . + +include $(top_builddir)/icudefs.mk + +ICU_MAJ_VERSION:=$(shell echo $(VERSION) | cut -d. -f1) +DISTY_DIR=dist +DISTY_TMP=dist/tmp +DISTY_ICU=$(DISTY_TMP)/icu +DISTY_DATA=$(DISTY_ICU)/source/data +# The following line controls what is removed in the data/ subdirectory for the source tarball. +DISTY_RMV=brkitr coll curr lang locales mappings rbnf region translit xml zone misc/*.txt misc/*.mk unit +DISTY_RMDIR=$(DISTY_RMV:%=$(DISTY_DATA)/%) +DISTY_IN=$(DISTY_DATA)/in +DOCZIP=icu-docs.zip + +ICU4CTOP=$(top_srcdir)/.. +GITVER=$(shell (cd $(ICU4CTOP) && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)) || echo 'unknown') +DISTY_VER=$(shell echo $(VERSION) | tr '.' '_' ) +DISTY_PREFIX=icu4c +DISTY_FILE_DIR=$(shell pwd)/$(DISTY_DIR) +DISTY_FILE_TGZ=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-$(DISTY_VER)-$(GITVER)-src.tgz +DISTY_FILE_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-$(DISTY_VER)-$(GITVER)-src.zip +DISTY_DOC_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-$(DISTY_VER)-$(GITVER)-docs.zip +DISTY_DATA_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-$(DISTY_VER)-$(GITVER)-data.zip +DISTY_DAT:=$(firstword $(wildcard data/out/tmp/icudt$(SO_TARGET_VERSION_MAJOR)*.dat)) + +DISTY_FILES_SRC=$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP) +DISTY_FILES=$(DISTY_FILES_SRC) $(DISTY_DOC_ZIP) +# colon-equals because we watn to run this once! +EXCLUDES_FILE:=$(shell mktemp) + +$(DISTY_FILE_DIR): + $(MKINSTALLDIRS) $(DISTY_FILE_DIR) + +$(DISTY_TMP): + $(MKINSTALLDIRS) $(DISTY_TMP) + +$(DISTY_DOC_ZIP): $(DOCZIP) $(DISTY_FILE_DIR) + cp $(DOCZIP) $(DISTY_DOC_ZIP) + ln -sf $(shell basename $(DISTY_DOC_ZIP)) $(DISTY_FILE_DIR)/icu4c-docs.zip + ln -f $(DISTY_DOC_ZIP) $(DISTY_FILE_DIR)/icu4c-$(DISTY_VER)-docs.zip + +$(DISTY_DAT): + echo Missing $@ + /bin/false + +# make sure we get the non-lgpl docs +$(DOCZIP): + -$(RMV) "$(top_builddir)"/doc + "$(MAKE)" -C . srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" builddir=. $@ + +$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP) $(DISTY_DATA_ZIP): $(DISTY_DAT) $(DISTY_TMP) + @echo Export icu4c@$(GITVER) to "$(DISTY_TMP)/icu" + -$(RMV) $(DISTY_FILE) $(DISTY_TMP) + $(MKINSTALLDIRS) $(DISTY_TMP) + ( cd $(ICU4CTOP)/.. && git archive --format=tar --prefix=icu/ HEAD:icu4c/ ) | ( cd "$(DISTY_TMP)" && tar xf - ) + ( cd $(DISTY_TMP)/icu/source ; zip -rlq $(DISTY_DATA_ZIP) data ) + $(MKINSTALLDIRS) $(DISTY_IN) + echo DISTY_DAT=$(DISTY_DAT) + cp $(DISTY_DAT) $(DISTY_IN) + $(RMV) $(DISTY_RMDIR) + ( cd $(DISTY_TMP)/icu ; python as_is/bomlist.py > as_is/bomlist.txt || rm -f as_is/bomlist.txt ) + ( cd $(DISTY_TMP) ; tar cfpz $(DISTY_FILE_TGZ) icu ) + ( cd $(DISTY_TMP) ; zip -rlq $(DISTY_FILE_ZIP) icu ) + $(RMV) $(DISTY_TMP) + ln -sf $(shell basename $(DISTY_FILE_ZIP)) $(DISTY_FILE_DIR)/icu4c-src.zip + ln -sf $(shell basename $(DISTY_FILE_TGZ)) $(DISTY_FILE_DIR)/icu4c-src.tgz + ln -sf $(shell basename $(DISTY_DATA_ZIP)) $(DISTY_FILE_DIR)/icu4c-data.zip + ln -f $(DISTY_FILE_ZIP) $(DISTY_FILE_DIR)/icu4c-$(DISTY_VER)-src.zip + ln -f $(DISTY_FILE_TGZ) $(DISTY_FILE_DIR)/icu4c-$(DISTY_VER)-src.tgz + ln -f $(DISTY_DATA_ZIP) $(DISTY_FILE_DIR)/icu4c-$(DISTY_VER)-data.zip + ls -l $(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP) $(DISTY_DATA_ZIP) + + +dist-local: $(DISTY_FILES) + +distcheck: distcheck-tgz + +DISTY_CHECK=$(DISTY_TMP)/check + +distcheck-tgz: $(DISTY_FILE_TGZ) + @echo Checking $(DISTY_FILE_TGZ) + @-$(RMV) $(DISTY_CHECK) + @$(MKINSTALLDIRS) $(DISTY_CHECK) + @(cd $(DISTY_CHECK) && tar xfpz $(DISTY_FILE_TGZ) && cd icu/source && $(SHELL) ./configure $(DISTCHECK_CONFIG_OPTIONS) && $(MAKE) $(DISTCHECK_MAKE_OPTIONS) && $(MAKE) check $(DISTCHECK_MAKE_OPTIONS) ) && (echo "!!! PASS: $(DISTY_FILE_TGZ)" ) + diff --git a/src/bin/icu-dev.sh b/src/bin/icu-dev.sh index 71ab679..22298f8 100644 --- a/src/bin/icu-dev.sh +++ b/src/bin/icu-dev.sh @@ -5,6 +5,8 @@ # setup some vars export CORES=$(grep -c ^processor /proc/cpuinfo) export PATH=/src/bin:${PATH} +export ICU4CVER=$(/src/bin/check-icu4c-version.sh /src/icu/icu4c) +export ICU4CMAJ=$(echo ${ICU4CVER} | cut -d. -f1) # colored output doesn't work as well from here export TERM= diff --git a/src/bin/makesrc.sh b/src/bin/makesrc.sh new file mode 100755 index 0000000..dde2ead --- /dev/null +++ b/src/bin/makesrc.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# © 2016 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + +. /src/bin/icu-dev.sh + +set -x +if [ ! -f config.status ]; +then + icu-configure.sh --disable-tests --disable-extras || exit 1 +fi + + +if [ -f /etc/os-release ]; +then + . /etc/os-release +fi +# the name of the dist/ directory +FN=icu-${ICU4CVER}-${REV}-$(bash /src/icu/icu4c/source/config.guess)-${NAME-${WHAT}}-${VERSION_ID-UNKNOWN} + +rm -rf dist /dist/${FN}-src.d || true + +# first, build +make -j${CORES} || exit 1 + +# now, source +if [ ${ICU4CMAJ} -lt 64 ]; +then + # use modified ICU 64 dist.mk + make -C . -f /src/bin/dist_icu64.mk srcdir=/src/icu/icu4c/source top_srcdir=/src/icu/icu4c/source dist-local +else + # by ICU 64, there's a reasonable make dist + make dist +fi + +mv -v dist /dist/${FN}-src.d + +rm -rf doc + +# make doc-searchengine + +# #FN=icu-r$(svnversion /src/icu/ | tr -d ' ')-$(bash /src/icu/icu4c/source/config.guess)-${1:RANDOM} +# tar cfpz /dist/${FN}-sdoc.tgz ./doc || exit 1 +#cd /dist +#md5sum ${FN}.tgz | tee ${FN}.tgz.md5 + From 1f31b84a5cbbcbe6471ee17bdc5eb23078f774a0 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 11 Apr 2019 12:17:47 -0700 Subject: [PATCH 2/6] update for review comment - also add a workaround for icu 58/59 Fixes: https://github.com/unicode-org/icu-docker/issues/12 --- src/bin/check-icu4c-version.sh | 7 +++++-- src/bin/icu-configure.sh | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/bin/check-icu4c-version.sh b/src/bin/check-icu4c-version.sh index 4335084..70c0352 100755 --- a/src/bin/check-icu4c-version.sh +++ b/src/bin/check-icu4c-version.sh @@ -1,14 +1,17 @@ #!/bin/sh +# © 2016 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html + if [ $# -ne 0 ]; then cd $1 shift fi -if [ ! -f ./source/common/unicode/uversion.h ]; +if [ ! -f source/common/unicode/uversion.h ]; then echo "unknown-no-uversion" exit 1 fi -( grep -h "^#define U_ICU_VERSION " ./source/common/unicode/uvernum.h || echo unknown-no-define) | cut -d' ' -f3 | tr -d '"' +( grep "^#define U_ICU_VERSION " source/common/unicode/uvernum.h || echo unknown-no-define) | cut -d' ' -f3 | tr -d '"' exit 0 diff --git a/src/bin/icu-configure.sh b/src/bin/icu-configure.sh index 6fb405a..550b2e4 100755 --- a/src/bin/icu-configure.sh +++ b/src/bin/icu-configure.sh @@ -3,4 +3,19 @@ # License & terms of use: http://www.unicode.org/copyright.html . /src/bin/icu-dev.sh -exec ${SHELL} /src/icu/icu4c/source/configure $* +if [ $ICU4CMAJ = 58 ]; +then + # workaround for xlocale + CONFIGSTUFF="CPPFLAGS=-DU_USE_STRTOD_L=0" +elif [ $ICU4CMAJ = 59 ]; +then + # workaround for xlocale + CONFIGSTUFF="CPPFLAGS=-DU_USE_STRTOD_L=0" +else + CONFIGSTUFF= +fi + +echo configure options $CONFIGSTUFF $EXTRACONFIGSTUFF + +exec ${SHELL} /src/icu/icu4c/source/configure $CONFIGSTUFF $EXTRACONFIGSTUFF $* || (tail config.log ; exit 1) + From 399a118ef7e728e435547d0ec8a968bd55408edd Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 11 Apr 2019 12:18:58 -0700 Subject: [PATCH 3/6] version --- src/bin/makesrc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/makesrc.sh b/src/bin/makesrc.sh index dde2ead..0d12438 100755 --- a/src/bin/makesrc.sh +++ b/src/bin/makesrc.sh @@ -1,5 +1,5 @@ #!/bin/sh -# © 2016 and later: Unicode, Inc. and others. +# © 2019 and later: Unicode, Inc. and others. # License & terms of use: http://www.unicode.org/copyright.html . /src/bin/icu-dev.sh From 07772d46f04f4458f96ce18165217b08e3870f88 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 11 Apr 2019 14:58:24 -0700 Subject: [PATCH 4/6] use run --rm so that containers don't dangle - you might want to disable this if you want to look at the container later --- Makefile | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index c632e13..d97a172 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ SRC=src/icu REV:=$(shell (cd $(SRC) >/dev/null 2>/dev/null && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)) || echo 'unknown') #icu4c version ICU4CVER:=$(shell ./$(BINPATH)/check-icu4c-version.sh $(SRC)/icu4c ) +DOCKERRUN=docker-compose run --rm all: dirs src/icu #src/icu: src @@ -32,7 +33,7 @@ dbuild: docker-compose.yml build-all: all for distro in $(DISTROS); do \ echo $$distro ; \ - ( docker-compose run $$distro bash $(BINPATH)/build.sh || exit 1); \ + ( $(DOCKERRUN) $$distro bash $(BINPATH)/build.sh || exit 1); \ done echo all OK $(ICU4CVER) @@ -40,7 +41,7 @@ check-all: all for distro in $(DISTROS); do \ echo $$distro ; \ rm -f $$distro.fail ; \ - ( docker-compose run $$distro bash $(BINPATH)/check.sh || (>$$distro.fail; exit 1)) >&1 | tee $$distro.out; \ + ( $(DOCKERRUN) $$distro bash $(BINPATH)/check.sh || (>$$distro.fail; exit 1)) >&1 | tee $$distro.out; \ done echo all OK $(ICU4CVER) @@ -48,21 +49,21 @@ check-some: all for distro in $(DISTROS_SMALL); do \ echo $$distro ; \ rm -f $$distro.fail ; \ - ( docker-compose run $$distro bash $(BINPATH)/check.sh || (>$$distro.fail; exit 1)) >&1 | tee $$distro.out; \ + ( $(DOCKERRUN) $$distro bash $(BINPATH)/check.sh || (>$$distro.fail; exit 1)) >&1 | tee $$distro.out; \ done echo all OK $(ICU4CVER) dist-all: all for distro in $(DISTROS); do \ echo $$distro ; \ - ( docker-compose run $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makedist.sh $$distro || exit 1); \ + ( $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makedist.sh $$distro || exit 1); \ done echo all OK $(ICU4CVER) dist-some: all for distro in $(DISTROS_SMALL); do \ echo $$distro ; \ - ( docker-compose run $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makedist.sh $$distro || exit 1); \ + ( $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makedist.sh $$distro || exit 1); \ done echo all OK $(ICU4CVER) @@ -72,7 +73,7 @@ dist: sdist dist-some src-some: all for distro in $(DISTROS_SMALL); do \ echo $$distro ; \ - ( docker-compose run $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesrc.sh $$distro || exit 1); \ + ( $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesrc.sh $$distro || exit 1); \ done echo all OK $(ICU4CVER) @@ -80,21 +81,21 @@ src-some: all src-one: all for distro in $(firstword $(DISTROS_SMALL)); do \ echo $$distro ; \ - ( docker-compose run $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesrc.sh $$distro || exit 1); \ + ( $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesrc.sh $$distro || exit 1); \ done echo all OK $(ICU4CVER) sdist: all for distro in $(firstword $(DISTROS_SMALL)); do \ echo $$distro ; \ - ( docker-compose run $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesdoc.sh $$distro || exit 1); \ + ( $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesdoc.sh $$distro || exit 1); \ done echo all OK $(ICU4CVER) perf-all: all for distro in $(DISTROS); do \ echo $$distro ; \ - ( docker-compose run $$distro bash $(BINPATH)/perf.sh $$distro || exit 1); \ + ( $(DOCKERRUN) $$distro bash $(BINPATH)/perf.sh $$distro || exit 1); \ done echo all OK $(ICU4CVER) From 2563efd2974afaa13a180609dbf07b2de207f4d2 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 19 Jul 2019 10:07:49 -0700 Subject: [PATCH 5/6] temp hack to build backlevel --- Makefile | 20 ++++++++++---------- docker-compose.yml | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index d97a172..14ae29b 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ SRC=src/icu REV:=$(shell (cd $(SRC) >/dev/null 2>/dev/null && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)) || echo 'unknown') #icu4c version ICU4CVER:=$(shell ./$(BINPATH)/check-icu4c-version.sh $(SRC)/icu4c ) -DOCKERRUN=docker-compose run --rm +RUNOPTS=--rm all: dirs src/icu #src/icu: src @@ -33,7 +33,7 @@ dbuild: docker-compose.yml build-all: all for distro in $(DISTROS); do \ echo $$distro ; \ - ( $(DOCKERRUN) $$distro bash $(BINPATH)/build.sh || exit 1); \ + ( docker-compose run $(DOCKERRUN) $$distro bash $(BINPATH)/build.sh || exit 1); \ done echo all OK $(ICU4CVER) @@ -41,7 +41,7 @@ check-all: all for distro in $(DISTROS); do \ echo $$distro ; \ rm -f $$distro.fail ; \ - ( $(DOCKERRUN) $$distro bash $(BINPATH)/check.sh || (>$$distro.fail; exit 1)) >&1 | tee $$distro.out; \ + ( docker-compose run $(DOCKERRUN) $$distro bash $(BINPATH)/check.sh || (>$$distro.fail; exit 1)) >&1 | tee $$distro.out; \ done echo all OK $(ICU4CVER) @@ -49,21 +49,21 @@ check-some: all for distro in $(DISTROS_SMALL); do \ echo $$distro ; \ rm -f $$distro.fail ; \ - ( $(DOCKERRUN) $$distro bash $(BINPATH)/check.sh || (>$$distro.fail; exit 1)) >&1 | tee $$distro.out; \ + ( docker-compose run $(DOCKERRUN) $$distro bash $(BINPATH)/check.sh || (>$$distro.fail; exit 1)) >&1 | tee $$distro.out; \ done echo all OK $(ICU4CVER) dist-all: all for distro in $(DISTROS); do \ echo $$distro ; \ - ( $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makedist.sh $$distro || exit 1); \ + ( docker-compose run $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makedist.sh $$distro || exit 1); \ done echo all OK $(ICU4CVER) dist-some: all for distro in $(DISTROS_SMALL); do \ echo $$distro ; \ - ( $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makedist.sh $$distro || exit 1); \ + ( docker-compose run $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makedist.sh $$distro || exit 1); \ done echo all OK $(ICU4CVER) @@ -73,7 +73,7 @@ dist: sdist dist-some src-some: all for distro in $(DISTROS_SMALL); do \ echo $$distro ; \ - ( $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesrc.sh $$distro || exit 1); \ + ( docker-compose run $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesrc.sh $$distro || exit 1); \ done echo all OK $(ICU4CVER) @@ -81,21 +81,21 @@ src-some: all src-one: all for distro in $(firstword $(DISTROS_SMALL)); do \ echo $$distro ; \ - ( $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesrc.sh $$distro || exit 1); \ + ( docker-compose run $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesrc.sh $$distro || exit 1); \ done echo all OK $(ICU4CVER) sdist: all for distro in $(firstword $(DISTROS_SMALL)); do \ echo $$distro ; \ - ( $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesdoc.sh $$distro || exit 1); \ + ( docker-compose run $(DOCKERRUN) $$distro env REV=$(REV) WHAT=$$distro $(BINPATH)/makesdoc.sh $$distro || exit 1); \ done echo all OK $(ICU4CVER) perf-all: all for distro in $(DISTROS); do \ echo $$distro ; \ - ( $(DOCKERRUN) $$distro bash $(BINPATH)/perf.sh $$distro || exit 1); \ + ( docker-compose run $(DOCKERRUN) $$distro bash $(BINPATH)/perf.sh $$distro || exit 1); \ done echo all OK $(ICU4CVER) diff --git a/docker-compose.yml b/docker-compose.yml index c6013b0..8b958ac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,7 @@ ubuntu: - ./src:/src - ./dist:/dist - ./tmp/.ccache:/home/build/.ccache + - /Users/srl/src/icu/.git/objects:/Users/srl/src/icu/.git/objects fedora: build: ./dockerfiles/fedora From 6bab9c73f37fdd9c7004abfbb321dc3d0da703cf Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 19 Jul 2019 10:08:10 -0700 Subject: [PATCH 6/6] local hacks --- local-loopy.sh | 22 ++++++++++++++++++++++ local-signoff.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 local-loopy.sh create mode 100644 local-signoff.sh diff --git a/local-loopy.sh b/local-loopy.sh new file mode 100644 index 0000000..726b68a --- /dev/null +++ b/local-loopy.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +HERE=$(pwd) +ICU=${HERE}/src/icu +MAINTS=$(cd ${ICU} >/dev/null ; git for-each-ref --format='%(refname)' refs/remotes/origin/maint | cut -d/ -f3-) + +for maint in $MAINTS; +do + echo $maint + if [ -f $(basename ${maint}).log ]; + then + echo "skipping…" + else + cd ${ICU} + git reset --hard HEAD # try to unstick + git clean -d -f -x + git checkout $maint || exit 1 + cd ${HERE} + make src-one 2>&1 | tee $(basename ${maint}).log + fi +done + diff --git a/local-signoff.sh b/local-signoff.sh new file mode 100644 index 0000000..38afa77 --- /dev/null +++ b/local-signoff.sh @@ -0,0 +1,35 @@ +#!/bin/bash + + +KEY=9731166CD8E23A83BEE7C6D3ACA5DBE1FD8FABF1 +SHAFILE=icu4c-SHASUM512.txt +TOP=$(pwd) +LANG=C +for sub in dist/*; +do + echo $sub + VER=$(basename $sub | cut -d- -f2) + echo $VER + cd ${TOP}/${sub} + if [ -f ${SHAFILE} ]; + then + echo skipping due to ${SHAFILE} + else + echo in $VER + echo summing icu4c-$(echo $VER | tr . _)-{src,data,docs}.{tgz,zip} + shasum -a 512 icu4c-$(echo $VER | tr . _)-{src,data,docs}.{tgz,zip} > ${SHAFILE} + echo verifying + shasum -c icu4c-SHASUM512.txt || exit 1 + + echo signing + for file in icu4c-$(echo $VER | tr . _)-{src,data,docs}.{tgz,zip}; + do + if [ -f ${file} ]; + then + gpg --detach-sign -a -u ${KEY} ${file} || exit 1 + fi + done + gpg --clear-sign -a -u ${KEY} ${SHAFILE} + fi +done +