Bug 256998 - net-im/tg_owt: Fails to build on aarch64: CMakeLists.txt:77 (add_library): Target "tg_owt" links to target "tg_owt::libusrsctp" but the target was not found
Summary: net-im/tg_owt: Fails to build on aarch64: CMakeLists.txt:77 (add_library): ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm64 Any
: --- Affects Many People
Assignee: Mikael Urankar
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2021-07-05 16:37 UTC by pr
Modified: 2021-07-18 15:03 UTC (History)
2 users (show)

See Also:
henry.hu.sh: maintainer-feedback+
koobs: merge-quarterly?


Attachments
patch to files/patch-CMakeLists.txt to remove libusrsctp target for all the architectures (534 bytes, patch)
2021-07-06 10:47 UTC, pr
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description pr 2021-07-05 16:37:29 UTC
net-im/tg_owt does not build on aarch64:
-- Configuring done
CMake Error at CMakeLists.txt:77 (add_library):
  Target "tg_owt" links to target "tg_owt::libusrsctp" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_COLOR_MAKEFILE
    CMAKE_MODULE_LINKER_FLAGS
    CMAKE_SHARED_LINKER_FLAGS
    CMAKE_VERBOSE_MAKEFILE
    THREADS_HAVE_PTHREAD_ARG


CMake Generate step failed.  Build files cannot be regenerated correctly.
*** Error code 1

Stop.
make: stopped in /usr/ports/net-im/tg_owt

Full poudriere log avaialble on request

# uname -a
FreeBSD asn 14.0-CURRENT FreeBSD 14.0-CURRENT #0 n247726-2f514e6f13de: Sun Jul  4 06:36:33 CEST 2021     root@asn:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC-NODEBUG  arm64

Please note the package builds on 12.2 amd64
Comment 1 Henry Hu 2021-07-05 19:35:25 UTC
Well, I have no aarch64 machine (I may have some aarch64 SBCs, but they're too weak for telegram), so I can't fix this. Patches are welcome.
Comment 2 pr 2021-07-06 10:47:11 UTC
Created attachment 226265 [details]
patch to files/patch-CMakeLists.txt to remove libusrsctp target for all the architectures

The proposed patch removes tg_owt::libusrsctp target for all the architectures, not only i386 and amd64.

It builds on aarch64 (poudriere builds telegram-desktop ok with net-im/tg_owt). Not tested on other ARMs.

I cannot assess whether the built library nor telegram-desktop work, due to (temporary?) lack of graphic support on my system.

As a side note, you might be willing to add to the port Makefile:
ONLY_FOR_ARCHS=        aarch64 amd64 arm armv7 i386
ONLY_FOR_ARCHS_REASON= upstream does not support other archs
Comment 3 pr 2021-07-07 23:05:07 UTC
I confirm telegram-desktop built on tg_owt works in aarch64.
Comment 4 pr 2021-07-14 07:00:46 UTC
Hi, this is solved by the proposed patch. Can it be committed?
Comment 5 Henry Hu 2021-07-15 03:16:02 UTC
Will take a look at the weekend. Need to test how this works on amd64.
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-15 03:39:22 UTC
(In reply to Henry Hu from comment #1)

Note: Anyone may test aarch64 (and other architectures) via poudriere build with the QEMU option, which can then create jails with any architecture. Very useful and helpful for QA
Comment 7 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-15 03:46:41 UTC
Comment on attachment 226265 [details]
patch to files/patch-CMakeLists.txt to remove libusrsctp target for all the architectures

^Triage: Please set the maintainer-approval attachment flag (to +) on patches for ports you maintain to signify approval

Attachment -> Details -> maintainer-approval [+]
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-15 03:46:59 UTC
Comment on attachment 226265 [details]
patch to files/patch-CMakeLists.txt to remove libusrsctp target for all the architectures

Wrong issue, apologies.
Comment 9 Mikael Urankar freebsd_committer 2021-07-15 09:26:21 UTC
Why do we need to disable libusrsctp on FreeBSD? It's listed in LIB_DEPENDS and it's not used?
Comment 10 Henry Hu 2021-07-18 03:19:44 UTC
I should have noticed that this patch does not affect i386 and amd64. I didn't consider other platforms when I created the port. Tried to build amd64 and it still builds fine. I'm okay with this patch. Please commit it.

(In reply to Mikael Urankar from comment #9)
We're not disabling libusrsctp and it's still used. Notice that CMakeLists.txt is also patched to link with libusrsctp, with cmake_external.cmake also patched to provide the include and link directories.
The tg_owt carries its own version of libusrsctp, and has its own cmake file to build it. Since we already have it in the ports, I've patched it to use the ports version instead.
Comment 11 commit-hook freebsd_committer 2021-07-18 14:58:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=eda0db32e774b8e58b831ad0b3fe4b1ecc85cd3e

commit eda0db32e774b8e58b831ad0b3fe4b1ecc85cd3e
Author:     Aoek <pr@aoek.com>
AuthorDate: 2021-07-18 14:51:49 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2021-07-18 14:56:54 +0000

    net-im/tg_owt: Fix build on aarch64

    Don't build the bundled libusrsctp, use the one provided by
    net/libusrsctp like it's done on other arches.

    PR:             256998
    Approved by:    Henry Hu (maintainer)

 net-im/tg_owt/files/patch-CMakeLists.txt | 8 ++++++++
 1 file changed, 8 insertions(+)
Comment 12 Mikael Urankar freebsd_committer 2021-07-18 15:03:29 UTC
Thanks!
Comment 13 commit-hook freebsd_committer 2021-07-18 15:03:30 UTC
A commit in branch 2021Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=330c751fd75884ec2891ff920187c991013cf06d

commit 330c751fd75884ec2891ff920187c991013cf06d
Author:     Aoek <pr@aoek.com>
AuthorDate: 2021-07-18 14:51:49 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2021-07-18 15:02:24 +0000

    net-im/tg_owt: Fix build on aarch64

    Don't build the bundled libusrsctp, use the one provided by
    net/libusrsctp like it's done on other arches.

    PR:             256998
    Approved by:    Henry Hu (maintainer)

    (cherry picked from commit eda0db32e774b8e58b831ad0b3fe4b1ecc85cd3e)

 net-im/tg_owt/files/patch-CMakeLists.txt | 8 ++++++++
 1 file changed, 8 insertions(+)