krlmlr / r-appveyor

Tools for using R with AppVeyor (https://appveyor.com)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

XML installation from source causes build check to fail

mjsteinbaugh opened this issue · comments

The latest XML update on CRAN (3.98-1.17) is currently source only and causes the AppVeyor build check to fail:

* installing *source* package 'XML' ...
** package 'XML' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
C:/Rtools/mingw_32/bin/gcc  -I"c:/R/include" -DNDEBUG -I/include/libxml2 -I/include -D_R_=1 -DUSE_R=1 -DUSE_XML_VERSION_H=1 -DLIBXML -DUSE_EXTERNAL_SUBSET=1 -DROOT_HAS_DTD_NODE=1 -DUMP_WITH_ENCODING=1 -DXML_ELEMENT_ETYPE=1  -DXML_ATTRIBUTE_ATYPE=1 -DLIBXML2=1 -DHAVE_XML_HAS_FEATURE -DLIBXML_STATIC         -O3 -Wall  -std=gnu99 -mtune=generic -c DocParse.c -o DocParse.o
In file included from DocParse.c:10:0:
DocParse.h:18:27: fatal error: libxml/parser.h: No such file or directory
 #include <libxml/parser.h>
                           ^
compilation terminated.
make: *** [c:/R/etc/i386/Makeconf:208: DocParse.o] Error 1
ERROR: compilation failed for package 'XML'
* removing 'c:/RLibrary/XML'
In R CMD INSTALL
Error in i.p(...) : 
  (converted from warning) installation of package 'XML' had non-zero exit status
Calls: install_deps ... with_rprofile_user -> with_envvar -> force -> force -> i.p
Execution halted

Is there a way to force AppVeyor to only use binary packages? That's really what I want to check against on Windows.

Binary version of latest XML package is now available.
https://cran.rstudio.com/bin/windows/contrib/3.5/XML_3.98-1.17.zip

Just to follow up on this, how is it possible to build XML from source using r-appveyor/ windows more generally?

I understand that it fails because we are missing the libxml headers and have found references to external software that can be downloaded here and here (different versions?) and seems to be available on the win builder machines via make variables.

Unfortunately I'm really struggling to find any comprehensive up to date guidance on after installing rtools how you get all these headers recognised by R. Note: I have zero C++ knowledge so it may be a simple answer.

Found the solution to this is that you download the local323.zip, extract to a folder then edit both makeconf files in program files/R/r version/etc/x64 and i386 with the following lines added:

LOCAL_SOFT = c:/extsoft
LIB_XML = c:/extsoft

where for me c:/extsoft was where I extracted the zip. XML then builds no problem from source.

Generally speaking I've not seen much reference to local323 in conjunction with rtools. Most issues end with a suggestion to just install the binary which isn't ideal for certain workflows.

Thanks. It should be possible to force an install from binary by setting the PKGTYPE env variable to win.binary in appveyor.yml, see also #133 .

Can confirm that using PKGTYPE method described above fixes this issue.