Closed
Bug 332535
Opened 19 years ago
Closed 19 years ago
don't update nsBuildID.h timestamp if build id is the same
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bryner, Assigned: bryner)
Details
Attachments
(6 files)
|
852 bytes,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
|
598 bytes,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
|
1.88 KB,
patch
|
bryner
:
review+
|
Details | Diff | Splinter Review |
|
1.56 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.44 KB,
patch
|
Details | Diff | Splinter Review | |
|
557 bytes,
patch
|
bryner
:
review+
|
Details | Diff | Splinter Review |
Updating the timestamp on this header causes all sorts of things to recompile, even if the build id hasn't changed. We should compare to the old file when generating the build id, and only replace it if there's a difference.
| Assignee | ||
Comment 1•19 years ago
|
||
The fix is actually for build_number, which nsBuildID.h is generated from.
Attachment #216991 -
Flags: review?(benjamin)
Comment 2•19 years ago
|
||
Comment on attachment 216991 [details] [diff] [review]
fix
If diff -q is portable we should probably use that.
Attachment #216991 -
Flags: review?(benjamin) → review+
| Assignee | ||
Comment 3•19 years ago
|
||
(In reply to comment #2)
> (From update of attachment 216991 [details] [diff] [review] [edit])
> If diff -q is portable we should probably use that.
>
We don't use it anywhere else, I'm guessing that it's not.
| Assignee | ||
Comment 4•19 years ago
|
||
checked in
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 5•19 years ago
|
||
Apparently, non-bash shells don't have "!". This patch avoids using it.
Attachment #217124 -
Flags: review?(benjamin)
Comment 6•19 years ago
|
||
No need for the shell stuff, let's do this in perl.
Comment 7•19 years ago
|
||
Comment 8•19 years ago
|
||
I also have this in a local tree, though I guess that's unneeded now:
@@ -39,6 +39,7 @@
use strict;
use IO::File;
+use File::Compare;
BEGIN {
use Exporter ();
@@ -158,8 +157,13 @@
close $INFILE;
close $OUTFILE;
- unlink $outfile;
- rename "${outfile}.old", "$outfile";
+ if (compare("$outfile", "${outfile}.old") == 0) {
+ unlink "${outfile}.old";
+ }
+ else {
+ unlink $outfile;
+ rename "${outfile}.old", "$outfile";
+ }
}
sub SetMilestone($) {
Comment 9•19 years ago
|
||
I've checked in attachment 217128 [details] [diff] [review].
| Assignee | ||
Comment 10•19 years ago
|
||
(In reply to comment #9)
> I've checked in attachment 217128 [details] [diff] [review] [edit].
>
Who reviewed it?
I considered doing it in the perl script to start with, but I figured let's keep the perl script simple -- it outputs the build id to a file. Anything else we want to do is more in the realm of how we generate that file at build time.
Comment 11•19 years ago
|
||
Comment on attachment 217124 [details] [diff] [review]
fix non-bash shells
bryner's fix is better. Let's back out the perl hackery which should not have been checked in without review anyway.
Attachment #217124 -
Flags: review?(benjamin) → review+
Comment 12•19 years ago
|
||
No review (though I did have it looked at before checking in) since it was a simple bustage fix.
I went with the perl solution because it was already avoiding when possible to overwrite the target file in the unofficial builds case, and making it do the same for official builds was trivial and seemed simpler than always writing it out and dealing with not changing the modification time in the Makefile.
I hear you on keeping tools simple, though I'd argue my change hasn't made this tool more complicated. The output of the tool is still a file (if so desired) with the requested string (YYYYMMDDHH or 10 zeroes).
Let me know if you want me to back this out, or feel free to do so yourself.
Comment 13•19 years ago
|
||
(In reply to comment #11)
> (From update of attachment 217124 [details] [diff] [review] [edit])
> Let's back out the perl hackery
You make it sound like hacking perl is something awful! ;-)
And I respectfully disagree that bryner's fix is better, but I guess that's a matter of taste.
Comment 14•19 years ago
|
||
Then you probably would also like to remove the (then) redundant check in the unofficial build case.
| Assignee | ||
Comment 15•19 years ago
|
||
Comment on attachment 217128 [details] [diff] [review]
Alternative fix
Should have read closer, I didn't realize it already had this behavior for unofficial builds. r=me.
Attachment #217128 -
Flags: review+
Comment 16•19 years ago
|
||
+ # Only overwrite file if contents are not already set to 0
that comment is now wrong... it should say something like that it only overwrites it if the contents are different.
Comment 17•19 years ago
|
||
Updated•19 years ago
|
Attachment #217209 -
Flags: review?(bryner)
| Assignee | ||
Updated•19 years ago
|
Attachment #217209 -
Flags: review?(bryner) → review+
Updated•8 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•