Rawhide synchronization for the GNU Binutils
- THIS PAGE IS UNDER DEVELOPMENT AND SHOULD NOT BE CONSIDERED READY FOR USE*
This page documents the process by which the rawhide binutils package is synced with the upstream GNU Binutils project. The aim of this process is to make syncing simple and easy so that it can be performed on a regular basis. Due to the fact that the binutils is an important component in the toolchain used to build many of the packages in rawhide however, it is important to extensively test a new binutils before putting it into the buildroot. This does make the syncing process more time consuming and complicated.
This process is based upon a similar process for the GNU C Library (GlibcRawhideSync), but tweaked to fit the binutils' way of handling patches.
Follow these steps:
1. Make sure that your clone of the upstream GNU Binutils is up to date, on the right branch and clean. If there any problems or uncommitted changes, resolve them before continuing.
cd <upstream-binutils> git switch HEAD git pull git clean -fdx git status
2. Delete any old release tarballs and then create a source tarball from the upstream sources. Change the version number in the tarball's name to a commit id.
rm -f *.xz export COMMIT_ID=`git rev-parse HEAD` ./src-release.sh -x -r `git log -1 --format=%cd --date=format:%F $COMMIT_ID` binutils mv binutils-*.tar.xz binutils-$COMMIT_ID.tar.xz
3. Go to your clone of the fedora binutils package and make sure that it is clean and up to date:
cd <rawhide-binutils> git switch rawhide git pull git clean -fdx git status
4. Delete the current source tarball and then copy in the source tarball created in step 2:
rm -f *.tar.xz cp <upstream-binutils>/binutils*.tar.xz .
5. Edit the binutils.spec file and change the Source0: field to reference the new tarball:
sed --in-place -e "s/Source0:.*/Source0: `ls *.tar.xz`/" binutils.spec
Also check that the use_commit_id_tarballs define in the spec file is set to 1. This define is set to zero when the binutils is rebased to an official GNU Binutils release and only set to 1 once the rawhide syncing process begins.
grep -e "define use_commit_id_tarballs" binutils.spec
Also increment the Release: field by one. FIXME: Create an awk command to do this
s/Release: <N>%{?dist}/Release: <N + 1>%{?dist}/
Also create a new entry in the %changelog section noting that the rebase has occurred and the new NVR.
%changelog * <date> <user name> <email address> - <NVR> - Rebase to commit $COMMIT_ID
6. Create a source tree and discover if any local patches no longer apply:
fedpkg prep
If a patch does not apply, decide if it is no longer necessary, or if it needs to be adjusted. Take whatever actions are necessary to resolve this issue and then repeat step 5 until a clean run is obtained.
If a patch is not needed, remove its entry from the binutils.spec file.
Also schedule the patch to be deleted from the repository:
git rm <unneeded-patch>
Optionally add a mention of this to the changelog entry created in step 6.
- Retire: <unneeded-patch>
Optionally renumber the remaining patches referenced in the binutils.spec file so that they are in a monotonically increasing order.
7. Run a local build to ensure that there are no surprises.
fedpkg local
If there are problems, fix them. Note, local builds run in parallel, so it is not always easy to discover the location of a build failure. If the failure is due to a bug in the upstream sources, then it may be better to abort this sync and wait for the bug to be fixed. Or to fix the bug upstream first and then start the sync process again. If the failure is due to the local patches that are applied to the sources then they may need to be adjusted. If a failure is due to a testsuite problem then either the test might need to be tweaked, or just skipped if there is no easy way to correct it.
8. Then run a scratch build.
rm -f *.rpm fedpkg srpm fedpkg scratch-build --srpm *.rpm
If the build fails, investigate and fix the problems. The most likely cause at this point is new failures in one of the testsuites. Note - the build.log file created for the build for each architecture will include a uuencoded compressed tarballs of the logs from the testsuite runs. Hence the logs can be downloaded and examined locally by:
[download build.log file] uudecode build.log tar xvf binutils-*.tar.xz
9. ADD A STEP HERE TO USE THE MASS PRE-BUILDER TO CHECK THE NEW BINUTILS
10. Finally ceck that the fedora repository has not received any other commits, add the new sources, and commit the changes.
git pull fedpkg new-sources binutils-*.tar.xz binutils-2.19.50.0.1-output-format.sed fedpkg commit -m"Rebase to $COMMIT_ID" fedpkg push fedpkg build
11. Sit back and relax. Have a cup of tea. Then wait for the bug reports to flood in.