diff mbox series

stable/build: Do not convert warnings to error

Message ID 20191211063511.2806-1-hegdevasant@linux.vnet.ibm.com
State Superseded
Headers show
Series stable/build: Do not convert warnings to error | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (d75e82dbfbb9443efeb3f9a5921ac23605aab469)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Vasant Hegde Dec. 11, 2019, 6:35 a.m. UTC
During skiboot build, by default we convert all warnings to error.
Because of this sometime skiboot stable branch fails to build on
modern compiler. And we endup backporting build failure fixes to
stable branches.

Hence lets disable `-Werror` on skiboot stable branches (tagged version).

Suggested-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 Makefile.main | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Dan Horák Dec. 11, 2019, 7:38 a.m. UTC | #1
On Wed, 11 Dec 2019 12:05:11 +0530
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> wrote:

> During skiboot build, by default we convert all warnings to error.
> Because of this sometime skiboot stable branch fails to build on
> modern compiler. And we endup backporting build failure fixes to
> stable branches.
> 
> Hence lets disable `-Werror` on skiboot stable branches (tagged
> version).
> 
> Suggested-by: Oliver O'Halloran <oohall@gmail.com>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> ---
>  Makefile.main | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile.main b/Makefile.main
> index 4d7ebcec9..e1473cea0 100644
> --- a/Makefile.main
> +++ b/Makefile.main
> @@ -31,8 +31,14 @@ CWARNS := -Wall -Wundef -Wstrict-prototypes
> -Wno-trigraphs \ -Wno-pointer-sign -Wextra -Wno-sign-compare \
>  	  -Wmissing-prototypes -Wmissing-declarations \
>  	  -Wwrite-strings -Wcast-align \
> -	  -Winit-self \
> -	  -Werror
> +	  -Winit-self
> +
> +# Do not convert warnings to error on tagged version
> +GIT_SHA ?= $(shell cd $(SRC); git describe --tags 2>/dev/null)
> +GIT_TAG ?= $(shell cd $(SRC); git tag -l 2>/dev/null | grep -x $
> {GIT_SHA} >/dev/null 2>&1 && echo 0 || echo 1) +ifneq ($(GIT_TAG),0)

this expects building from git checkout, but will have issues when
building from the released source archive


		Dan
Vasant Hegde Dec. 11, 2019, 11:29 a.m. UTC | #2
On 12/11/19 1:08 PM, Dan Horák wrote:
> On Wed, 11 Dec 2019 12:05:11 +0530
> Vasant Hegde <hegdevasant@linux.vnet.ibm.com> wrote:
> 
>> During skiboot build, by default we convert all warnings to error.
>> Because of this sometime skiboot stable branch fails to build on
>> modern compiler. And we endup backporting build failure fixes to
>> stable branches.
>>
>> Hence lets disable `-Werror` on skiboot stable branches (tagged
>> version).
>>
>> Suggested-by: Oliver O'Halloran <oohall@gmail.com>
>> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
>> ---
>>   Makefile.main | 10 ++++++++--
>>   1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/Makefile.main b/Makefile.main
>> index 4d7ebcec9..e1473cea0 100644
>> --- a/Makefile.main
>> +++ b/Makefile.main
>> @@ -31,8 +31,14 @@ CWARNS := -Wall -Wundef -Wstrict-prototypes
>> -Wno-trigraphs \ -Wno-pointer-sign -Wextra -Wno-sign-compare \
>>   	  -Wmissing-prototypes -Wmissing-declarations \
>>   	  -Wwrite-strings -Wcast-align \
>> -	  -Winit-self \
>> -	  -Werror
>> +	  -Winit-self
>> +
>> +# Do not convert warnings to error on tagged version
>> +GIT_SHA ?= $(shell cd $(SRC); git describe --tags 2>/dev/null)
>> +GIT_TAG ?= $(shell cd $(SRC); git tag -l 2>/dev/null | grep -x $
>> {GIT_SHA} >/dev/null 2>&1 && echo 0 || echo 1) +ifneq ($(GIT_TAG),0)
> 
> this expects building from git checkout, but will have issues when
> building from the released source archive

Oh yeah. I missed that. how about this?

------------------------------------------
 From 35f19d31a0605ec60251bc9361e7aacd738711d2 Mon Sep 17 00:00:00 2001
From: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Date: Wed, 11 Dec 2019 11:01:01 +0530
Subject: [PATCH] stable/build: Do not convert warnings to error

During skiboot build, by default we convert all warnings to error.
Because of this sometime skiboot stable branch fails to build on
modern compiler. And we endup backporting build failure fixes to
stable branches.

Hence lets disable `-Werror` on skiboot stable branches (tagged version).

Suggested-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
  Makefile.main | 13 +++++++++++--
  1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/Makefile.main b/Makefile.main
index 4d7ebcec9..a6dbeea06 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -31,8 +31,17 @@ CWARNS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
  	  -Wno-pointer-sign -Wextra -Wno-sign-compare \
  	  -Wmissing-prototypes -Wmissing-declarations \
  	  -Wwrite-strings -Wcast-align \
-	  -Winit-self \
-	  -Werror
+	  -Winit-self
+
+# Do not convert warnings to error on tagged/released version
+GIT_DIR ?= $(shell test -e $(SRC)/.git && echo 0 || echo 1)
+ifeq ($(GIT_DIR),0)
+GIT_SHA ?= $(shell cd $(SRC); git describe --tags 2>/dev/null)
+GIT_TAG ?= $(shell cd $(SRC); git tag -l 2>/dev/null | grep -x ${GIT_SHA} 
 >/dev/null 2>&1 && echo 0 || echo 1)
+ifneq ($(GIT_TAG),0)
+CWARNS += -Werror
+endif
+endif

  # Host tools and options
  HOSTCC=gcc
Dan Horák Dec. 11, 2019, 7:01 p.m. UTC | #3
On Wed, 11 Dec 2019 16:59:02 +0530
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> wrote:

> > this expects building from git checkout, but will have issues when
> > building from the released source archive
> 
> Oh yeah. I missed that. how about this?

yes, this should work. The only question is whether it's better to use
"0" or "1" for describing the "found" state. My preference would be to
use "1". I guess it's "return code" vs. "logic value".

GIT_DIR ?= $(shell test -e $(SRC)/.git && echo 1 || echo 0
ifeq ($(GIT_DIR),1)       # means $(SRC)/.git exists ...
...
looks more readable to me and also in line with the existing logic in
Makefile.main


		Dan

> ------------------------------------------
>  From 35f19d31a0605ec60251bc9361e7aacd738711d2 Mon Sep 17 00:00:00
> 2001 From: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> Date: Wed, 11 Dec 2019 11:01:01 +0530
> Subject: [PATCH] stable/build: Do not convert warnings to error
> 
> During skiboot build, by default we convert all warnings to error.
> Because of this sometime skiboot stable branch fails to build on
> modern compiler. And we endup backporting build failure fixes to
> stable branches.
> 
> Hence lets disable `-Werror` on skiboot stable branches (tagged
> version).
> 
> Suggested-by: Oliver O'Halloran <oohall@gmail.com>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> ---
>   Makefile.main | 13 +++++++++++--
>   1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile.main b/Makefile.main
> index 4d7ebcec9..a6dbeea06 100644
> --- a/Makefile.main
> +++ b/Makefile.main
> @@ -31,8 +31,17 @@ CWARNS := -Wall -Wundef -Wstrict-prototypes
> -Wno-trigraphs \ -Wno-pointer-sign -Wextra -Wno-sign-compare \
>   	  -Wmissing-prototypes -Wmissing-declarations \
>   	  -Wwrite-strings -Wcast-align \
> -	  -Winit-self \
> -	  -Werror
> +	  -Winit-self
> +
> +# Do not convert warnings to error on tagged/released version
> +GIT_DIR ?= $(shell test -e $(SRC)/.git && echo 0 || echo 1)
> +ifeq ($(GIT_DIR),0)
> +GIT_SHA ?= $(shell cd $(SRC); git describe --tags 2>/dev/null)
> +GIT_TAG ?= $(shell cd $(SRC); git tag -l 2>/dev/null | grep -x $
> {GIT_SHA} 
>  >/dev/null 2>&1 && echo 0 || echo 1)
> +ifneq ($(GIT_TAG),0)
> +CWARNS += -Werror
> +endif
> +endif
> 
>   # Host tools and options
>   HOSTCC=gcc
> -- 
> 2.21.0
> 
> 
> 
> -Vasant
> 
> 
> > 
> > 
> > 		Dan
> > _______________________________________________
> > Skiboot mailing list
> > Skiboot@lists.ozlabs.org
> > https://lists.ozlabs.org/listinfo/skiboot
> > 
>
Vasant Hegde Dec. 12, 2019, 5:33 a.m. UTC | #4
On 12/12/19 12:31 AM, Dan Horák wrote:
> On Wed, 11 Dec 2019 16:59:02 +0530
> Vasant Hegde <hegdevasant@linux.vnet.ibm.com> wrote:
> 
>>> this expects building from git checkout, but will have issues when
>>> building from the released source archive
>>
>> Oh yeah. I missed that. how about this?
> 
> yes, this should work. The only question is whether it's better to use
> "0" or "1" for describing the "found" state. My preference would be to
> use "1". I guess it's "return code" vs. "logic value".
> 
> GIT_DIR ?= $(shell test -e $(SRC)/.git && echo 1 || echo 0
> ifeq ($(GIT_DIR),1)       # means $(SRC)/.git exists ...
> ...
> looks more readable to me and also in line with the existing logic in
> Makefile.main

Makes sense. Will fix it in v2.

-Vasant
diff mbox series

Patch

diff --git a/Makefile.main b/Makefile.main
index 4d7ebcec9..e1473cea0 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -31,8 +31,14 @@  CWARNS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
 	  -Wno-pointer-sign -Wextra -Wno-sign-compare \
 	  -Wmissing-prototypes -Wmissing-declarations \
 	  -Wwrite-strings -Wcast-align \
-	  -Winit-self \
-	  -Werror
+	  -Winit-self
+
+# Do not convert warnings to error on tagged version
+GIT_SHA ?= $(shell cd $(SRC); git describe --tags 2>/dev/null)
+GIT_TAG ?= $(shell cd $(SRC); git tag -l 2>/dev/null | grep -x ${GIT_SHA} >/dev/null 2>&1 && echo 0 || echo 1)
+ifneq ($(GIT_TAG),0)
+CWARNS += -Werror
+endif
 
 # Host tools and options
 HOSTCC=gcc