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

RFE: allow overriding buildtime and hostname via environment variable #2603

Closed
keszybz opened this issue Aug 4, 2023 · 9 comments
Closed
Assignees

Comments

@keszybz
Copy link
Contributor

keszybz commented Aug 4, 2023

rpm embeds the build time and host into output headers. This is very useful to figure out when and where the build was done. But when trying to trying to reproduce an earlier rpm build, we want to override those to the value that was used in the previous build.

Please add something like RPM_BUILDTIME and RPM_BUILDHOST. When those variables would be set, rpm should use them instead of the actual values. Prior art exists with SOURCE_DATE_EPOCH.

(Or switches to rpmbuild. Or maybe both? The exact interface doesn't matter.)

@kloczek
Copy link
Contributor

kloczek commented Aug 4, 2023

You can do that by rpmbuild --define "%_buildhost <hostname>" <other_params> or you can put permanentny line in ~/.rpmmacros like %_buildhost <hostname>.

@dralley
Copy link
Contributor

dralley commented Aug 7, 2023

As far as BUILDHOST goes, rather than using a default value, it would be better to just disinclude the tag IMO.

@keszybz
Copy link
Contributor Author

keszybz commented Aug 7, 2023

As far as BUILDHOST goes, rather than using a default value, it would be better to just disinclude the tag IMO.

That is certainly an option. But people consider both BUILDTIME and BUILDHOST very useful for figuring out where/when/who exactly build a package. For example, even in Fedora infrastructure which tries to keep things very uniform, builders vary in hardware capabilities and other setup. So at the technical level, I'm weakly on the side of keeping them, but I know that if we were to try to drop those fields, it'd cause a huge discussion, and it's just not worth having that.

@dralley
Copy link
Contributor

dralley commented Aug 7, 2023

Yes, BUILDTIME at the very least is complicated. I'm not sure what infrastructure might rely on BUILDHOST being present, though.

@JanZerebecki
Copy link
Contributor

For reproducible builds in OpenSUSE the BUILDHOST is set to the string reproducible via %_buildhost. The tag is not needed to get its benefit as there is an alternative way: make sure the build host is printed in the build logs (logs do not need to be reproducible), archive the logs of all builds, then for looking it up find the build log from the rpm version.

@cgwalters
Copy link
Contributor

But people consider both BUILDTIME and BUILDHOST very useful for figuring out where/when/who exactly build a package.

For Fedora using Koji, there is always exactly one Koji build for a given NEVRA, and the server side metadata contains the build host.

@ffesti ffesti self-assigned this Oct 11, 2023
@ffesti
Copy link
Contributor

ffesti commented Oct 17, 2023

OK, given that the BUILDHOST can already be set via %_buildhost what is still missing here? Or can we just close this ticket?

@ffesti ffesti added need info Waiting on answer from reporter and removed need info Waiting on answer from reporter labels Oct 18, 2023
@ffesti
Copy link
Contributor

ffesti commented Oct 24, 2023

Guess not. Feel free to re-open if we missed something and there is really something that needs doing.

@ffesti ffesti closed this as completed Oct 24, 2023
@keszybz
Copy link
Contributor Author

keszybz commented Oct 25, 2023

Yeah, it seems that %_buildhost might be enough. I'm just starting to work on this again, so I didn't have time to figure out the details.

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

6 participants