#91 Prepare for bin-sbin merge
Opened a month ago by zbyszek. Modified 13 days ago
rpms/ zbyszek/glibc bin-sbin-merge  into  rawhide

file modified
+29 -15
@@ -136,8 +136,8 @@ 

  

  -- Note: We use _prefix because Fedora's UsrMove says so.

  function call_ldconfig ()

-   post_exec("Error: call to %{_prefix}/sbin/ldconfig failed.\n",

- 	    "%{_prefix}/sbin/ldconfig")

+   post_exec("Error: call to ldconfig failed.\n",

+ 	    "ldconfig")

  end

  

  function update_gconv_modules_cache ()
@@ -325,6 +325,10 @@ 

  Obsoletes: glibc-profile < 2.4

  Obsoletes: nscd < 2.35

  Provides: ldconfig

+ %if "%{_sbindir}" == "%{_bindir}"

+ # We rely on filesystem to create the compat symlinks for us

+ Requires: filesystem(unmerged-sbin-symlinks)

+ %endif

  Provides: /sbin/ldconfig

  Provides: /usr/sbin/ldconfig

  
@@ -569,6 +573,11 @@ 

  Requires: %{name} = %{version}-%{release}

  Recommends: tzdata >= 2003a

  

+ %if "%{_sbindir}" == "%{_bindir}"

+ # We rely on filesystem to create the compat symlinks for us

+ Requires: filesystem(unmerged-sbin-symlinks)

+ %endif

+ 

  %description common

  The glibc-common package includes common binaries for the GNU libc

  libraries, as well as national language (locale) support.
@@ -1434,6 +1443,12 @@ 

  # via hardlinks, so we must group them ourselves.

  hardlink -c %{glibc_sysroot}/usr/lib/locale

  

+ # Implement Changes/UsrMerge and Changes/Unify_bin_and_sbin.

+ mv %{glibc_sysroot}/sbin/ldconfig %{glibc_sysroot}/%{_sbindir}/

+ %if "%{_sbindir}" == "%{_bindir}"

+ mv %{glibc_sysroot}/usr/sbin/{iconvconfig,zic} %{glibc_sysroot}/%{_bindir}/

+ %endif

+ 

  # install_different:

  #	Install all core libraries into DESTDIR/SUBDIR. Either the file is

  #	installed as a copy or a symlink to the default install (if it is the
@@ -1516,7 +1531,7 @@ 

  truncate -s 0 %{glibc_sysroot}/var/cache/ldconfig/aux-cache

  

  # ldconfig is statically linked, so we can use the new version.

- %{glibc_sysroot}/sbin/ldconfig -N -r %{glibc_sysroot}

+ %{glibc_sysroot}/%{_sbindir}/ldconfig -N -r %{glibc_sysroot}

  

  ##############################################################################

  # Install info files
@@ -1645,10 +1660,10 @@ 

  # The #line directives gperf generates do not give the proper

  # file name relative to the build directory.

  pushd locale

- ln -s programs/*.gperf .

+ ln -sf programs/*.gperf .

  popd

  pushd iconv

- ln -s ../locale/programs/charmap-kw.gperf .

+ ln -sf ../locale/programs/charmap-kw.gperf .

  popd

  

  %if %{with docs}
@@ -1733,7 +1748,7 @@ 

  		    exit 1

  		fi

  		set -x

- 		ln -s $sltarget usr/$lib/$slbase

+ 		ln -sf $sltarget usr/$lib/$slbase

  	    done

  	fi

      done
@@ -1877,10 +1892,7 @@ 

  # - The info files '%{_infodir}/dir'

  # - The partial (lib*_p.a) static libraries, include files.

  # - The static files, objects, and unversioned DSOs.

- # - The bin, locale, some sbin, and share.

- #   - We want iconvconfig in the main package and we do this by using

- #     a double negation of -v and [^i] so it removes all files in

- #     sbin *but* iconvconfig.

+ # - Share and ldconfig and iconvconfig

  # - All the libnss files (we add back the ones we want later).

  # - All bench test binaries.

  # - The aux-cache, since it's handled specially in the files section.
@@ -1897,7 +1909,7 @@ 

  	-e '%{_libdir}/gconv/gconv-modules.d/gconv-modules-extra\.conf$' \

  	-e '%{_prefix}/bin' \

  	-e '%{_prefix}/lib/locale' \

- 	-e '%{_prefix}/sbin/[^i]' \

+ 	-e '%{_prefix}/sbin' \

  	-e '%{_prefix}/share' \

  	-e '/var/db/Makefile' \

  	-e '/libnss_.*\.so[0-9.]*$' \
@@ -1911,6 +1923,10 @@ 

  	-e '/lib/.*\.so.*' \

  %endif

  	> glibc.filelist

+ cat master.filelist \

+ 	| grep -E \

+ 	-e 'bin/(ldconfig|iconvconfig)' \

+ 	>> glibc.filelist

  

  # Add specific files:

  # - The nss_files, nss_compat, and nss_db files.
@@ -2066,11 +2082,9 @@ 

  # iconvconfig which needs to go in glibc.  The iconvconfig binary is kept in

  # the main glibc package because we use it in the post-install scriptlet to

  # rebuild the gconv-modules.cache.  The makedb binary is in nss_db.

- grep '%{_prefix}/bin' master.filelist \

- 	| grep -v '%{_prefix}/bin/makedb' \

+ grep -E '%{_prefix}/s?bin' master.filelist \

+ 	| grep -vE 'bin/(makedb|iconvconfig|ldconfig|memusage|mtrace|pcprofiledump|xtrace)' \

  	>> common.filelist

- grep '%{_prefix}/sbin' master.filelist \

- 	| grep -v '%{_prefix}/sbin/iconvconfig' >> common.filelist

  # All of the files under share go into the common package since they should be

  # multilib-independent.

  # Exceptions:

no initial comment

rebased onto ee09cab

a month ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/2b71f05283d840f5b4c18d1b34429a01

2 new commits added

  • Move ldconfig to %{_sbindir}, adjust paths for merged-sbin
  • Make short-circuit builds work
a month ago

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/d21182d455534f5ab8abeed2ba261380

@zbyszek Thank you for the PR! Can you you provide any information on how you tested the changes or reviewed the results were just preparatory without changing anything in the build?

Metadata Update from @codonell:
- Request assigned

a month ago

For the first patch: I was rebuilding glibc in a loop and it takes a while on my laptop, so I tried mock --short-circuit=install and the build was failing when ln encountered the existing symlink. With the patch, it works. (In systemd we have a helper function that tries to symlink, and if that fails, calls readlink() and doesn't fail if it already points to the right location. I wish ln would implement the same. -f is a workaround that is not great.)

For the second patch: it does make a change for unmerged systems: /sbin/ldconfig is moved to /usr/sbin/ldconfig and the scriptlet is changed to use that path. (Both paths work, but I thought it'd cleaner to use the new path everywhere). After the merge, /usr/sbin/ldconfig will be moved to /usr/bin/ldconfig, though all four paths will work.

https://copr.fedorainfracloud.org/coprs/zbyszek/unmerged-sbin/build/7296730/
and
https://copr.fedorainfracloud.org/coprs/zbyszek/merged-sbin/build/7296729/
are two builds with the patches (the second in a merged buildroot).

I tested the installation of the merged-sbin version in a local container, and it seems to work fine. But looking at the builds again, I see that zic got also added to the main subpackage, which wasn't intended. I'll submit a new version.

2 new commits added

  • Move ldconfig to %{_sbindir}, adjust paths for merged-sbin
  • Make short-circuit builds work
a month ago

2 new commits added

  • Move ldconfig to %{_sbindir}, adjust paths for merged-sbin
  • Make short-circuit builds work
a month ago

With the updated version, change between koji and local merged-sbin build:

$ rpmdiff koji/glibc-2.39.9000-11.fc41.x86_64.rpm /var/lib/mock/fedora-rawhide-x86_64/result/glibc-2.39.9000-11.fc41.x86_64.rpm       
added       REQUIRES filesystem(unmerged-sbin-symlinks)  
removed     /usr/sbin/iconvconfig
added       /usr/bin/iconvconfig
removed     /sbin/ldconfig
added       /usr/bin/ldconfig
S.5.....    POSTIN
S.......... /usr/lib/.build-id/12/5d9fbc78923921b23f9b4154c68a0c6ab7c24e
S.......... /usr/lib/.build-id/90/9611c289bd6b0a69cd3c508a1c67757c6baa8c

$ rpmdiff koji/glibc-common-2.39.9000-11.fc41.x86_64.rpm /var/lib/mock/fedora-rawhide-x86_64/result/glibc-common-2.39.9000-11.fc41.x86_64.rpm
added       REQUIRES filesystem(unmerged-sbin-symlinks)  
removed     /usr/sbin/zic
added       /usr/bin/zic
S.......... /usr/lib/.build-id/ac/090fcba67cb8f09f98f36d8270d9680d061c4b

Updated copr builds:
https://copr.fedorainfracloud.org/coprs/zbyszek/unmerged-sbin/build/7303195/
https://copr.fedorainfracloud.org/coprs/zbyszek/merged-sbin/build/7303193/

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/74493dd84a264511944d6fb0218802f4

2 new commits added

  • Move ldconfig to %{_sbindir}, adjust paths for merged-sbin
  • Make short-circuit builds work
a month ago

A short while later:

$ rpmdiff koji/glibc-2.39.9000-11.fc41.x86_64.rpm merged-sbin/glibc-2.39.9000-11.fc41.x86_64.rpm
added       REQUIRES filesystem(unmerged-sbin-symlinks)  
removed     /sbin/ldconfig
added       /usr/bin/ldconfig
removed     /usr/sbin/iconvconfig
added       /usr/bin/iconvconfig
S.5.....    POSTIN
S.......... /usr/lib/.build-id/12/5d9fbc78923921b23f9b4154c68a0c6ab7c24e
S.......... /usr/lib/.build-id/90/9611c289bd6b0a69cd3c508a1c67757c6baa8c

$ rpmdiff koji/glibc-common-2.39.9000-11.fc41.x86_64.rpm merged-sbin/glibc-common-2.39.9000-11.fc41.x86_64.rpm
added       REQUIRES filesystem(unmerged-sbin-symlinks)  
removed     /usr/sbin/zic
added       /usr/bin/zic
S.......... /usr/lib/.build-id/ac/090fcba67cb8f09f98f36d8270d9680d061c4b

$ rpmdiff koji/glibc-2.39.9000-11.fc41.x86_64.rpm unmerged-sbin/glibc-2.39.9000-11.fc41.x86_64.rpm 
removed     /sbin/ldconfig
added       /usr/sbin/ldconfig
S.5.....    POSTIN
S.......... /usr/lib/.build-id/12/5d9fbc78923921b23f9b4154c68a0c6ab7c24e

$ rpmdiff koji/glibc-common-2.39.9000-11.fc41.x86_64.rpm unmerged-sbin/glibc-common-2.39.9000-11.fc41.x86_64.rpm

This is the last version I pushed here and the diff is as expected.

Build succeeded.
https://fedora.softwarefactory-project.io/zuul/buildset/136b9c2c8ea34fd39bbcccb46d8d5662

rebased onto ecdafb6

13 days ago

@zbyszek I wanted to check with you to see if this is blocking other work or a Fedora change request?

We discussed this as a Fedora glibc team and the consensus was that we could fix this more cleanly directly upstream along with the /usr merge changes required.

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci
https://fedora.softwarefactory-project.io/zuul/buildset/ac27b881c4f6491982c2348834a7ae08

Hi. The bin-sbin merge change is currently blocked on an update of selinux-policy. I submitted a pull request and there was some initial review, but it's still not merged, and without that, I can't really do other steps. After selinux-policy is updated, we can actually start doing the merge, i.e. merge changes for rpm and filesystem packages. There are some packages which would start to FTBFS and/or FTI at that point, mostly because they have a symlink from /usr/sbin/foo to /usr/bin/foo. But glibc doesn't have anything like this, so the package will both build and install even when the transition is in progress. Though, since it provides filse in /sbin, it'll prevent the merge from being finalized, i.e. the creation of the /usr/sbin -> bin symlink. But there's quite a few other packages with this issue, so in practice the full merge is going to take some time so this is not very pressing. In summary, if you can do the changes upstream and push them to Fedora in a few weeks, then that'd be great and there isn't any particular need to be faster.

Metadata