public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Diego Novillo <dnovillo@google.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>,
	 Paul Pluzhnikov <ppluzhnikov@google.com>,
	Simon Baldwin <simonb@google.com>
Subject: [contrib]: Loosen check of build directory in validate_failures.py
Date: Thu, 18 Apr 2013 22:05:00 -0000	[thread overview]
Message-ID: <517038A8.5010405@google.com> (raw)

Some cross targets have different build directory names that those 
expected by the script.  I loosened the check by simply making it check 
for the actual values we care to get out of the Makefile. This should 
remove some false positives we've been getting.

Committed to trunk.  Will backport to google/gcc-4_8 shortly.


Diego.

commit 6f25227972527ea90b61de84b283d840dcc49004
Author: dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Apr 18 18:11:05 2013 +0000

     Loosen check for build directory.

         * validate_failures.py: Loosen check for build directory.
         State what failed if we couldn't find the source tree or
         the target triplet.

     git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198064 
138bc75d-0d04-0410-96
1f-82ee72b054a4

diff --git a/contrib/testsuite-management/validate_failures.py 
b/contrib/testsuite-management/validate_failures.py
index 74dbcfb..aa71c94 100755
--- a/contrib/testsuite-management/validate_failures.py
+++ b/contrib/testsuite-management/validate_failures.py
@@ -196,11 +196,9 @@ def GetMakefileValue(makefile_name, value_name):
    return None


-def ValidBuildDirectory(builddir, target):
+def ValidBuildDirectory(builddir):
    if (not os.path.exists(builddir) or
-      not os.path.exists('%s/Makefile' % builddir) or
-      (not os.path.exists('%s/build-%s' % (builddir, target)) and
-       not os.path.exists('%s/%s' % (builddir, target)))):
+      not os.path.exists('%s/Makefile' % builddir)):
      return False
    return True

@@ -362,14 +360,17 @@ def GetManifestPath(srcdir, target, 
user_provided_must_exist):
        Error('Manifest does not exist: %s' % manifest_path)
      return manifest_path
    else:
-    assert srcdir and target
+    if not srcdir:
+      Error('Could not determine where the location of GCC\'s source 
tree. '
+            'The Makefile does not contain a definition for "srcdir".')
+    if not target:
+      Error('Could not determine the target triplet for this build. '
+            'The Makefile does not contain a definition for 
"target_alias".')
      return _MANIFEST_PATH_PATTERN % (srcdir, _MANIFEST_SUBDIR, target)


  def GetBuildData():
-  srcdir = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'srcdir =')
-  target = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 
'target_alias=')
-  if not ValidBuildDirectory(_OPTIONS.build_dir, target):
+  if not ValidBuildDirectory(_OPTIONS.build_dir):
      # If we have been given a set of results to use, we may
      # not be inside a valid GCC build directory.  In that case,
      # the user must provide both a manifest file and a set
@@ -380,6 +381,8 @@ def GetBuildData():
              _OPTIONS.build_dir)
      else:
        return None, None
+  srcdir = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 'srcdir =')
+  target = GetMakefileValue('%s/Makefile' % _OPTIONS.build_dir, 
'target_alias=')
    print 'Source directory: %s' % srcdir
    print 'Build target:     %s' % target
    return srcdir, target

                 reply	other threads:[~2013-04-18 18:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=517038A8.5010405@google.com \
    --to=dnovillo@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ppluzhnikov@google.com \
    --cc=simonb@google.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).