On 10 April 2026 at 16:51, Kurt Hornik wrote:
| >>>>> Dirk Eddelbuettel writes:
| 
| > Hi Helmut,
| 
| > I will CC Kurt Hornik from the upstream team for R, he is the principal
| > author of the extensive autoconf etc pieces for R.
| 
| > On 30 March 2026 at 18:27, Helmut Grohne wrote:
| > | Source: r-base
| > | Version: 4.5.3-1
| > | Tags: patch
| > | User: [email protected]
| > | Usertags: cross-satisfiability ftcbfs
| > | 
| > | r-base fails to cross build from source for a pile of reasons.
| > | 
| > | Initially, its Build-Depends cannot be satisfied. This is due to "gcc",
| > | "g++" and "gfortran". For supporting cross compilation, toolchain
| > | dependencies need to be translated and declare what architecture they
| > | are being used for. In case of gcc and g++, both the build and host
| > | architecture toolchain is implied in build-essential. The version
| > | constraint is satisfied in oldoldstable. I suggest dropping them.
| 
| > Yes. I recall us having email about this before but for some reason it 
stuck.
| 
| > R is in pre-release for R 4.6.0 so I can easily try a few builds (up until
| > the release on April 24).
| 
| > | gfortran is used to compile Fortran code for the host architecture.
| > | Hence, it should be suffixed -for-host. Once doing so, you may no longer
| > | assume presence of unprefixed tools such as "gfortran". Instead,
| > | ${DEB_HOST_GNU_TYPE}-gfortran must be used. This leads to the second
| > | problem.
| > | 
| > | Use of bare tools. debian/rules uses bare tool names such as gcc, g++
| > | and gfortran in several places. Those compile for the build
| 
| > It's an old file, and some/most of the shenanigans were/are needed ...
| 
| > | architecture, but the package is supposed to be built for the host
| > | architecture. Those tools all need to be prefixed with a host
| > | architecture triplet. Fortunately, dpkg has a buildtools.mk file that
| > | can be included to supply all those tools.
| > | 
| > | In the attached patch, I opt for replacing the variable names for tools
| > | with those used by buildtools.mk. For instance, compiler becomes CC and
| > | cxxcompiler becomes CXX. This also happens to match what the upstream
| > | build system expects.
| 
| > I appreciate this and will fold it in.
|  
| > | Last but not least, for cross building an autotools project one needs to
| > | pass --build and --host to configure. Since the package does not use
| > | dh_auto_configure, this must be done explicitly.
| > | 
| > | You can find all of the necessary changes in the attached patch. Once
| > | applying it, r-base will not cross build. The upstream build system uses
| > | a pile of AC_RUN_IFELSE checks and any of them makes a cross build fail.
| 
| > Kurt, this is your corner.
| 
| Thanks.  Not much I can do about this: R-admin has forever said
| 
|   The @file{configure} script has other generic options added by
|   @command{autoconf} and which are not supported for @R{}: in particular
|   building for one architecture on a different host is not possible.
| 
| Is there a case for cross-building?

It is my understanding that some Debian architectures use it but Helmut will
know more and may chime in.

I also lost track of what happens with Windows and R but at some point didn't
some of the MSys replacement / update work involve building under Linux with
gcc cross compilers?

Either way, this should be addressable as Debian surely hits other upstream
sources using autoconf so I have some hope that between all of us we may just
be missing a small step to facilitate this.

Dirk
 
| -k
| 
| > | most of them are cached, so a cross builder may supply a result via the
| > | environment. Going from there to a full cross build is another piece,
| > | but the attached patch at least makes Build-Depends satisfiable and
| > | proceeds to the configure step.
| 
| > Following April 24, R gets into a new annual cycle. With your assistance,
| > maybe upstream (and the Debian package) can (finally) to cross-build and
| > repeated builds.
| 
| > Dirk
|  
| > | Helmut
| > | x[DELETED ATTACHMENT r-base_4.5.3-1.1.debdiff, plain text]
| 
| > -- 
| > dirk.eddelbuettel.com | @eddelbuettel | [email protected]

-- 
dirk.eddelbuettel.com | @eddelbuettel | [email protected]

Sponsor me for Tour de Shore 2026! Donate at
   https://www.pledgereg.com/536435 
More about the ride at
   https://dirk.eddelbuettel.com/blog/2026/04/03#sponsor_tour_de_shore_2026

Reply via email to