-
Notifications
You must be signed in to change notification settings - Fork 330
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
normalize mtime #1839
normalize mtime #1839
Conversation
f98a142
to
8c54e20
Compare
8c54e20
to
543459f
Compare
543459f
to
f716ab3
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.
LGTM.
Oh, and please put the text that is now the description of the pull request in the commit message. Signed-off-by is not defined by mkosi, so that can be dropped. |
f716ab3
to
053dd1f
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.
We should normalize the mtime before calling make_tar() or make_cpio() instead of doing it inside those functions
The reason we did it this way is that there is a high probability that the code becomes incorrect over time otherwise. We noticed that we need to normalize mtimes multiple times during a build since cpios for example are created during the build (and need normalized mtimes), after which files in the sysroot are modified (requiring us to normalize mtimes again). |
053dd1f
to
070a1fb
Compare
070a1fb
to
73eb7e5
Compare
133b3ff
to
b77c548
Compare
b77c548
to
9f73009
Compare
9f73009
to
0b1def6
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.
Hmm this seems to granular, we should just normalize the mtimes of /boot and /efi again before we call make_image() again instead of doing it for each invididual file
0b1def6
to
2b27ec4
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.
Ah and maybe also modify load_environment() to pick up SOURCE_DATE_EPOCH from the environment mkosi is invoked from
2b27ec4
to
2fea405
Compare
2fea405
to
e7b5486
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.
Sorry for the many rounds, but I realized we should make this a separate setting so it doesn't have to be configured explicitly via the environment. So what I would suggest is the following:
- Introduce a new setting
SourceDateEpoch
, it's parse function should be more or less identical to the logic you have in theMkosiState
constructor now. - Add a
default_factory
function forSourceDateEpoch
that initializes it from the configured environment (Environment=
) or the host environment (in that order). - Instead of passing
state.source_date_epoch
tonormalize_mtime()
, passstate.config.source_date_epoch
tonormalize_mtime()
.
e7b5486
to
1e76abf
Compare
1e76abf
to
2f47bc9
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.
Almost there
47b0860
to
d07892c
Compare
44683fd
to
78bc91d
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.
Found one more thing
78bc91d
to
46582ce
Compare
EDIT: Alright. Works as expected now. Sorry for that. |
If set, the time stamp from SOURCE_DATE_EPOCH is used to normalize mtime of files. We also need to pass the environment trough when mkosi is invoking itself. Co-authored-by: Malte Poll <mp@edgeless.systems>
46582ce
to
4ccad9e
Compare
Thanks for contributing! |
First part of the implementation of #687
If set, the time stamp from SOURCE_DATE_EPOCH is used to normalize mtime of files. We also need to pass the environment trough when mkosi is invoking itself.