-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file2hex.py: new --gzip-mtime option that defaults to zero + test #15043
file2hex.py: new --gzip-mtime option that defaults to zero + test #15043
Conversation
Codecov Report
@@ Coverage Diff @@
## master #15043 +/- ##
==========================================
+ Coverage 52.93% 52.94% +0.01%
==========================================
Files 309 309
Lines 45268 45273 +5
Branches 10451 10456 +5
==========================================
+ Hits 23961 23969 +8
+ Misses 16542 16536 -6
- Partials 4765 4768 +3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -44,6 +46,7 @@ def main(): | |||
with io.BytesIO() as content: | |||
with open(args.file, 'rb') as fg: | |||
with gzip.GzipFile(fileobj=content, mode='w', | |||
mtime=args.gzip_mtime, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't imagine that the embedded FW would be interested in the timestamp of the host system source file.
IMHO we should simplify by always setting mtime=0. Then the next user that wants reproducible FW won't have to discover that he needs to set --gzip-mtime=0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do unless anyone objects. In that case I will also simplify the gen_inc test that currently ignores the specific bytes where the timestamp is located.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK mtime=0 will still allocate space for a zero'd timestamp, so the test should/can continue to ignore the timestamp. Or it could assert it to be zero if it wanted to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the latter so the test tests the new option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done and ready for re-review.
This makes the output of file2hex.py deterministic by default while also letting the user set the mtime in the gzip header manually if desired. Use the option without any argument to restore the previous behavior that sets the current (and obviously changing) "now" timestamp. To test: ./sanitycheck --tag gen_inc_file Signed-off-by: Marc Herbert <[email protected]>
d3fbbaa
to
ff1006d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
file2hex.py: new --gzip-mtime option that defaults to zero + test
This makes the output of file2hex.py deterministic by default while also
letting the user set the mtime in the gzip header manually if desired.
Use the option without any argument to restore the previous behavior
that sets the current (and obviously changing) "now" timestamp.
To test: ./sanitycheck --tag gen_inc_file
Signed-off-by: Marc Herbert [email protected]