Generate a header defining MOZ_BUILDID

RESOLVED FIXED in Firefox 47

Status

defect
RESOLVED FIXED
3 years ago
Last year

People

(Reporter: glandium, Assigned: glandium)

Tracking

unspecified
mozilla47
Dependency tree / graph

Firefox Tracking Flags

(firefox47 fixed)

Details

Attachments

(2 attachments, 4 obsolete attachments)

Assignee

Description

3 years ago
No description provided.
Assignee

Comment 1

3 years ago
Attachment #8717356 - Flags: review?(mshal)
Assignee

Comment 2

3 years ago
Can't unfortunately use it in AppConstants.java.in, though because the marker is different.
Attachment #8717356 - Attachment is obsolete: true
Attachment #8717356 - Flags: review?(mshal)
Attachment #8717369 - Flags: review?(mshal)
This could be useful in bug 1153978.
Assignee

Comment 5

3 years ago
Not sure how this happened, but I was missing the platform.ini part.
Attachment #8717369 - Attachment is obsolete: true
Attachment #8717369 - Flags: review?(mshal)
Attachment #8717743 - Flags: review?(mshal)
Assignee

Updated

3 years ago
Duplicate of this bug: 1241613
Assignee

Comment 8

3 years ago
Comment on attachment 8717744 [details] [diff] [review]
Only pass MOZ_BUILDID to the one source that requires it in toolkit/xre

Moving this patch to bug 1241613.
Attachment #8717744 - Attachment is obsolete: true
Attachment #8717744 - Flags: review?(mshal)
Assignee

Updated

3 years ago
Blocks: 1241613
Assignee

Updated

3 years ago
Blocks: 1247162
Comment on attachment 8717370 [details] [diff] [review]
Stop using config/buildid in few remaining places

>+$buildid =~ s/^#define MOZ_BUILDID\s+(.*\S)\s*$/$1/;

Why not just (\S+) instead of (.*\S) ? I don't think the header will work if there are whitespace characters in the buildid string anyway.
Attachment #8717370 - Flags: review?(mshal) → review+
Comment on attachment 8717743 [details] [diff] [review]
Generate a header defining MOZ_BUILDID

Overall this looks good, and it addresses my concern about platform.ini not having a buildid dependency now :)

>diff --git a/build/variables.py b/build/variables.py
>+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
>+    if not buildid:
>+        buildid = datetime.now().strftime('%Y%m%d%H%M%S')
>+    output.write("#define MOZ_BUILDID %s\n" % buildid)

client.mk:
ifdef MOZ_UNIFY_BDATE
ifndef MOZ_BUILD_DATE
ifdef MOZ_BUILD_PROJECTS
MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/toolkit/xre/make-platformini.py --print-buildid)
export MOZ_BUILD_DATE
endif
endif

Can we use the new build/variables.py when generating the buildid for universal builds as well? I don't like that we now have two scripts to generate the same thing (a date string) depending on what's being built. If we use build/variables.py here, then I think we can kill make-platformini.py as well. (Or, have make-platformini.py generate buildid.h instead of adding variables.py)
Attachment #8717743 - Flags: review?(mshal) → feedback+
Assignee

Comment 11

3 years ago
Attachment #8717743 - Attachment is obsolete: true
Attachment #8718103 - Flags: review?(mshal)
Comment on attachment 8718103 [details] [diff] [review]
Generate a header defining MOZ_BUILDID

Looks good to me! Though I suppose this comment is out of date now:

https://dxr.mozilla.org/mozilla-central/source/python/mozbuild/mozbuild/android_version_code.py#79
Attachment #8718103 - Flags: review?(mshal) → review+

Comment 14

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/02840dfc6310
https://hg.mozilla.org/mozilla-central/rev/9f7915738557
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47

Comment 15

3 years ago
https://hg.mozilla.org/comm-central/rev/c3cbaf48ff68694c15fbc863c65cb57e6d19da01
Port Bug 1246881 - Generate a header defining MOZ_BUILDID for c-c. rs=bustage=fix
Assignee

Updated

3 years ago
Depends on: 1249912

Updated

Last year
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.