Open scgtrp opened 2 years ago
I completely agrees with @scgtrp in addition I would suggest that -reproducible
flag would imply the usage of SOURCE_DATE_EPOCH
environment variable as described by reproducible-builds.org.
I was unaware of that, but having read it, I think I agree. You could accomplish the same thing with -mkfs-time $SOURCE_DATE_EPOCH
, but if it's clear the user meant that, might as well just do it.
I'd propose something like "use the first available of -mkfs-time
, $SOURCE_DATE_EPOCH
(maybe only if reproducible
?), current time (only if !reproducible
), 0
". That seems like the least surprising behavior.
How about defaulting -mkfs-time
to the newest timestamp of any inode in the created filesystem when using -reproducible
? That would be inherently stable if the source content is unchanged.
If I create the same image twice, with
-reproducible
, without changing the contents of the source directory:I would expect to get two identical output files. However, they are not:
The only difference between the two is the timestamp in the filesystem superblock, which is set to the current time even in
-reproducible
mode:It seems that
-reproducible
should, in addition to all the other things it keeps constant, replace the timestamp with a constant value (0? 0xFFFFFFFF?).(Also, happy whatever winter holiday(s) you celebrate! I feel weird submitting this today because of the "Merry Christmas! I got you a bug report!" thing but if I don't do it right now it'll slip my mind and never get done.)