Skip to content

make: cleanup and centralise DEVELHELP setting#8029

Merged
miri64 merged 2 commits intoRIOT-OS:masterfrom
smlng:enh/make/develhelp
Nov 23, 2017
Merged

make: cleanup and centralise DEVELHELP setting#8029
miri64 merged 2 commits intoRIOT-OS:masterfrom
smlng:enh/make/develhelp

Conversation

@smlng
Copy link
Copy Markdown
Member

@smlng smlng commented Nov 14, 2017

This PR make the usage of DEVELHELP more consistent and easier to configure (IMHO 😄), i.e.,
its no longer required to explicitly set CFLAGS += -DDEVELHELP in Makefiles but rather use DEVELHELP=1 either in Makefile or as env variable on command line; specifically for the latter its simpler.

Further this PR make usage of DEVELHELP more consistent, as follows:

  • remove setting of DEVELHELP for all examples, can be optionally activated as described above
  • enable DEVELHELP for all test by default, in tests/Makefile.test_common

@smlng smlng added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: build system Area: Build system labels Nov 14, 2017
@smlng smlng requested a review from kaspar030 November 14, 2017 10:19
@smlng smlng added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Nov 14, 2017
@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 14, 2017

requires #8030

cladmi
cladmi previously requested changes Nov 14, 2017
Copy link
Copy Markdown
Contributor

@cladmi cladmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea, it adds a real configuration for "debug". It is not anymore a CFLAGS you set on your own.

Should also the NDEBUG configuration be adapted to use DEVELHELP instead of parsing CFLAGS ? https://github.com/RIOT-OS/RIOT/blob/2017.10-branch/makefiles/cflags.inc.mk#L64

# Comment this out to disable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the
# development process:
CFLAGS += -DDEVELHELP -Wall
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-Wall got removed at the same time here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO wasn't appropriate place to activate that here anyway, use WERROR (see e.g. #7919) instead


# Set this to 1 to enable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the
# development process:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smlng smlng force-pushed the enh/make/develhelp branch from 8bc85b7 to be1a2cb Compare November 14, 2017 10:49
@kaspar030
Copy link
Copy Markdown
Contributor

I like!

remove setting of DEVELHELP for all examples, can be optionally activated as described above

I think this is a rather big change and should maybe be kept out of this PR.

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 14, 2017

I think this is a rather big change and should maybe be kept out of this PR.

mhm, it wasn't used consistently and also makes not much sense to have DEVELHELP active for examples by default (IMHO). Iff we want to have develhelp active nevertheless I would still adapt it here to set DEVELHELP = 1 in respective Makefile of the examples, instead of keeping the CFLAG variant

@kaspar030
Copy link
Copy Markdown
Contributor

would still adapt it here to set DEVELHELP = 1 in respective Makefile of the examples

I think that would be the way to go!

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 14, 2017

oh great, Murdock reveals failed assertion in gnrc:

main(): This is RIOT! (Version: buildtest)
...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................sys/net/gnrc/network_layer/ipv6/nib/_nib-internal.c:772 => 0x8049ba9
*** RIOT kernel panic:
FAILED ASSERTION.

and further

gnrc_sixlowpan_nd_router.c: In function 'gnrc_sixlowpan_nd_router_abr_rem_prf':
gnrc_sixlowpan_nd_router.c:330:62: error: unused parameter 'iface' [-Werror=unused-parameter]
                                           gnrc_ipv6_netif_t *iface, gnrc_ipv6_netif_addr_t *prefix)
                                                              ^

so my PR will be blocked by this (IMHO nonsense) GNRC merge embargo 😞

@smlng smlng force-pushed the enh/make/develhelp branch from be1a2cb to 79d5ed8 Compare November 14, 2017 11:04
@miri64
Copy link
Copy Markdown
Member

miri64 commented Nov 14, 2017

Can we let DEVELHELP activated on Murdock? Or is that not desirable for future size monitoring?

@miri64
Copy link
Copy Markdown
Member

miri64 commented Nov 14, 2017

(otherwise: should be pretty straight forward by setting DEVELHELP=1 in .murdock, right?

@kaspar030
Copy link
Copy Markdown
Contributor

Or is that not desirable for future size monitoring?

I'd say murdock shouldn't compile differently from what the Makefile says, if possible. Also, for size monitoring, DEVELHELP shouldn't be set. (At least for tests/minimal, examples/hello-world, examples/gnrc_minimal ...)

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 14, 2017

regarding murdock, I think we should compile everything with and without DEVELHELP=1, as it checks out differently - at least for the nightlies we should do that.

@kaspar030
Copy link
Copy Markdown
Contributor

enable DEVELHELP for all test by default, in tests/Makefile.test_common

Can you disable it for tests/minimal?

@kaspar030
Copy link
Copy Markdown
Contributor

DEVELHELP shouldn't be set. (At least for tests/minimal, examples/hello-world, examples/gnrc_minimal ...)

Sorry, I meant, "shouldn't be changed"

@smlng smlng force-pushed the enh/make/develhelp branch 4 times, most recently from 375abc7 to 7df250b Compare November 14, 2017 15:45
@smlng smlng added the State: waiting for other PR State: The PR requires another PR to be merged first label Nov 14, 2017
@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 14, 2017

@kaspar030 I excluded tests/minimal from DEVELHELP

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 14, 2017

I still [think] DEVELHELP doesn't make sense for examples by default

@cladmi
Copy link
Copy Markdown
Contributor

cladmi commented Nov 15, 2017

I would prefer this separated in two PRs:

  • Introduce the new configuration mechanism
  • Sanitize the usage of DEVELHELP

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 17, 2017

factored out changes as requested, this now only introduces the new develhelp switch.

PR depends on #8030.

And is needed by #8079, #8080, and #8081

@kaspar030
Copy link
Copy Markdown
Contributor

PR depends on #8030.

Sorry, but why?

@kaspar030
Copy link
Copy Markdown
Contributor

only introduces the new develhelp switch.

I'm sorry to be picky on this, but the switch also has to be used within the makefiles, instead of setting CFLAGS directly.

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 18, 2017

PR depends on #8030.
Sorry, but why?

Right, this one doesn't need it but the #8080 does, otherwise tests/pkg_libcoap fails. Will drop here.

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 18, 2017

only introduces the new develhelp switch.
I'm sorry to be picky on this, but the switch also has to be used within the makefiles, instead of setting CFLAGS directly.

I don't understand, you said the change should be factored out, hence #8080 and #8081. Or what do you mean?

@smlng smlng force-pushed the enh/make/develhelp branch from 374f888 to 533b676 Compare November 18, 2017 08:49
Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please update the information in doc.txt with some information on the environment variable as well, please?

@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 18, 2017

good point @miri64, will do!

Copy link
Copy Markdown
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK.

@kaspar030 kaspar030 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR State: waiting for other PR State: The PR requires another PR to be merged first labels Nov 20, 2017
@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 20, 2017

@miri64 the doc is rather generic already, I don't see any point in fixing it - but could be extended?!

@miri64
Copy link
Copy Markdown
Member

miri64 commented Nov 20, 2017

I don't see any point in fixing it - but could be extended?!

Extension was what I was asking for. At least with regards to this PR. Something like the sentence "Can be set by setting environment variable DEVELHELP is set to 1 at compile time." would already satisfy me.

@smlng smlng force-pushed the enh/make/develhelp branch from 533b676 to 8a677dc Compare November 20, 2017 15:05
@cladmi cladmi dismissed their stale review November 21, 2017 17:52

Was added in the documentation.

@kaspar030
Copy link
Copy Markdown
Contributor

@miri64 you fine with the extra doc?

doc.txt Outdated
*
* Additional code parts such as (extensive) debug output and sanity
* checks using assertions. To activate set environment variable
* `DEVELHELP=1`, or disable (if on by default) with `DEVELHELP=0`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the "if" looks a little bit out of place here.

@smlng smlng force-pushed the enh/make/develhelp branch from 8a677dc to a05032f Compare November 23, 2017 17:13
@smlng
Copy link
Copy Markdown
Member Author

smlng commented Nov 23, 2017

@miri64 changed wording, better?

Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, ACK.

@miri64 miri64 merged commit ba46317 into RIOT-OS:master Nov 23, 2017
@smlng smlng deleted the enh/make/develhelp branch November 23, 2017 17:39
@aabadie aabadie added this to the Release 2018.01 milestone Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants