Skip to content
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

Remove or disable check file-contains-date-and-time #1317

Open
JanZerebecki opened this issue Feb 7, 2025 · 9 comments
Open

Remove or disable check file-contains-date-and-time #1317

JanZerebecki opened this issue Feb 7, 2025 · 9 comments

Comments

@JanZerebecki
Copy link

Remove or by default disable check file-contains-date-and-time, because DATE and TIME are perfectly reproducible for years, because we patched gcc to use SOURCE_DATE_EPOCH instead of the build time. Instead it causes people to sometimes create patches that break reproducibility: https://src.opensuse.org/jengelh/schismtracker/pulls/1

@danigm
Copy link
Member

danigm commented Feb 10, 2025

Okay, so this is a check that we can filter for openSUSE, or do you think it's something that we can remove for everyone?

Right now this check just looks for today date in files like, "%b %e %Y": https://github.com/rpm-software-management/rpmlint/blob/main/rpmlint/checks/BuildRootAndDateCheck.py#L19

@JanZerebecki
Copy link
Author

I think we can remove it for everyone, as if they care about if rebuilds change output they would build with SOURCE_DATE_EPOCH.

It seems how this is implemented we can only usefully remove both file-contains-date-and-time and file-contains-current-date together.

@bmwiedemann You have more experience here. It seems this matches the resolved date in the build output instead of the place holders DATE and TIME, as I initially assumed. So it currently also matches other ways that should be fixed. I assume the false positives are probably more than the real positives, but I'm not sure. Do you think it is still better to remove both checks?

@Conan-Kudo
Copy link
Member

What was the point of this check in the first place?

@bmwiedemann
Copy link

Before the invention of SOURCE_DATE_EPOCH, the check helped people find occurences of __TIME__ to patch them out to avoid extra rebuilds/republishes in OBS. But that is no more needed for 5+ years.

@Conan-Kudo
Copy link
Member

Yes, but OBS isn't the only build system in the world that might need this. I would say that a comment about what this check actually does and is for in the file would make sense and just turn it off by default in the rpmlint policy.

@JanZerebecki
Copy link
Author

@Conan-Kudo, do you know of a build system that would need it? I can't think of one even in the abstract that would make sense.

@bmwiedemann, can you answer the question from my previous comment?

@Conan-Kudo
Copy link
Member

People building with GitHub/GitLab/Jenkins/etc. would. Or Koji/Koschei? Or even COPR. Not all distributions do things the way OBS does.

@Conan-Kudo
Copy link
Member

we patched gcc to use SOURCE_DATE_EPOCH

I'm pretty sure much distros haven't done this either.

@JanZerebecki
Copy link
Author

JanZerebecki commented Feb 10, 2025

How would those build systems be impacted? AFAIK they would not be. Also that gcc change is included upstream, so yes they do have that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants