XPCShellEnvironment.cpp and XPCShellImpl.cpp are using __DATE__ and __TIME__

RESOLVED FIXED in Firefox 41

Status

()

Core
XPConnect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

(Blocks: 1 bug)

unspecified
mozilla41
Points:
---

Firefox Tracking Flags

(firefox41 fixed)

Details

Attachments

(1 attachment)

5.17 KB, patch
Bobby Holley (parental leave - send mail for anything urgent)
: review+
efaust
: review+
Details | Diff | Splinter Review
(Assignee)

Description

3 years ago
Both for the essentially the same code:

in the former:

static bool
BuildDate(JSContext *cx, unsigned argc, JS::Value *vp)
{
    JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
    fprintf(stdout, "built on %s at %s\n", __DATE__, __TIME__);
    args.rval().setUndefined();
    return true;
}

in the latter:
static bool
BuildDate(JSContext* cx, unsigned argc, jsval* vp)
{
    CallArgs args = CallArgsFromVp(argc, vp);
    fprintf(gOutFile, "built on %s at %s\n", __DATE__, __TIME__);
    args.rval().setUndefined();
    return true;
}

This prevents reproducible builds. Is there a reason this is needed instead of using the buildid we're using for everything else?
Looks like dead code to me. https://dxr.mozilla.org/mozilla-central/search?q=regexp%3A\WBuildDate
It's exposed to JS as a build() function.
And does anyone call it?
(Assignee)

Comment 4

3 years ago
js.cpp has the same code, too.
(Assignee)

Comment 5

3 years ago
Come to think of it, the usefulness of these functions is questionable: they don't even return anything, they only print out the build time. Which in itself is not exactly a useful information. Is it a build of code from that day, or a later build of older code? How about removing this entirely?

ni? bholley for xpcshell and jorendorf for js shell.
Flags: needinfo?(jorendorff)
Flags: needinfo?(bobbyholley)
Happy to get rid of it if it doesn't break anything.
Flags: needinfo?(bobbyholley)
(Assignee)

Comment 7

3 years ago
Created attachment 8610922 [details] [diff] [review]
Remove build() function from js and xpc shells
Assignee: nobody → mh+mozilla
Attachment #8610922 - Flags: review?(jorendorff)
Attachment #8610922 - Flags: review?(bobbyholley)
Comment on attachment 8610922 [details] [diff] [review]
Remove build() function from js and xpc shells

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

I guess this might be useful if you have an xpcshell binary sitting around and want to know how old it is? I guess that still doesn't tell you all that much.
Attachment #8610922 - Flags: review?(bobbyholley) → review+
(Assignee)

Comment 9

3 years ago
The file date is presumably giving as much information :)
Comment on attachment 8610922 [details] [diff] [review]
Remove build() function from js and xpc shells

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

Stealing review as per request on IRC.
Attachment #8610922 - Flags: review?(jorendorff) → review+

Comment 11

3 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/c021a5e9721c
https://hg.mozilla.org/mozilla-central/rev/c021a5e9721c
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox41: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
(Assignee)

Updated

3 years ago
Flags: needinfo?(jorendorff)
You need to log in before you can comment on or make changes to this bug.