All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/8] Detect and fix overridden variables in .mk files
@ 2019-01-27 18:59 Ricardo Martincoski
  2019-01-27 18:59 ` [Buildroot] [PATCH 1/8] package/s6-networking: fix dependency when libressl is enabled Ricardo Martincoski
                   ` (7 more replies)
  0 siblings, 8 replies; 29+ messages in thread
From: Ricardo Martincoski @ 2019-01-27 18:59 UTC (permalink / raw)
  To: buildroot

Hello,

This series makes check-package to warn when a variable is overridden in a .mk
file.

For the general case, appending values to variables is OK and also a good
practice, like this:
|PACKAGE_VAR = value1
|ifeq ...
|PACKAGE_VAR += value2

or this, when the above is not possible:
|PACKAGE_VAR = value1
|ifeq ...
|PACKAGE_VAR := $(PACKAGE_VAR), value2

But this override is an error:
|PACKAGE_VAR = value1
|PACKAGE_VAR = value2

as well this one:
|ifeq ...
|PACKAGE_VAR += value1
|endif
|PACKAGE_VAR = value2

And this override is error-prone:
|PACKAGE_VAR = value1
|ifeq ...
|PACKAGE_VAR = value2

Patches 1 to 3 fix packages that currently overridden variables in .mk files:
s6-networking, sdl_sound, avrdude.

Patch 4 removes a unicode character from usb_modeswitch.mk. When I was about to
send this series, git send-email warned about it.

Patch 5 standardize the code by avoiding conditionally overridden variables in
usb_modeswitch.

Patch 6 adds to check-package the ability to recognize a special comment and
ignore one or more warnings that would otherwise be issued for the next line of
code. This is a common feature for static-analysis tools.

Patch 7 teaches check-package about ifdef/ifndef, problem identified while
implementing patch 8.

Patch 8 adds a new check function to check-package to warn for overridden
variables.

With the entire series applied, a check-package job:
https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/151812563

With only patches 6 to 8 applied, a check-package job:
https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/151813273

NOTE: I used git format-patch -U16 to make the review of patches 1,2,3,5 easier.

Regards,
Ricardo

Ricardo Martincoski (8):
  package/s6-networking: fix dependency when libressl is enabled
  package/sdl_sound: actually use the optional CONF_OPTS
  Revert "avrdude: add license information"
  package/usb_modeswitch: drop unicode space in comment
  package/usb_modeswitch: avoid overriding variables
  utils/check-package: allow to disable warning for a line
  utils/check-package: handle ifdef/ifndef in .mk files
  utils/check-package: warn about overridden variables

 package/avrdude/avrdude.mk               |  2 -
 package/gcc/gcc-final/gcc-final.mk       |  2 +
 package/s6-networking/s6-networking.mk   |  2 +-
 package/sdl_sound/sdl_sound.mk           | 11 ++--
 package/usb_modeswitch/usb_modeswitch.mk |  8 +--
 package/zmqpp/zmqpp.mk                   |  1 +
 utils/check-package                      |  4 ++
 utils/checkpackagelib/base.py            |  2 +
 utils/checkpackagelib/lib_mk.py          | 70 +++++++++++++++++++++++-
 9 files changed, 86 insertions(+), 16 deletions(-)

-- 
2.17.1

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

end of thread, other threads:[~2019-05-26 11:05 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-27 18:59 [Buildroot] [PATCH 0/8] Detect and fix overridden variables in .mk files Ricardo Martincoski
2019-01-27 18:59 ` [Buildroot] [PATCH 1/8] package/s6-networking: fix dependency when libressl is enabled Ricardo Martincoski
2019-01-27 19:52   ` Thomas Petazzoni
2019-01-28  2:26     ` Ricardo Martincoski
2019-01-27 21:15   ` Peter Korsgaard
2019-01-29 21:56   ` Peter Korsgaard
2019-01-27 18:59 ` [Buildroot] [PATCH 2/8] package/sdl_sound: actually use the optional CONF_OPTS Ricardo Martincoski
2019-01-27 21:16   ` Peter Korsgaard
2019-01-29 21:57   ` Peter Korsgaard
2019-01-27 18:59 ` [Buildroot] [PATCH 3/8] Revert "avrdude: add license information" Ricardo Martincoski
2019-01-27 21:17   ` Peter Korsgaard
2019-01-29 21:59   ` Peter Korsgaard
2019-01-27 18:59 ` [Buildroot] [PATCH 4/8] package/usb_modeswitch: drop unicode space in comment Ricardo Martincoski
2019-01-27 21:19   ` Peter Korsgaard
2019-01-29 22:00   ` Peter Korsgaard
2019-01-27 18:59 ` [Buildroot] [PATCH 5/8] package/usb_modeswitch: avoid overriding variables Ricardo Martincoski
2019-01-27 21:28   ` Peter Korsgaard
2019-01-29 22:01   ` Peter Korsgaard
2019-01-27 18:59 ` [Buildroot] [PATCH 6/8] utils/check-package: allow to disable warning for a line Ricardo Martincoski
2019-01-28 17:16   ` Arnout Vandecappelle
2019-01-29 15:38   ` Peter Korsgaard
2019-01-27 18:59 ` [Buildroot] [PATCH 7/8] utils/check-package: handle ifdef/ifndef in .mk files Ricardo Martincoski
2019-01-28 17:07   ` Arnout Vandecappelle
2019-01-29 15:39   ` Peter Korsgaard
2019-01-27 18:59 ` [Buildroot] [PATCH 8/8] utils/check-package: warn about overridden variables Ricardo Martincoski
2019-02-04 15:15   ` Titouan Christophe
2019-02-05 19:25   ` Peter Korsgaard
2019-05-26  9:20   ` Yann E. MORIN
2019-05-26 11:05     ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.