From Fedora Project Wiki

Line 11: Line 11:
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.
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.


    <pre>
<pre>
    cd <upstream-binutils>
cd <upstream-binutils>
    git switch HEAD
git switch HEAD
    git pull
git pull
    git status</pre>
git status</pre>


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.
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.


    <pre>
<pre>
    rm -f *.xz
rm -f *.xz
    ./src-release -x binutils
./src-release -x binutils
      mv binutils-*.tar.xz binutils-`git rev-parse HEAD`.tar.xz </pre>
mv binutils-*.tar.xz binutils-`git rev-parse HEAD`.tar.xz </pre>


3. Go to your clone of the fedora binutils package and make sure that it is clean and up to date:
3. Go to your clone of the fedora binutils package and make sure that it is clean and up to date:


    <pre>
<pre>
    cd <rawhide-binutils>
cd <rawhide-binutils>
    git switch rawhide
git switch rawhide
    git pull
git pull
    git status </pre>
git status </pre>


4. Delete the current source tarball and then copy in the source tarball created in step 2:
4. Delete the current source tarball and then copy in the source tarball created in step 2:


    <pre>
<pre>
    rm -f *.tar.xz
rm -f *.tar.xz
    cp <upstream-binutils>/binutils*.tar.xz . </pre>
cp <upstream-binutils>/binutils*.tar.xz . </pre>


5. Edit the ''binutils.spec'' file and change the ''Source:'' field to reference the new tarball:
5. Edit the ''binutils.spec'' file and change the ''Source:'' field to reference the new tarball:


    <pre>
<pre>
    sed --in-place -e "s/Source:.*/Source: `ls *.tar.xz`/" binutils.spec  </pre>
sed --in-place -e "s/Source:.*/Source: `ls *.tar.xz`/" binutils.spec  </pre>


Also check that the ''enable_commit_id_tarballs'' define in the spec file is set to 1.
Also check that the ''enable_commit_id_tarballs'' define in the spec file is set to 1.
Line 47: Line 47:
6. Create a source tree and discover if any local patches no longer apply:
6. Create a source tree and discover if any local patches no longer apply:


  <pre>
<pre>
  fedpkg prep </pre>
fedpkg prep </pre>


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 6 until a clean run is obtained.
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 6 until a clean run is obtained.
Line 55: Line 55:


<pre> fedpkg local </pre>
<pre> fedpkg local </pre>
If there are problems, fix them.


8.  Then run a scratch build.
8.  Then run a scratch build.


<pre>  
<pre>rm -f *.rpm
rm -f *.rpm
fedpkg srpm
fedpkg srpm
fedpkg scratch-build --srpm *.rpm
fedpkg scratch-build --srpm *.rpm </pre>
</pre>

Revision as of 18:01, 20 February 2024

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 package.

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 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
./src-release -x binutils
mv binutils-*.tar.xz binutils-`git rev-parse HEAD`.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 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 Source: field to reference the new tarball:

sed --in-place -e "s/Source:.*/Source: `ls *.tar.xz`/" binutils.spec  

Also check that the enable_commit_id_tarballs define in the spec file is set to 1.

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 6 until a clean run is obtained.

7. Run a local build to ensure that there are no surprises.

 fedpkg local 

If there are problems, fix them.

8. Then run a scratch build.

rm -f *.rpm
fedpkg srpm
fedpkg scratch-build --srpm *.rpm