Bug 1916936 - Review Request: libdispatch - Apple's Grand Central Dispatch library
Summary: Review Request: libdispatch - Apple's Grand Central Dispatch library
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Vasiliy Glazov
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-15 21:24 UTC by Ron Olson
Modified: 2021-02-22 22:19 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-02-17 05:09:00 UTC
Type: ---
Embargoed:
vascom2: fedora-review+


Attachments (Terms of Use)

Description Ron Olson 2021-01-15 21:24:08 UTC
Spec URL: https://tachoknight.fedorapeople.org/libdispatch/libdispatch.spec
SRPM URL: https://tachoknight.fedorapeople.org/libdispatch/libdispatch-5.3.2-1.fc33.src.rpm
Description: Apple's Grand Central Dispatch library
Fedora Account System Username: tachoknight

Comment 1 Neal Gompa 2021-01-15 21:39:00 UTC
CMake 3.18 is coming in RHEL 8.4 in the spring. This is tracked in bug 1816874.

Comment 2 Ron Olson 2021-01-15 21:42:31 UTC
Should I remove the reference now, or could I update it when it's available?

Comment 3 Neal Gompa 2021-01-16 22:16:31 UTC
Please remove it now.

Comment 4 Ron Olson 2021-01-16 22:21:48 UTC
Okay, removed. Updated spec and SRPM at the same locations above.

Comment 5 Neal Gompa 2021-01-17 02:49:40 UTC
> %global debug_package %{nil}

Why are you doing this?

> Provides:       %{name} = %{version}-%{release}

This is redundant, as RPM autogenerates this already.

> cmake -G Ninja -DCMAKE_INSTALL_PREFIX=%{buildroot}%{_usr} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .
> ninja
> [..]
> ninja install


Why isn't this using the CMake macros, like so?

> %cmake -G Ninja
> %cmake_build
> [..]
> %cmake_install

> %post -p /sbin/ldconfig
> %postun -p /sbin/ldconfig

This is unneeded for EPEL8+ and Fedora. If you need EPEL7 compatibility, use "%ldconfig_scriptlets" instead: https://fedoraproject.org/wiki/EPEL:Packaging#Shared_Libraries

Comment 6 Ron Olson 2021-01-17 04:40:45 UTC
The %global debug_package %{nil} is added because without it, the package fails with an "RPM build error: empty %files file debugfiles.list" error; from what I've gathered via some searching, the issue is related to the same reason that I'm not using the %cmake macros; they don't expand correctly to build successfully. Trying to use %cmake -G Ninja by itself defaults to gcc, trying to pass the -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ flags result in complaints that /usr/bin/clang can't compile a simple program. 

Other than that, I removed the Provides (I didn't know that was no longer necessary) along with the %post and %postrun.

Spec and SRPM replaced with the latest-n-greatest.

Comment 7 Neal Gompa 2021-01-17 13:51:11 UTC
Try doing "%undefine hardened_build 1" instead of "%global debug_package %{nil}" and using the macros normally (with your flags setting clang as the compiler). That should eliminate the breakage for clang.

Though why are you building it with Clang instead of GCC?

Comment 8 Ron Olson 2021-01-17 23:25:07 UTC
I added %global _hardened_build 0 based on https://fedoraproject.org/wiki/Changes/Harden_All_Packages#Troubleshooting_steps_for_package_maintainers to the top of the file, then modified the spec file to use the cmake macros and got exactly the same errors. 

gcc doesn't work because of the difference in flags. For example, when trying to build it with gcc you immediately get:

cc: error: unrecognized command-line option ‘-Warray-bounds-pointer-arithmetic’
cc: error: unrecognized command-line option ‘-Wassign-enum’
cc: error: unrecognized command-line option ‘-Watomic-properties’
cc: error: unrecognized command-line option ‘-Wcomma’; did you mean ‘-Wcomment’?
cc: error: unrecognized command-line option ‘-Wconditional-uninitialized’; did you mean ‘-Wno-uninitialized’?
cc: error: unrecognized command-line option ‘-Wcovered-switch-default’; did you mean ‘-Wno-switch-default’?
cc: error: unrecognized command-line option ‘-Wdocumentation’
cc: error: unrecognized command-line option ‘-Wduplicate-enum’; did you mean ‘-Wduplicated-cond’?
cc: error: unrecognized command-line option ‘-Widiomatic-parentheses’; did you mean ‘-Wno-parentheses’?
cc: error: unrecognized command-line option ‘-Winfinite-recursion’
cc: error: unrecognized command-line option ‘-Wnewline-eof’
cc: error: unrecognized command-line option ‘-Wnullable-to-nonnull-conversion’
cc: error: unrecognized command-line option ‘-Wobjc-interface-ivars’
cc: error: unrecognized command-line option ‘-Wover-aligned’
cc: error: unrecognized command-line option ‘-Wshorten-64-to-32’
cc: error: unrecognized command-line option ‘-Wstatic-in-inline’
cc: error: unrecognized command-line option ‘-Wsuper-class-method-mismatch’
cc: error: unrecognized command-line option ‘-Wunguarded-availability’
cc: error: unrecognized command-line option ‘-fblocks’

Comment 9 Vasiliy Glazov 2021-01-19 09:38:01 UTC
May be you should add this macro to use clang properly:
%global toolchain clang

Comment 10 Ron Olson 2021-01-19 17:34:04 UTC
The %global toolchain clang macro did make it work. I had to add a patch to handle -Werror -Wunused-result with asprintf() in the tests directory. Updated spec and srpm in the same location as before.

Comment 11 Ron Olson 2021-01-31 16:28:26 UTC
I updated the spec and srpm with the new version that was released last week:

Spec URL: https://tachoknight.fedorapeople.org/libdispatch/libdispatch.spec
SRPM URL: https://tachoknight.fedorapeople.org/libdispatch/libdispatch-5.3.2-1.fc33.src.rpm

Comment 12 Ron Olson 2021-01-31 16:28:33 UTC
ugh, copy and paste fail:

SRPM URL: https://tachoknight.fedorapeople.org/libdispatch/libdispatch-5.3.3-1.fc33.src.rpm

Comment 13 Vasiliy Glazov 2021-01-31 17:21:35 UTC
You must create -devel subpackage with header files.

Comment 14 Vasiliy Glazov 2021-02-01 07:13:00 UTC
Generally it works now. lastfm plugin for deadbeef compiled succesfully.
So need to create devel subpackage and I will finish review.

Comment 15 Ron Olson 2021-02-01 16:14:57 UTC
Great that it's working for you! I added the -devel package. 

Spec URL: https://tachoknight.fedorapeople.org/libdispatch/libdispatch.spec
SRPM URL: https://tachoknight.fedorapeople.org/libdispatch/libdispatch-5.3.3-1.fc33.src.rpm

Comment 16 Vasiliy Glazov 2021-02-01 18:14:48 UTC
/usr/include/Block.h already provided by libblocksruntime-devel package. May be conflict.

And requires for devel change to 
Requires:       %{name}%{?_isa} = %{version}-%{release}

Comment 17 Ron Olson 2021-02-01 18:35:00 UTC
I made the change to the spec file to your suggestion, thanks! 

I was thinking of retiring the libblockruntime package as libdispatch basically replaces it. Would it be a good idea to add an "Obsoletes" entry to the spec file for libblocksruntime?

Comment 18 Vasiliy Glazov 2021-02-01 18:40:23 UTC
I think versioned Obsoletes needed.

Comment 20 Ron Olson 2021-02-01 19:13:34 UTC
Okay, I updated the spec with what I think is the appropriate values based on the link you provided, plus some research I did to make sure I was doing it correctly.

Comment 21 Vasiliy Glazov 2021-02-02 06:42:52 UTC
We have problems:
libdispatch.x86_64: W: self-obsoletion libblocksruntime < 7.0.0-5 obsoletes libblocksruntime = 5.3.3-1.fc34
libdispatch.x86_64: E: invalid-soname /usr/lib64/libBlocksRuntime.so libBlocksRuntime.so
libdispatch.x86_64: E: invalid-soname /usr/lib64/libdispatch.so libdispatch.so
libdispatch.x86_64: E: binary-or-shlib-defines-rpath /usr/lib64/libdispatch.so ['$ORIGIN']

1. Need more investigate about obsoletion in this case.
2. Is it possible to add version for libs?
3. Add BuildRequires:  chrpath
and
chrpath --delete %{buildroot}%{_libdir}/libdispatch.so
after %cmake_install

Comment 22 Vasiliy Glazov 2021-02-02 11:43:46 UTC
I see to the Epoch bump. Because 5.3.3 < 7.0.0.

Comment 23 Ron Olson 2021-02-02 19:57:20 UTC
I made the suggested changes and tested it using toolbox (woohoo, SilverBlue for the win!) and it obsoleted libblocksruntime correctly. 

As far as versioning the libs, the Apple CMake scripts don't do that, it would have to be done manually with `ln -s` and all that; would that interfere with the %cmake_install macro?

Spec URL: https://tachoknight.fedorapeople.org/libdispatch/libdispatch.spec
SRPM URL: https://tachoknight.fedorapeople.org/libdispatch/libdispatch-5.3.3-1.fc33.src.rpm

Comment 24 Vasiliy Glazov 2021-02-03 08:46:13 UTC
Approved.

Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated
[ ] = Manual review needed


Issues:
=======
- Package installs properly.
  Note: Installation errors (see attachment)
  See: https://docs.fedoraproject.org/en-US/packaging-guidelines/
- Development (unversioned) .so files in -devel subpackage, if present.
  Note: Unversioned so-files directly in %_libdir.
  See: https://docs.fedoraproject.org/en-US/packaging-
  guidelines/#_devel_packages


===== MUST items =====

C/C++:
[x]: Package does not contain kernel modules.
[x]: Package contains no static executables.
[x]: If your application is a C or C++ application you must list a
     BuildRequires against gcc, gcc-c++ or clang.
[x]: Header files in -devel subpackage, if present.
[x]: Package does not contain any libtool archives (.la)
[x]: Rpath absent or only used for internal libs.

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "*No copyright* Apache License 2.0",
     "Apache License 2.0". 60 files have unknown license. Detailed output
     of licensecheck in /home/vascom/1916936-libdispatch/licensecheck.txt
[x]: License file installed when any subpackage combination is installed.
[x]: Package requires other packages for directories it uses.
     Note: No known owner of /usr/include/dispatch, /usr/include/os
[x]: Package must own all directories that it creates.
     Note: Directories without known owners: /usr/include/dispatch,
     /usr/include/os
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[x]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[x]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[x]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 0 bytes in 0 files.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[x]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[x]: Patches link to upstream bugs/comments/lists or are otherwise
     justified.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[x]: Description and summary sections in the package spec file contains
     translations for supported Non-English languages, if available.
[-]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Fully versioned dependency in subpackages if applicable.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[x]: Spec use %global instead of %define unless justified.

===== EXTRA items =====

Generic:
[!]: Rpmlint is run on all installed packages.
     Note: Mock build failed
     See: https://docs.fedoraproject.org/en-US/packaging-
     guidelines/#_use_rpmlint
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Spec file according to URL is the same as in SRPM.


Installation errors
-------------------
INFO: mock.py version 2.9 starting (python version = 3.9.1, NVR = mock-2.9-1.fc33)...
Start: init plugins
INFO: selinux enabled
Finish: init plugins
INFO: Signal handler active
Start: run
Start: chroot init
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled package manager cache
Start: cleaning package manager metadata
Finish: cleaning package manager metadata
INFO: enabled HW Info plugin
Mock Version: 2.9
INFO: Mock Version: 2.9
Finish: chroot init
INFO: installing package(s): /home/vascom/1916936-libdispatch/results/libdispatch-5.3.3-1.fc34.x86_64.rpm /home/vascom/1916936-libdispatch/results/libdispatch-debugsource-5.3.3-1.fc34.x86_64.rpm /home/vascom/1916936-libdispatch/results/libdispatch-devel-5.3.3-1.fc34.x86_64.rpm /home/vascom/1916936-libdispatch/results/libdispatch-debuginfo-5.3.3-1.fc34.x86_64.rpm
ERROR: Command failed: 
 # /usr/bin/dnf --installroot /var/lib/mock/fedora-rawhide-x86_64/root/ --releasever 34 --setopt=deltarpm=False --allowerasing --disableplugin=local --disableplugin=spacewalk install /home/vascom/1916936-libdispatch/results/libdispatch-5.3.3-1.fc34.x86_64.rpm /home/vascom/1916936-libdispatch/results/libdispatch-debugsource-5.3.3-1.fc34.x86_64.rpm /home/vascom/1916936-libdispatch/results/libdispatch-devel-5.3.3-1.fc34.x86_64.rpm /home/vascom/1916936-libdispatch/results/libdispatch-debuginfo-5.3.3-1.fc34.x86_64.rpm --setopt=tsflags=nocontexts



Rpmlint
-------
Checking: libdispatch-5.3.3-1.fc34.x86_64.rpm
          libdispatch-devel-5.3.3-1.fc34.x86_64.rpm
          libdispatch-debuginfo-5.3.3-1.fc34.x86_64.rpm
          libdispatch-debugsource-5.3.3-1.fc34.x86_64.rpm
          libdispatch-5.3.3-1.fc34.src.rpm
libdispatch.x86_64: W: spelling-error %description -l en_US multicore -> multicolored
libdispatch.x86_64: W: spelling-error %description -l en_US xnu -> nu, gnu, x nu
libdispatch.x86_64: W: spelling-error %description -l en_US pthread -> thread, p thread
libdispatch.x86_64: W: incoherent-version-in-changelog 5.3.3-1 ['1:5.3.3-1.fc34', '1:5.3.3-1']
libdispatch.x86_64: W: self-obsoletion libblocksruntime < 7.0.0-5 obsoletes libblocksruntime = 5.3.3-1.fc34
libdispatch.x86_64: E: invalid-soname /usr/lib64/libBlocksRuntime.so libBlocksRuntime.so
libdispatch.x86_64: E: invalid-soname /usr/lib64/libdispatch.so libdispatch.so
libdispatch-devel.x86_64: W: no-documentation
libdispatch.src: W: spelling-error %description -l en_US multicore -> multicolored
libdispatch.src: W: spelling-error %description -l en_US xnu -> nu, gnu, x nu
libdispatch.src: W: spelling-error %description -l en_US pthread -> thread, p thread
5 packages and 0 specfiles checked; 2 errors, 9 warnings.




Unversioned so-files
--------------------
libdispatch: /usr/lib64/libBlocksRuntime.so
libdispatch: /usr/lib64/libdispatch.so

Source checksums
----------------
https://github.com/apple/swift-corelibs-libdispatch/archive/swift-5.3.3-RELEASE.tar.gz#/corelibs-libdispatch.tar.gz :
  CHECKSUM(SHA256) this package     : 84a482afefdcda26c7dc83e3b75e662ed7705786a34a6b4958c0cdc6cace2c46
  CHECKSUM(SHA256) upstream package : 84a482afefdcda26c7dc83e3b75e662ed7705786a34a6b4958c0cdc6cace2c46


Requires
--------
libdispatch (rpmlib, GLIBC filtered):
    ld-linux-x86-64.so.2()(64bit)
    libBlocksRuntime.so()(64bit)
    libc.so.6()(64bit)
    libpthread.so.0()(64bit)
    rtld(GNU_HASH)

libdispatch-devel (rpmlib, GLIBC filtered):
    libdispatch(x86-64)

libdispatch-debuginfo (rpmlib, GLIBC filtered):

libdispatch-debugsource (rpmlib, GLIBC filtered):



Provides
--------
libdispatch:
    libBlocksRuntime.so()(64bit)
    libblocksruntime
    libdispatch
    libdispatch(x86-64)
    libdispatch.so()(64bit)

libdispatch-devel:
    libdispatch-devel
    libdispatch-devel(x86-64)

libdispatch-debuginfo:
    debuginfo(build-id)
    libdispatch-debuginfo
    libdispatch-debuginfo(x86-64)

libdispatch-debugsource:
    libdispatch-debugsource
    libdispatch-debugsource(x86-64)



Generated by fedora-review 0.7.6 (b083f91) last change: 2020-11-10
Command line :/usr/bin/fedora-review -b 1916936
Buildroot used: fedora-rawhide-x86_64
Active plugins: C/C++, Shell-api, Generic
Disabled plugins: Python, PHP, Java, Perl, R, SugarActivity, fonts, Haskell, Ocaml
Disabled flags: EPEL6, EPEL7, DISTTAG, BATCH, EXARCH

Comment 25 Ron Olson 2021-02-03 14:39:39 UTC
Thank you very much for reviewing this, Vasiliy.

Comment 26 Fedora Update System 2021-02-04 15:21:22 UTC
FEDORA-2021-f1022ad7a1 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-f1022ad7a1

Comment 27 Fedora Update System 2021-02-05 01:27:14 UTC
FEDORA-2021-f1022ad7a1 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --advisory=FEDORA-2021-f1022ad7a1 \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-f1022ad7a1

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 28 Vasiliy Glazov 2021-02-05 05:30:32 UTC
Build please for rawhide too.

Comment 29 Miro Hrončok 2021-02-08 11:37:23 UTC
The devel package does not install because it does not require the base package with epoch. bz1926156.

Comment 30 Fedora Update System 2021-02-08 20:09:25 UTC
FEDORA-2021-1076f40eaf has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-1076f40eaf

Comment 31 Fedora Update System 2021-02-09 01:26:59 UTC
FEDORA-2021-1076f40eaf has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf install --enablerepo=updates-testing --advisory=FEDORA-2021-1076f40eaf \*`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-1076f40eaf

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 32 Fedora Update System 2021-02-17 05:09:00 UTC
FEDORA-2021-1076f40eaf has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 33 Vasiliy Glazov 2021-02-22 18:40:54 UTC
So what about rawhide and F34 builds?


Note You need to log in before you can comment on or make changes to this bug.