[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Need advice for cross building gammu



Hi Boian,

long story short: you make gammu cross-build by supporting arch-indep builds of
gammu-doc. This not only aids cross-building but also lowers the load on our
buildds, so that is useful for other reasons as well. A possible patch:

--- a/debian/rules
+++ b/debian/rules
@@ -11,8 +11,16 @@ include /usr/share/dpkg/buildflags.mk
 %:
        dh $@ --with sphinxdoc --buildsystem=cmake

-override_dh_auto_build:
-       dh_auto_build --parallel
+%-arch:
+       dh $@ --buildsystem=cmake
+
+%-indep:
+       dh $@ --with sphinxdoc --buildsystem=cmake
+
+clean:
+       dh $@ --buildsystem=cmake
+
+execute_after_dh_auto_build-indep:
        dh_auto_build -- manual-html

 override_dh_auto_test:


Now the long story:

Quoting Boian Bonev (2021-10-20 22:50:00)
> Recently I have adopted the gammu package in Debian and there are couple of
> things preventing its cross build:
> 
> 1) Missing deps: [1]
> 
> python3-breathe:arm64 (>= 4.1.0) which is a virtual package and is not provided
> by any available package
> 
> python3-sphinx:arm64 (>= 1.3) which is a virtual package and is not provided by
> any available package
> 
> I suppose that nothing can be done about those until they become available in
> the cross-build chroot. Or maybe adding :any can help because they are needed
> as amd64 not arm64?

The best way to fix sphinx issues is to build doc packages in the indep targets
(see above). If that doesn't work (but it does work for gammu) then you can add
:native instead of :any. For more details you can read #818115.

> I have tried adding :any to the above two and that broke normal builds, also
> tried moving them to Build-Depend-Indep and normal builds are OK but cross
> fails in the same way.

How are you cross-building? Build-Depend-Indep is not needed for cross builds
because you do not build arch:all packages during a cross build. I build it
like this:

DEB_BUILD_OPTIONS=nocheck sbuild --no-run-autopkgtest --no-run-lintian --build=amd64 --host=arm64 --no-arch-all --arch-any

> 2) When some day the above are resolved, the build will fail on the test step
>    unless cmake is clever and skips it or dh detects nocheck and skips the
>    step as a whole:
> 
> override_dh_auto_test:
>         dh_auto_test --no-parallel
> 
> So my question - is it proper to make this conditional, e.g.:
> 
> override_dh_auto_test:
> ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
>   dh_auto_test --no-parallel
> else
>   true
> endif
> 
> or there is a better way to handle that?

Yes, don't run tests when you cross build. Run your build with
DEB_BUILD_OPTIONS=nocheck.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature


Reply to: