Last Comment Bug 735638 - makeutil library func: checkIfEmpty
: makeutil library func: checkIfEmpty
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: Joey Armstrong [:joey]
:
Mentors:
Depends on: 734121
Blocks: 746151
  Show dependency treegraph
 
Reported: 2012-03-14 05:02 PDT by Joey Armstrong [:joey]
Modified: 2012-04-17 07:53 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
make assert macros {library flavor} for checking shell defined make variables (5.04 KB, patch)
2012-03-14 08:39 PDT, Joey Armstrong [:joey]
no flags Details | Diff | Review
toolkit/xre/Makefile.in - reduce shell command use (6.87 KB, patch)
2012-03-14 09:10 PDT, Joey Armstrong [:joey]
khuey: review+
Details | Diff | Review
add utility function checkIfEmpty (6.46 KB, patch)
2012-03-22 07:35 PDT, Joey Armstrong [:joey]
no flags Details | Diff | Review

Description Joey Armstrong [:joey] 2012-03-14 05:02:20 PDT
Add a checkIfEmpty makefile library function that will accept a list of variable names and report "Variable ${var} does not contain a value" if undef, empty or contains spaces.
Default behavior should invoke $(error) and force failure.
An optional parameter can be passed to alter this behavior by calling $(warning).

This function will mainly be used for testing values after asynchronous shell commands have been run and failed to propagate failure { in the absence of SHELL += -e }.

A unit test will also be needed, both positive and negative, to validate behavior of the function.
Comment 1 Joey Armstrong [:joey] 2012-03-14 05:10:27 PDT
Let's make this easy by defining three macros, two for named access:
  warnIfEmpty
  errorIfEmpty

and a 3rd that will accept values and a callback function $(error|warning) as $(lastword)
checkIfEmpty,@vars [warn|empty])
Comment 2 Joey Armstrong [:joey] 2012-03-14 08:39:07 PDT
Created attachment 605769 [details] [diff] [review]
make assert macros {library flavor} for checking shell defined make variables

makeutil library functions for warning about or failing on make macros w/o a value.

A unit test has been setup to verify functionality but is currently wrappered with a 'MANUAL_TEST' conditional until syntax can be found able to test errorIfEmpty w/o aborting the make run.
Comment 3 Joey Armstrong [:joey] 2012-03-14 09:10:55 PDT
Created attachment 605786 [details] [diff] [review]
toolkit/xre/Makefile.in - reduce shell command use

Same patch as last time but copied config/makefiles/makeutils.mk into js/src/config/makefiles/makeutils.mk to keep the check-sync-dirs.py test at bay.
Comment 4 Joey Armstrong [:joey] 2012-03-15 12:21:09 PDT
code review ping
Comment 5 Kyle Huey [:khuey] (khuey@mozilla.com) (Away until 6/13) 2012-03-22 05:27:37 PDT
Comment on attachment 605786 [details] [diff] [review]
toolkit/xre/Makefile.in - reduce shell command use

Review of attachment 605786 [details] [diff] [review]:
-----------------------------------------------------------------

r=me provided manual.sh is still not getting checked in.
Comment 6 Joey Armstrong [:joey] 2012-03-22 07:35:16 PDT
Created attachment 608329 [details] [diff] [review]
add utility function checkIfEmpty

r=kyle carried forward.  Only change was to remove manual.sh from the patch.  735638 and 734121 should have been the only patches that included the script.
Comment 7 Joey Armstrong [:joey] 2012-03-22 08:01:02 PDT
these makefile edits should simmer in b-s for a while.
Comment 8 Chris Cooper [:coop] 2012-04-03 10:40:09 PDT
Comment on attachment 608329 [details] [diff] [review]
add utility function checkIfEmpty

https://hg.mozilla.org/projects/build-system/rev/329bd787a846
Comment 9 Joey Armstrong [:joey] 2012-04-05 10:14:30 PDT
Patch landed on mozilla-central yesterday by Coop & Philor:
https://hg.mozilla.org/mozilla-central/rev/c598b7b202e7

Note You need to log in before you can comment on or make changes to this bug.