#978498 FTBFS on riscv64: machine `riscv64' not recognized

Package:
src:sofia-sip
Source:
sofia-sip
Submitter:
John Scott
Date:
2022-06-17 10:06:03 UTC
Severity:
normal
Tags:
#978498#5
Date:
2020-12-28 01:26:48 UTC
From:
To:
sofia-sip fails to build on RISC-V [1], and it appears this is because
the generated configure script and/or config.sub and config.guess are too
old.

Please retool Autotools as described in
/usr/share/doc/autotools-dev/README.Debian.gz provided by autotools-dev,
perhaps by using dh_autoreconf.

[1] https://buildd.debian.org/status/package.php?p=sofia-sip

#978498#10
Date:
2021-02-01 23:17:28 UTC
From:
To:
Minimal patch attached using dh_autoreconf.
#978498#19
Date:
2022-02-17 15:06:27 UTC
From:
To:
I can use `sbuild --host=riscv64 -d sid` at last to cross build it, and
it  report the error at end:

```
...
dh_clean
  debian/rules build-arch
dh_testdir
mkdir -p objs
cd objs &&      ../configure --host=riscv64-linux-gnu   \
                              --build=x86_64-linux-gnu   \
                              --prefix=/usr
checking build system type... x86_64-pc-linux-gnu
checking host system type... Invalid configuration `riscv64-linux-gnu': machine `riscv64' not recognized
configure: error: /bin/bash ../config.sub riscv64-linux-gnu failed
make: *** [debian/rules:35: objs/config.status] Error 1
dpkg-buildpackage: error: debian/rules build-arch subprocess returned exit status 2
```
I think this is expection behavior.

Now the question is: how can i push the process go on?
Pabs told me, he has the patch and i can test it or not take effect.

But i can not find the patch and how to apply in sofia-sip source code
or other method.

BR,
vimer

#978498#24
Date:
2022-02-17 15:21:20 UTC
From:
To:
The patch is right here[1] in the bug you've CC’ed?

Jess

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=978498#10

#978498#29
Date:
2022-02-17 15:21:40 UTC
From:
To:
Hi!

It's probably a matter of running dh_autoreconf. In any case, there is also a new upstream
version available [1].

Adrian

#978498#34
Date:
2022-02-18 02:52:08 UTC
From:
To:
Hi,
Ok, I will search the dh_autoreconf usage.
There are two options for me:

1) apply the patch as Jess and IOhannes tell me in another email, or

2) to cross-built with sbuild on new upstream version of sofia-sip?
Right?

I will try both and in return to tell here maybe.

BR,
vimer

#978498#39
Date:
2022-02-19 14:32:43 UTC
From:
To:
Hi,
I apply patch[1] to sip source and pass for " machine `riscv64' not
recognized" error, but fail at last:

```
...
touch man/man1/sip-date.1 man/man1/sip-options.1 man/man1/localinfo.1 man/man1/addrinfo.1 man/man1/stunc.1 man/man1/sip-dig.1
   /bin/mkdir -p '/<<PKGBUILDDIR>>/debian/tmp/usr/share/man/man1'
     /usr/bin/install -c -m 644 man/man1/sip-date.1 man/man1/sip-options.1 man/man1/localinfo.1 man/man1/addrinfo.1 man/man1/stunc.1 man/man1/sip-dig.1 '/<<PKGBUILDDIR>>/debian/tmp/usr/share/man/man1'
make[3]: Leaving directory '/<<PKGBUILDDIR>>/objs'
make[2]: Leaving directory '/<<PKGBUILDDIR>>/objs'
make[1]: Leaving directory '/<<PKGBUILDDIR>>/objs'
touch install-arch-stamp
dh_testdir
dh_testroot
dh_install --sourcedir=debian/tmp
dh_install: warning: Cannot find (any matches for) "usr/lib/libsofia-sip-ua-glib.so.*" (tried in debian/tmp, debian/tmp)

dh_install: warning: libsofia-sip-ua-glib3 missing files: usr/lib/libsofia-sip-ua-glib.so.*
dh_install: warning: Cannot find (any matches for) "usr/lib/libsofia-sip-ua-glib.a" (tried in debian/tmp, debian/tmp)

dh_install: warning: libsofia-sip-ua-glib-dev missing files: usr/lib/libsofia-sip-ua-glib.a
dh_install: warning: Cannot find (any matches for) "usr/lib/libsofia-sip-ua-glib.so" (tried in debian/tmp, debian/tmp)

dh_install: warning: libsofia-sip-ua-glib-dev missing files: usr/lib/libsofia-sip-ua-glib.so
dh_install: warning: Cannot find (any matches for) "usr/lib/pkgconfig/sofia-sip-ua-glib.pc" (tried in debian/tmp, debian/tmp)

dh_install: warning: libsofia-sip-ua-glib-dev missing files: usr/lib/pkgconfig/sofia-sip-ua-glib.pc
dh_install: error: missing files, aborting
make: *** [debian/rules:87: binary-arch] Error 25
dpkg-buildpackage: error: fakeroot debian/rules binary-arch subprocess returned exit status 2
```

And i test `sbuild --host=armhf -d sid` in order to compare the build log, the error is same.
But `--host` is ok.
I try to fix it with many ways but can not find why it is not build or install
the missing file.
Maybe my chroot have some problem?

BR,
vimer

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=978498;filename=sofia-sip-retooling.patch;msg=10

#978498#44
Date:
2022-02-19 15:18:31 UTC
From:
To:
Hello Vimer!

I suggest using qemu-based sbuild environment for building packages for
riscv64. There is an outdated guide I wrote for sh4 [1] which explains
on how to set up such an environment.

Normally, you should be able to create such a changeroot with:

# apt install sbuild
# cd /srv
# debbootstrap --no-check-gpg --include=debian-ports-archive-keyring --arch=riscv64 \
  unstable sid-riscv64-sbuild http://ftp.ports.debian.org/debian-ports/

and use this configuration:

glaubitz@nofan:~> cat /etc/schroot/chroot.d/sid-riscv64-sbuild
[sid-riscv64-sbuild]
description=Debian sid chroot for riscv64
type=directory
directory=/srv/sid-riscv64-sbuild
#groups=Debian,guest,d-i
#profile=dsa
#aliases=sid
groups=root,sbuild,glaubitz,buildd
root-groups=root,sbuild,glaubitz,buildd
#command-prefix=
#source-root-users=glaubitz,sbuild,buildd
#run-setup-scripts=true
#run-exec-scripts=true
glaubitz@nofan:~>

Then you can packages virtually natively using --arch=riscv64.

Adrian

#978498#49
Date:
2022-02-20 09:50:26 UTC
From:
To:
Hi, Adrian!

That's very cool and i can build riscv arch sofia-sip debian package
with the method you suggested!

But there is one more litian error here. It is not a big deal i think.

And i can confirm the patch[1] taking effect in fact.

I am wonder how to push the package porting into debian  port's repositories
in next step.

BR,
vimer

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=978498#10

#978498#56
Date:
2022-06-17 09:57:25 UTC
From:
To:
fixed 978498 1.12.11+20110422.1+1e14eea~dfsg-2+b1