- Package:
- src:wordgrinder
- Source:
- wordgrinder
- Submitter:
- Helmut Grohne
- Date:
- 2021-11-19 07:57:03 UTC
- Severity:
- normal
- Tags:
wordgrinder fails to cross build from source for multiple reasons. It starts with wordgrinder running plain make without passing any cross tools. That part is best solved by using dh_auto_build. Then, the makefile runs a build.lua script that hard codes the build architecture pkg-config. PKG_CONFIG support should be added to both Makefile and build.lua. Beyond that, it strips with the build architecture strip. In addition to breaking cross compilation, that approach also breaks generation of -dbgsym packages as well as DEB_BUILD_OPTIONS=nostrip. It is best to defer stripping to dh_strip and that happens to fix the cross build aspect as well. The attached patch fixes all of the issues mentioned above. However, it does not make cross builds succeed as the test suite fails. Cross builds do pass nocheck via DEB_BUILD_OPTIONS, but wordgrinder does not honour that. So the next step is adding nocheck support. Anyway, please consider applying the attached patch as an incremental step and close this bug when doing so even without adding nocheck support. Helmut
Thanks --- yes, that needs fixing. Unfortunately, while wearing my upstream hat, I've rewritten the build system, but I've applied some changes to make it honour variables like CC and PKG_CONFIG. The diff is here, if you're interested: https://github.com/davidgiven/wordgrinder/pull/181/files The new version's not packaged for Debian yet as there are still some upstream fixes to be done. Is there actually a formal spec for the expected interface that polite Makefiles should honour to make cross building possible? And can you point me at the Debian tools you're using to do these checks?
Thanks --- yes, that needs fixing. Unfortunately, while wearing my upstream hat, I've rewritten the build system, but I've applied some changes to make it honour variables like CC and PKG_CONFIG. The diff is here, if you're interested: https://github.com/davidgiven/wordgrinder/pull/181/files The new version's not packaged for Debian yet as there are still some upstream fixes to be done. Is there actually a formal spec for the expected interface that polite Makefiles should honour to make cross building possible? And can you point me at the Debian tools you're using to do these checks?
Hi,
Thank you for the quick reply. That looks like quite an improvement.
We have many packages that fail to cross build. Take your time. Please
just close this bug with your next upload as it takes a significant step
in the right direction. I see cross build bugs as patch communication
vehicles and not as requests for you to make things work. So if it still
fails, bug closure will put it to my desk and I'll file another patch.
That way we can iterate easily. Please keep in mind that I deal with
~1000 similar bugs concurrently.
time, we're trying to deduce the most commonly used conventions from
existing practice. There seem to be two major routes:
A) Pass all the tools. The most important/common variables are:
* CC
* CXX
* PKG_CONFIG
* Also CFLAGS/CXXFLAGS and sometimes CPPFLAGS are frequent.
More rarely, you can suffix all of the above with _FOR_BUILD to
compile something for the build architecture (to be able to run it).
B) Use the variable CROSS_COMPILE and prepend it to all the host tools.
For a native build CROSS_COMPILE is empty or unset. An invocation of
CC becomes ${CROSS_COMPILE}${CC} and likewise for every other tool.
dh_auto_build implements the former strategy and it certainly is the
most common one. dh_auto_build does not pass the _FOR_BUILD variants,
but you can use /usr/share/dpkg/buildtools.mk to export them.
Automated checks are performed at http://crossqa.debian.net/. A view of
wordgrinder is available at http://crossqa.debian.net/src/wordgrinder.
If you upload your package, it should automatically be tested within a
week or you can schedule a build yourself.
Hope this helps. In any case, cross porters are here to help. Feel free
to contact debian-cross@lists.debian.org for help at any time.
Helmut