Comment 14 for bug 1830096

Revision history for this message
In , Olivier Tilloy (osomon) wrote :

I am testing this suggestion, and it appears to work as expected.
Would the following patch be acceptable?

    --- a/build/variables.py
    +++ b/build/variables.py
    @@ -13,10 +13,12 @@ SOURCESTAMP_FILENAME = 'sourcestamp.txt'

     def buildid_header(output):
    - buildid = os.environ.get('MOZ_BUILD_DATE')
    - if buildid and len(buildid) != 14:
    - print('Ignoring invalid MOZ_BUILD_DATE: %s' % buildid, file=sys.stderr)
    - buildid = None
    + buildid = os.environ.get('MOZ_BUILDID')
    + if buildid is None:
    + buildid = os.environ.get('MOZ_BUILD_DATE')
    + if buildid and len(buildid) != 14:
    + print('Ignoring invalid MOZ_BUILD_DATE: %s' % buildid, file=sys.stderr)
    + buildid = None
         if not buildid:
             buildid = datetime.now().strftime('%Y%m%d%H%M%S')
         output.write("#define MOZ_BUILDID %s\n" % buildid)

I.e. prioritize the `MOZ_BUILDID` environment variable over `MOZ_BUILD_DATE`, if it is set.