[Pkg-erlang-devel] Bug#898744: erlang: needs a native erlc for cross building

Helmut Grohne helmut at subdivi.de
Tue May 15 16:22:56 BST 2018


Source: erlang
Version: 1:20.3.6+dfsg-1
Severity: minor
Tags: patch

I tried cross building erlang and the packaging actually attempts doing
so (instead of doing a native build). The error message is quite
instructive in what goes wrong:

| make[1]: Entering directory '/<<BUILDDIR>>/erlang-20.3.6+dfsg'
| * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
| * ERROR:   No usable Erlang/OTP system for the build machine found! Cannot
| *          cross compile without such a system.
| *
| *          Either build a bootstrap system for the build machine, or provide
| *          an Erlang/OTP-20 system in the $PATH, and try again. For more
| *          information on cross compiling Erlang/OTP-20, see the
| *          $ERL_TOP/xcomp/README file.
| * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
| make[1]: *** [Makefile:343: cross_check_erl] Error 1
| make[1]: Leaving directory '/<<BUILDDIR>>/erlang-20.3.6+dfsg'
| make: *** [debian/rules:330: build-stnd-stamp] Error 2
| dpkg-buildpackage: error: debian/rules build-arch subprocess returned exit status 2

This kindly asks for an erlc. That translates to adding a build
dependency on erlang-base:native to Build-Depends. To avoid a cyclic
dependency the dependency should only be present for cross building,
which is commonly achieved using the <cross> profile.

The attached patch adds that dependency. Unfortunately, the next error
message is less instructive:

| Compiler function yecc:compile/3 failed:
| {undef,[{yecc,compile,
|               ["/<<BUILDDIR>>/erlang-20.3.6+dfsg/lib/stdlib/src/erl_parse",
|                "/<<BUILDDIR>>/erlang-20.3.6+dfsg/lib/stdlib/src/erl_parse",
|                {options,[],
|                         "/<<BUILDDIR>>/erlang-20.3.6+dfsg/lib/stdlib/src/.",
|                         undefined,[],1,false,999,[],[],
|                         "/<<BUILDDIR>>/erlang-20.3.6+dfsg/lib/stdlib/src"}],
|               []},
|         {erl_compile,compile_file,4,[{file,"erl_compile.erl"},{line,304}]},
|         {erl_compile,compile3,3,[{file,"erl_compile.erl"},{line,285}]},
|         {erl_compile,'-compiler_runner/1-fun-1-',1,
|                      [{file,"erl_compile.erl"},{line,92}]}]}
| make[4]: *** [/<<BUILDDIR>>/erlang-20.3.6+dfsg/make/powerpc64le-unknown-linux-gnu/otp.mk:147: erl_parse.erl] Error 1

I have no clue about that one. Adding the dependency would make this
second error more visible on public cross build logs. Please add it and
close this bug when doing so.

Helmut
-------------- next part --------------
diff --minimal -Nru erlang-20.3.6+dfsg/debian/changelog erlang-20.3.6+dfsg/debian/changelog
--- erlang-20.3.6+dfsg/debian/changelog	2018-05-08 12:02:24.000000000 +0200
+++ erlang-20.3.6+dfsg/debian/changelog	2018-05-14 22:40:33.000000000 +0200
@@ -1,3 +1,10 @@
+erlang (1:20.3.6+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add erlang-base:native to Build-Depends when cross building. (Closes: #-1)
+
+ -- Helmut Grohne <helmut at subdivi.de>  Mon, 14 May 2018 22:40:33 +0200
+
 erlang (1:20.3.6+dfsg-1) unstable; urgency=medium
 
   * New upstream bugfix release.
diff --minimal -Nru erlang-20.3.6+dfsg/debian/control erlang-20.3.6+dfsg/debian/control
--- erlang-20.3.6+dfsg/debian/control	2018-05-08 12:02:24.000000000 +0200
+++ erlang-20.3.6+dfsg/debian/control	2018-05-14 22:40:32.000000000 +0200
@@ -8,7 +8,7 @@
  libncurses5-dev, unixodbc-dev, bison, flex, ed,
  libwxgtk3.0-dev, dctrl-tools, xsltproc,
  libgl1-mesa-dev | libgl-dev, libglu1-mesa-dev | libglu-dev,
- libsctp-dev [linux-any], libsystemd-dev [linux-any]
+ libsctp-dev [linux-any], libsystemd-dev [linux-any], erlang-base:native <cross>
 Build-Depends-Indep: libxml2-utils, fop, default-jdk | sun-java6-jdk
 Build-Conflicts: autoconf2.13, libwxgtk2.4-dev, libwxgtk2.6-dev, libwxgtk2.8-dev
 Homepage: http://www.erlang.org/


More information about the Pkg-erlang-devel mailing list