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
Add option to set repodata mtime to specific value #9
base: master
Are you sure you want to change the base?
Conversation
|
This seems like a bad idea, you are just brute forcing the timestamp of the metadata no matter what the input is. If you want to go this way make it a "use this timestamp" instead of the clamp idea. What I think you want is something more like setting the timestamp of the primary/etc. metadata based on the latest timestamp of the rpms (even this needs more thought though because there are problems here where you have a set of rpms generate metadata and then remove the newest rpm and regenerate the metadata ... and the timestamp goes backwards). The obvious solution is to also take any basedir directories mtime into account. |
What do you think about binding this with 'revision'? Like
This is exactly why why I discarded this idea before (see linked bugzilla comment). As for basedir mtime - do you mean doing this by default, without separate option? Otherwise I don't see why it would be better than an option to force specific timestamp. That would only change how to provide timestamp value ( A totally different solution could be skipping |
|
So the main problem is people use the timestamp value as a meaningful value of "this always goes up, so newer is better". Eg. yum will use it to decide you've hit an old mirror and not download older data. mirrormanager also uses it to order metalink data (the SuSE metalink generator may do something similar).
If you prefer that I'm fine with it, either way. My main concern was the clamping would do confusing things in weird edge cases, so it'd be better to just always set it to a value instead of clamp.
I don't think yum cares about the timestamp on the files but I wouldn't trust that until someone looked at the code and did some tests.
Yeh, like that seems a useful feature that multiple runs of createrepo will generate the exact same repodata ... and I can't even think of a reason to not do it.
My guess at that is that everything blows up in some horrible way, but I haven't tested that either :). |
|
Unfortunately the basedir mtime idea wouldn't work that way, because running |
|
Actually, maybe even separate |
I agree with you that we should always strive to keep things simple so, with that in mind, setting mtime of the metadata files and OTOH, as you say, people may be using that field arbitrarily (all the man page says is "Arbitrary string for a repository revision.") and changing the default behavior could easily introduce unexpected regressions somewhere. So, if we decide to go down the explicit route, one random idea to avoid having too many new options would be to change the option name It's basically what you proposed originally but without the need to specify the desired mtime twice on the command line; once for One drawback would be that people might not be familiar with the specification and the whole idea, so the option might not make that much sense in such form. What do you think? |
|
If going to support actual specification, mere presence of
Here, I think the second version will be less confusing, as there are also other use cases than reproducibly building installation image. |
|
Oh, you're right, thanks for the correction. I didn't read the spec carefully and missed the "MUST use" part. The first approach of checking the env var presence looks better in this context, however, it's still a bit brittle since you could theoretically have such an env var defined (for whatever reason) without knowing anything about the spec or reproducible builds. What I also didn't realize is that the linked bugzilla was not originally filed by you and it wasn't about this particular specification. Given all that, I agree that simply supporting reproducible builds (regardless of the specification) is the better approach here. I still think, though, that having a single option to achieve this (instead of |
I assume with explicit value to that option of course, right? |
Yes :) (you can also name it One alternative that also came to mind would be that we would keep the But honestly, I don't know what's better. @james-antill , any idea? |
OK. I'll be watching what |
This allows to create repodata reproducibly. BZ 1430662
|
Pushed update with |
|
createrepo_c PR: rpm-software-management/createrepo_c#105 |
…me for repomd.xml
This allows to create repodata reproducibly (together with 'revision'
option). One use case is setting this to SOURCE_DATE_EPOCH during installation iso compose, to make it reproducible.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1430662