makeutil library func: checkIfEmpty

RESOLVED FIXED

Status

defect
RESOLVED FIXED
8 years ago
2 years ago

People

(Reporter: joey, Assigned: joey)

Tracking

Trunk
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

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.
Assignee: nobody → joey
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])
Depends on: 734121
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.
Attachment #605769 - Flags: review?(khuey)
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.
Attachment #605786 - Flags: review?(khuey)
Attachment #605769 - Flags: review?(khuey)
code review ping
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.
Attachment #605786 - Flags: review?(khuey) → review+
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.
Attachment #605769 - Attachment is obsolete: true
Attachment #605786 - Attachment is obsolete: true
these makefile edits should simmer in b-s for a while.
Patch landed on mozilla-central yesterday by Coop & Philor:
https://hg.mozilla.org/mozilla-central/rev/c598b7b202e7
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Blocks: 746151
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.