Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <openembedded-devel@lists.openembedded.org>
Subject: [PATCH 2/2] netcf: fix mishandling of gnulib submodule causing build fail
Date: Sun, 8 May 2016 15:08:13 -0400	[thread overview]
Message-ID: <1462734493-3819-3-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1462734493-3819-1-git-send-email-paul.gortmaker@windriver.com>

netcf fails to build on certain hosts with newer versions
of git installed as follows:

| ./bootstrap: Bootstrapping from checked-out netcf sources...
| ./bootstrap: consider installing git-merge-changelog from gnulib
| ./bootstrap: getting gnulib files...
| error: pathspec 'gnulib' did not match any file(s) known to git.

If we do a devshell we will see that our configure prepend that
intended to _create_ the .gitmodules has instead _modified_ it
and left us with this change present:

  sh-4.3# git diff
  diff --git a/.gitmodules b/.gitmodules
  index 7acb1ea19ca7..2d10b0e0e0fe 100644
  --- a/.gitmodules
  +++ b/.gitmodules
  @@ -1,3 +1,3 @@
   [submodule "gnulib"]
  -       path = .gnulib
  -       url = git://git.sv.gnu.org/gnulib.git
  +       path = gnulib
  +       url = git://git.sv.gnu.org/gnulib
  sh-4.3#

What happens is that the newer git does not respect uncommitted
changes to the .gitmodules file, and hence the path ".gnulib" is
still considered valid vs. the in tree updated path "gnulib".  It
doesn't help any that the package has its own tracked files in
gnulib/ that we stomp over, but the real fail is just uncommitted
changes to the .gitmodule as this insertion of a random path shows:

  sh-4.3# git diff
  diff --git a/.gitmodules b/.gitmodules
  index 7acb1ea19ca7..91bd45f8e4d4 100644
  --- a/.gitmodules
  +++ b/.gitmodules
  @@ -1,3 +1,3 @@
   [submodule "gnulib"]
  -       path = .gnulib
  +       path = gnulibaaa
          url = git://git.sv.gnu.org/gnulib.git
  sh-4.3# git --version
  git version 2.7.4
  sh-4.3# git submodule init
  fatal: no submodule mapping found in .gitmodules for path '.gnulib'
  sh-4.3#

Since the original bbclass simply assumed there was no .gitmodules
file to begin with, we can easily solve this by not clobbering it
and respect the path choice used by the package itself.

As the version of ./bootstrap shipped with netcf supports this:

     --no-git       do not use git to update gnulib.  Requires that
                    --gnulib-srcdir point to a correct gnulib snapshot

we can use it in conjunction with the pathspec since we know the
gnulib was just copied in from the sysroot, and does not need
to try and pull any further updates.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 meta-networking/recipes-support/netcf/netcf_git.bb | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/meta-networking/recipes-support/netcf/netcf_git.bb b/meta-networking/recipes-support/netcf/netcf_git.bb
index f67f4ec6082e..8d6d32a60895 100644
--- a/meta-networking/recipes-support/netcf/netcf_git.bb
+++ b/meta-networking/recipes-support/netcf/netcf_git.bb
@@ -28,18 +28,17 @@ do_configure_prepend() {
     cd ${S}
 
     # avoid bootstrap cloning gnulib on every configure
-    cat >.gitmodules <<EOF
-[submodule "gnulib"]
-       path = gnulib
-       url = git://git.sv.gnu.org/gnulib
-EOF
-    cp -rf ${STAGING_DATADIR}/gnulib ${S}
+    # the rmdir acts as a sentinel to let us know if the pkg ever changes
+    # the path for GNUlib or populates the dir making it non-empty.
+    rmdir ${S}/.gnulib
+    cp -rf ${STAGING_DATADIR}/gnulib ${S}/.gnulib
 
     # --force to avoid errors on reconfigure e.g if recipes changed we depend on
     # | bootstrap: running: libtoolize --quiet
     # | libtoolize:   error: 'libltdl/COPYING.LIB' exists: use '--force' to overwrite
     # | ...
-    ./bootstrap --force
+    ./bootstrap --force --no-git --gnulib-srcdir=.gnulib
+
     cd $currdir
 }
 
-- 
2.7.4



  parent reply	other threads:[~2016-05-08 19:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-08 19:08 [PATCH v2 0/2] netcf build fail / gnulib handling fix Paul Gortmaker
2016-05-08 19:08 ` [PATCH 1/2] autotools-bootstrap: make bootstrap package specific Paul Gortmaker
2016-05-08 19:08 ` Paul Gortmaker [this message]
2016-05-09 14:08 ` [PATCH v2 0/2] netcf build fail / gnulib handling fix Joe MacDonald
2016-05-09 14:26   ` Martin Jansa
2016-05-09 15:20     ` Paul Gortmaker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462734493-3819-3-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox