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.
I am testing this suggestion, and it appears to work as expected.
Would the following patch be acceptable?
--- a/build/ variables. py variables. py FILENAME = 'sourcestamp.txt'
+++ b/build/
@@ -13,10 +13,12 @@ SOURCESTAMP_
def buildid_ header( output) : get('MOZ_ BUILD_DATE' ) get('MOZ_ BUILDID' ) get('MOZ_ BUILD_DATE' )
buildid = datetime. now().strftime( '%Y%m%d% H%M%S')
output. write(" #define MOZ_BUILDID %s\n" % buildid)
- buildid = os.environ.
- if buildid and len(buildid) != 14:
- print('Ignoring invalid MOZ_BUILD_DATE: %s' % buildid, file=sys.stderr)
- buildid = None
+ buildid = os.environ.
+ if buildid is None:
+ buildid = os.environ.
+ if buildid and len(buildid) != 14:
+ print('Ignoring invalid MOZ_BUILD_DATE: %s' % buildid, file=sys.stderr)
+ buildid = None
if not buildid:
I.e. prioritize the `MOZ_BUILDID` environment variable over `MOZ_BUILD_DATE`, if it is set.