From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail5.wrs.com (mail5.windriver.com [192.103.53.11]) by mail.openembedded.org (Postfix) with ESMTP id EB73B79710 for ; Thu, 13 Sep 2018 07:43:14 +0000 (UTC) Received: from ALA-HCB.corp.ad.wrs.com (ala-hcb.corp.ad.wrs.com [147.11.189.41]) by mail5.wrs.com (8.15.2/8.15.2) with ESMTPS id w8D7gYV0022339 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Thu, 13 Sep 2018 00:42:50 -0700 Received: from ala-blade47.wrs.com (147.11.105.67) by ALA-HCB.corp.ad.wrs.com (147.11.189.41) with Microsoft SMTP Server id 14.3.408.0; Thu, 13 Sep 2018 00:42:18 -0700 From: Hongxu Jia To: Date: Thu, 13 Sep 2018 00:42:18 -0700 Message-ID: <20180913074218.15038-1-hongxu.jia@windriver.com> X-Mailer: git-send-email 2.10.2 MIME-Version: 1.0 Cc: openembedded-devel@lists.openembedded.org Subject: [meta-networking][PATCH] cyrus-sasl: fix parallel build issue X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2018 07:43:15 -0000 Content-Type: text/plain While building plugins, each .c requires a _init.c, and the _init.c is dynamically generated by makeinit.sh. But the makeinit.sh generates all *_init.c (13 mechanism plugins, 3 auxprop plugins) at one time, if there are multiple plugins, there will be multiple makeinit.sh invoking. It caused a parallel issue, the *_init.c files will be generated repeatedly. It occasionally generate dapdb_init.c incorrectly [snip plugins/ldapdb_init.c] SASL_CANONUSER_PLUG_INIT( ldapdb ) SASL_CANONUSER_PLUG_INIT( ldapdb ) SASL_CANONUSER_PLUG_INIT( ldapdb ) [snip plugins/ldapdb_init.c] Let makeinit.sh generate the expected _init.c which is exactly required by .c. Signed-off-by: Hongxu Jia --- ...0001-makeinit.sh-fix-parallel-build-issue.patch | 95 ++++++++++++++++++++++ .../cyrus-sasl/cyrus-sasl_2.1.27.bb | 1 + 2 files changed, 96 insertions(+) create mode 100644 meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/0001-makeinit.sh-fix-parallel-build-issue.patch diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/0001-makeinit.sh-fix-parallel-build-issue.patch b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/0001-makeinit.sh-fix-parallel-build-issue.patch new file mode 100644 index 0000000..bf232ac --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/0001-makeinit.sh-fix-parallel-build-issue.patch @@ -0,0 +1,95 @@ +From bb693db0e1d1d693e8ca31fcbc4f46d1674eeca1 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Thu, 13 Sep 2018 14:20:57 +0800 +Subject: [PATCH] makeinit.sh: fix parallel build issue + +While building plugins, each .c requires a _init.c, +and the _init.c is dynamically generated by makeinit.sh. + +But the makeinit.sh generates all *_init.c (13 mechanism plugins, +3 auxprop plugins) at one time, if there are multiple plugins, +there will be multiple makeinit.sh invoking. + +It caused a parallel issue, the *_init.c files will be generated +repeatedly. + +It occasionally generate dapdb_init.c incorrectly +[snip plugins/ldapdb_init.c] +SASL_CANONUSER_PLUG_INIT( ldapdb ) +SASL_CANONUSER_PLUG_INIT( ldapdb ) +SASL_CANONUSER_PLUG_INIT( ldapdb ) +[snip plugins/ldapdb_init.c] + +Let makeinit.sh generate the expected _init.c which +is exactly required by .c. + +Upstream-Status: Submitted [https://github.com/cyrusimap/cyrus-sasl/pull/532] + +Signed-off-by: Hongxu Jia +--- + plugins/Makefile.am | 2 +- + plugins/makeinit.sh | 19 ++++++++++++++----- + 2 files changed, 15 insertions(+), 6 deletions(-) + +diff --git a/plugins/Makefile.am b/plugins/Makefile.am +index 929f6a4..81e7f0b 100644 +--- a/plugins/Makefile.am ++++ b/plugins/Makefile.am +@@ -149,4 +149,4 @@ passdss_init.c sasldb_init.c sql_init.c ldapdb_init.c + CLEANFILES=$(init_src) + + ${init_src}: $(srcdir)/makeinit.sh +- $(SHELL) $(srcdir)/makeinit.sh ++ $(SHELL) $(srcdir)/makeinit.sh $@ +diff --git a/plugins/makeinit.sh b/plugins/makeinit.sh +index cc65f7d..3131877 100644 +--- a/plugins/makeinit.sh ++++ b/plugins/makeinit.sh +@@ -1,7 +1,9 @@ ++plugin_init="$1" + # mechanism plugins + for mech in anonymous crammd5 digestmd5 scram gssapiv2 kerberos4 login ntlm otp passdss plain srp gs2; do ++ if [ ${plugin_init} = "${mech}_init.c" ];then + +-echo " ++ echo " + #include + + #include +@@ -43,13 +45,16 @@ BOOL APIENTRY DllMain( HANDLE hModule, + + SASL_CLIENT_PLUG_INIT( $mech ) + SASL_SERVER_PLUG_INIT( $mech ) +-" > ${mech}_init.c ++" > ${mech}_init.c ++ echo "generating $1" ++ fi # End of `if [ ${plugin_init} = "${mech}_init.c" ];then' + done + + # auxprop plugins + for auxprop in sasldb sql ldapdb; do ++ if [ ${plugin_init} = "${auxprop}_init.c" ];then + +-echo " ++ echo " + #include + + #include +@@ -86,8 +91,12 @@ BOOL APIENTRY DllMain( HANDLE hModule, + #endif + + SASL_AUXPROP_PLUG_INIT( $auxprop ) +-" > ${auxprop}_init.c ++" > ${auxprop}_init.c ++ echo "generating $1" ++ fi # End of `if [ ${plugin_init} = "${auxprop}_init.c" ];then' + done + + # ldapdb is also a canon_user plugin +-echo "SASL_CANONUSER_PLUG_INIT( ldapdb )" >> ldapdb_init.c ++if [ ${plugin_init} = "ldapdb_init.c" ];then ++ echo "SASL_CANONUSER_PLUG_INIT( ldapdb )" >> ldapdb_init.c ++fi +-- +2.7.4 + diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.27.bb b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.27.bb index 573f822..594e55d 100644 --- a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.27.bb +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.27.bb @@ -15,6 +15,7 @@ SRC_URI = "git://github.com/cyrusimap/cyrus-sasl;protocol=https \ file://saslauthd.conf \ file://0004-configure.ac-fix-condition-for-suppliment-snprintf-i.patch \ file://0001-Allow-saslauthd-to-be-built-outside-of-source-tree-w.patch \ + file://0001-makeinit.sh-fix-parallel-build-issue.patch \ " UPSTREAM_CHECK_URI = "https://github.com/cyrusimap/cyrus-sasl/archives" -- 2.10.2