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

set SOURCE_DATE_EPOCH and incorporate rebuild counter / release #955

Open
JanZerebecki opened this issue Sep 26, 2023 · 6 comments
Open

Comments

@JanZerebecki
Copy link
Member

Set SOURCE_DATE_EPOCH and incorporate rebuild counter / release, so that even for rebuilds with unchanged source but updated build depends the date always increases and no build has the same date.

Initially for rpm to replace %use_source_date_epoch_as_buildtime .

But later also needed for other build types, like kiwi, podman, docker, etc. When there is no changelog use the last git commit date or osc commit date.

@JanZerebecki
Copy link
Member Author

Previously I tried to implement this in openSUSE/product-builder#26 and rpm-software-management/rpm#2677 , both of which turned out to be the wrong place.

@mlschroe
Copy link
Member

I think you should do this in /etc/profile.d/suse-buildsystem.sh which is part of the post-build-checks package.

@JanZerebecki
Copy link
Member Author

@mlschroe would you be willing to implement this, as I have no idea about this area? E.g. I have the following questions:

How can one get at the changelog for the current build?
How can one get the last commit time, e.g. from the metadata for obs version controlled source for the current build, like is available in .osc for osc checkouts?
How can one get the last commit time if the source is from git, when we move to that for ALP, i.e. where to find the the .git?
post-build-checks is not installed for podman/docker type builds, so what to do for these?

@JanZerebecki
Copy link
Member Author

For git based builds the mtime is available in the source:

> iosc api /source/SUSE:ALP:Source:Standard:Core:1.0:Build/kernel-source/_scmsync.obsinfo
mtime: 1695368662
commit: 30adb0966b6635f406ad54781bfbe26f3b752557
url: https://src.suse.de/ALP-pool/kernel-source
revision: 30adb0966b6635f406ad54781bfbe26f3b752557
projectscmsync: https://src.suse.de/products/SUSE_ALP_Standard#38f989dfa5fed7564353e78aa3600fe7e26a31a7

We could add the buildcounter/revision to be available at build time in the file /.buildenv.

@JanZerebecki
Copy link
Member Author

The obsinfo file should be available as $TOPDIR/SOURCES/_scmsync.obsinfo.

@JanZerebecki
Copy link
Member Author

The change in 5d1da85 works in my local testing. Together with openSUSE/post-build-checks#58 it should fix this issue.

@mlschroe Please make a release and whatever is necessary to have it deployed on build.opensuse.org.

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

2 participants