ropensci / xslt

Extension of xml2 package for xsl transformations
https://docs.ropensci.org/xslt
27 stars 1 forks source link

Error installing `xslt` #13

Closed ns-rse closed 3 months ago

ns-rse commented 4 months ago

Hit the following error whilst trying to install xslt under an renv...

- Installing xslt ...                           FAILED
Error: Error installing package 'xslt':
================================

* installing *source* package ‘xslt’ ...
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/libxml2
Using PKG_LIBS=-lexslt -lxslt -lxml2
** libs
using C++ compiler: ‘g++ (GCC) 13.2.1 20230801’
rm -f RcppExports.o xslt.o xslt_init.o xslt.so
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I/usr/include/libxml2 -DSTRICT_R_HEADERS -I'/home/neil/work/git/hub/ns-rse/git-collaboration/renv/staging/1/Rcpp/include' -I'/home/neil/work/git/hub/ns-rse/git-collaboration/renv/staging/1/xml2/include' -I/usr/local/include    -fpic  -O3 -Wall -pedantic -march=native -mtune=native -pipe -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I/usr/include/libxml2 -DSTRICT_R_HEADERS -I'/home/neil/work/git/hub/ns-rse/git-collaboration/renv/staging/1/Rcpp/include' -I'/home/neil/work/git/hub/ns-rse/git-collaboration/renv/staging/1/xml2/include' -I/usr/local/include    -fpic  -O3 -Wall -pedantic -march=native -mtune=native -pipe -c xslt.cpp -o xslt.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I/usr/include/libxml2 -DSTRICT_R_HEADERS -I'/home/neil/work/git/hub/ns-rse/git-collaboration/renv/staging/1/Rcpp/include' -I'/home/neil/work/git/hub/ns-rse/git-collaboration/renv/staging/1/xml2/include' -I/usr/local/include    -fpic  -O3 -Wall -pedantic -march=native -mtune=native -pipe -c xslt_init.cpp -o xslt_init.o
xslt_init.cpp: In function ‘void R_init_xslt(DllInfo*)’:
xslt_init.cpp:36:37: error: invalid conversion from ‘void (*)(void*, xmlError*)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive]
   36 |     xmlSetStructuredErrorFunc(NULL, handleError);
      |                                     ^~~~~~~~~~~
      |                                     |
      |                                     void (*)(void*, xmlError*) {aka void (*)(void*, _xmlError*)}
In file included from xslt_init.cpp:4:
/usr/include/libxml2/libxml/xmlerror.h:898:57: note:   initializing argument 2 of ‘void xmlSetStructuredErrorFunc(void*, xmlStructuredErrorFunc)’
  898 |                                  xmlStructuredErrorFunc handler);
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
make: *** [/usr/lib64/R/etc/Makeconf:200: xslt_init.o] Error 1
ERROR: compilation failed for package ‘xslt’
* removing ‘/home/ns-rse/work/git/hub/ns-rse/git-collaboration/renv/staging/1/xslt’
install of package 'xslt' failed [error code 1]
Traceback (most recent calls last):
12: renv::install("sandpaper")
11: renv_install_impl(records)
10: renv_install_staged(records)
 9: renv_install_default(records)
 8: handler(package, renv_install_package(record))
 7: renv_install_package(record)
 6: withCallingHandlers(renv_install_package_impl(record), error = function(e) writef("FAILED"))
 5: renv_install_package_impl(record)
 4: r_cmd_install(package, path)
 3: r_exec_error(package, output, "install", status)
 2: abort(all)
 1: stop(fallback)

EDIT : This happens at the system level as well as when installing under a renv with both R-4.3.2 and R-4.3.3.

lgatto commented 3 months ago

Same error under

platform       x86_64-pc-linux-gnu         
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          4                           
minor          4.0                         
year           2024                        
month          04                          
day            24                          
svn rev        86474                       
language       R                           
version.string R version 4.4.0 (2024-04-24)
nickname       Puppy Cup                   
rsbivand commented 3 months ago

And here:

* installing *source* package 'xslt' ...
** package 'xslt' successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/libxml2 -DWITH_GZFILEOP
Using PKG_LIBS=-lexslt -lxslt -lxml2
** libs
using C++ compiler: 'g++ (GCC) 14.0.1 20240411 (Red Hat 14.0.1-0)'

g++ -std=gnu++17 -I"/home/rsb/topics/R/R440-share/lib64/R/include" -DNDEBUG -I/usr/include/libxml2 -DWITH_GZFILEOP -DSTRICT_R_HEADERS -I'/home/rsb/lib/r_libs/Rcpp/include' -I'/home/rsb/lib/r_libs/xml2/include' -I/usr/local/include    -fpic  -g -O2   -c xslt_init.cpp -o xslt_init.o
xslt_init.cpp: In function ‘void R_init_xslt(DllInfo*)’:
xslt_init.cpp:36:37: error: invalid conversion from ‘void (*)(void*, xmlError*)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive]
   36 |     xmlSetStructuredErrorFunc(NULL, handleError);
      |                                     ^~~~~~~~~~~
      |                                     |
      |                                     void (*)(void*, xmlError*) {aka void (*)(void*, _xmlError*)}
In file included from xslt_init.cpp:4:
/usr/include/libxml2/libxml/xmlerror.h:898:57: note:   initializing argument 2 of ‘void xmlSetStructuredErrorFunc(void*, xmlStructuredErrorFunc)’
  898 |                                  xmlStructuredErrorFunc handler);
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
make: *** [/home/rsb/topics/R/R440-share/lib64/R/etc/Makeconf:204: xslt_init.o] 
rsbivand commented 3 months ago

@jeroen thanks! CMD check OK: 00install - 00install.zip and 00check.log, Fedora 40, R 4.4.0: 00check.log

jeroen commented 3 months ago

Thanks for the reminder, submitted to cran now.