Openembedded Core Discussions
 help / color / mirror / Atom feed
* Re: [PATCH] sanity.bbclass: Check for the known broken version of make
  2013-06-18 19:11 [PATCH] sanity.bbclass: Check for the known broken version of make Mark Hatle
@ 2013-06-18 19:05 ` Mark Hatle
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Hatle @ 2013-06-18 19:05 UTC (permalink / raw)
  To: openembedded-core

On 6/18/13 2:11 PM, Mark Hatle wrote:
> See GNU Savannah bug 30612 -- make 3.82 is known to be broken.
>
> A number of vendors are providing a modified version, so checking
> for just the version string is not enough.  We also need to check
> if the patch for the issue has been applied.  We use a modified
> version of the reproduced to check for the issue.

This was meant to go out as an RFC.  The patch still hasn't been fully verified.

Please don't merge it, but feedback would be appreciated!

--Mark

> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
> ---
>   meta/classes/sanity.bbclass | 39 +++++++++++++++++++++++++++++++++++++++
>   1 file changed, 39 insertions(+)
>
> diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
> index 3b9934b..b7f3673 100644
> --- a/meta/classes/sanity.bbclass
> +++ b/meta/classes/sanity.bbclass
> @@ -336,6 +336,41 @@ def check_gcc_march(sanity_data):
>
>       return result
>
> +# Unpatched version of make 3.82 are known to be broken.  See GNU Savannah Bug 30612.
> +# Use the reproducer from http://savannah.gnu.org/bugs/?30612
> +def check_make_version(sanity_data, loosever):
> +    status, result = oe.utils.getstatusoutput("make --version")
> +    if status != 0:
> +        return "Unable to execute make --version, exit code %s\n" % status
> +    version = result.split()[3]
> +    if not (loosever(version) < loosever("3.82") and loosever(version) > loosever("3.82")):
> +        # Construct a test file
> +        f = open("makefile_test", "w")
> +        f.write("makefile_test.a: makefile_test_a.c makefile_test_b.c makefile_test.a( makefile_test_a.c makefile_test_b.c)\n")
> +        f.write("\n")
> +        f.write("makefile_test_a.c:\n")
> +        f.write("	touch $@\n")
> +        f.write("\n")
> +        f.write("makefile_test_b.c:\n")
> +        f.write("	touch $@\n")
> +        f.close()
> +
> +        # Check if make 3.82 has been patched
> +        status,result = oe.utils.getstatusoutput("make -f makefile_test")
> +
> +        os.remove("makefile_test")
> +        if os.path.exists("makefile_test_a.c"):
> +            os.remove("makefile_test_a.c")
> +        if os.path.exists("makefile_test_b.c"):
> +            os.remove("makefile_test_b.c")
> +        if os.path.exists("makefile_test_a"):
> +            os.remove("makefile_test.a")
> +
> +        if status != 0:
> +            return "Your version of make 3.82 is broken. Please revert to 3.81 or install a patched version.\n"
> +    return None
> +
> +
>   # Tar version 1.24 and onwards handle overwriting symlinks correctly
>   # but earlier versions do not; this needs to work properly for sstate
>   def check_tar_version(sanity_data, loosever):
> @@ -407,6 +442,10 @@ def check_sanity(sanity_data):
>           messages = messages + 'Please set a MACHINE in your local.conf or environment\n'
>           machinevalid = False
>
> +    makemsg = check_make_version(sanity_data, LooseVersion)
> +    if makemsg:
> +        messages = messages + makemsg
> +
>       tarmsg = check_tar_version(sanity_data, LooseVersion)
>       if tarmsg:
>           messages = messages + tarmsg
>



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] sanity.bbclass: Check for the known broken version of make
@ 2013-06-18 19:11 Mark Hatle
  2013-06-18 19:05 ` Mark Hatle
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Hatle @ 2013-06-18 19:11 UTC (permalink / raw)
  To: openembedded-core

See GNU Savannah bug 30612 -- make 3.82 is known to be broken.

A number of vendors are providing a modified version, so checking
for just the version string is not enough.  We also need to check
if the patch for the issue has been applied.  We use a modified
version of the reproduced to check for the issue.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/sanity.bbclass | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 3b9934b..b7f3673 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -336,6 +336,41 @@ def check_gcc_march(sanity_data):
 
     return result
 
+# Unpatched version of make 3.82 are known to be broken.  See GNU Savannah Bug 30612.
+# Use the reproducer from http://savannah.gnu.org/bugs/?30612
+def check_make_version(sanity_data, loosever):
+    status, result = oe.utils.getstatusoutput("make --version")
+    if status != 0:
+        return "Unable to execute make --version, exit code %s\n" % status
+    version = result.split()[3]
+    if not (loosever(version) < loosever("3.82") and loosever(version) > loosever("3.82")):
+        # Construct a test file
+        f = open("makefile_test", "w")
+        f.write("makefile_test.a: makefile_test_a.c makefile_test_b.c makefile_test.a( makefile_test_a.c makefile_test_b.c)\n")
+        f.write("\n")
+        f.write("makefile_test_a.c:\n")
+        f.write("	touch $@\n")
+        f.write("\n")
+        f.write("makefile_test_b.c:\n")
+        f.write("	touch $@\n")
+        f.close()
+
+        # Check if make 3.82 has been patched
+        status,result = oe.utils.getstatusoutput("make -f makefile_test")
+
+        os.remove("makefile_test")
+        if os.path.exists("makefile_test_a.c"):
+            os.remove("makefile_test_a.c")
+        if os.path.exists("makefile_test_b.c"):
+            os.remove("makefile_test_b.c")
+        if os.path.exists("makefile_test_a"):
+            os.remove("makefile_test.a")
+
+        if status != 0:
+            return "Your version of make 3.82 is broken. Please revert to 3.81 or install a patched version.\n"
+    return None
+
+
 # Tar version 1.24 and onwards handle overwriting symlinks correctly
 # but earlier versions do not; this needs to work properly for sstate
 def check_tar_version(sanity_data, loosever):
@@ -407,6 +442,10 @@ def check_sanity(sanity_data):
         messages = messages + 'Please set a MACHINE in your local.conf or environment\n'
         machinevalid = False
 
+    makemsg = check_make_version(sanity_data, LooseVersion)
+    if makemsg:
+        messages = messages + makemsg
+
     tarmsg = check_tar_version(sanity_data, LooseVersion)
     if tarmsg:
         messages = messages + tarmsg
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-18 19:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-18 19:11 [PATCH] sanity.bbclass: Check for the known broken version of make Mark Hatle
2013-06-18 19:05 ` Mark Hatle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox