auto-enable KIO_ASSERT_SLAVE_STATES also for from-git builds

Authored by sitter on Oct 21 2019, 11:38 AM.



testing high level functionality of a bunch of relevant slaves yielded no
obvious problems, so let's enable slave state assertion for all builds from
git repos now. this should give much wider testing coverage

the build type warning has been removed because it would not serve any
purpose with KIO_ASSERT_SLAVE_STATES being automatically enabled regardless
of build type (Q_ASSERT eventually changes behavior based on type-dependent
flags anyway)

Test Plan

cmake with .git enables the option, without it doesn't, with .git and type set to Release a warning is printed

Diff Detail

R241 KIO
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
sitter created this revision.Oct 21 2019, 11:38 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptOct 21 2019, 11:38 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
sitter requested review of this revision.Oct 21 2019, 11:38 AM
dfaure requested changes to this revision.Oct 21 2019, 6:40 PM
dfaure added inline comments.

It does, but people can still pass -DCMAKE_BUILD_TYPE=Release, or RelWithDebInfo (as I do for profiling).

Won't this give them the warning below then, even if they don't set the KIO_ASSERT_SLAVE_STATES option)?

I would just set ASSERT_SLAVE_STATES_DEFAULT to OFF when the build type isn't Debug.
(i.e. checking for that as part of the condition on line 42)

This revision now requires changes to proceed.Oct 21 2019, 6:40 PM
sitter added inline comments.Oct 22 2019, 9:54 AM

Well, at that point you can choose to:

  • explicitly -DASSERT_SLAVE_STATES_DEFAULT=OFF which will not trigger the warning as the option will not default to the auto detection if you set it manually
  • just ignore the warning

If you don't want that I'd actually get rid of the warning altogether. Determining what a given build type does isn't so reliably doable as users may have custom build types that define whatever, so the warning is more of a crutch than anything.

dfaure added inline comments.Oct 22 2019, 10:23 AM

Please kill the warning then.
I want things to be simple for new developers. Having to find out what this "Assert slave states default" variable does shouldn't be part of the first day experience compiling KF5. And I certainly don't want to teach people to ignore warnings, either.

sitter updated this revision to Diff 68526.Oct 22 2019, 10:33 AM

remove warning

sitter edited the summary of this revision. (Show Details)Oct 22 2019, 10:34 AM
sitter marked 3 inline comments as done.
dfaure accepted this revision.Oct 24 2019, 10:39 PM
This revision is now accepted and ready to land.Oct 24 2019, 10:39 PM
This revision was automatically updated to reflect the committed changes.