[R-pkg-devel] [SPAM | WERBUNG] Re: CRAN Submission xgboost 1.7.11.1

2025-05-10 Thread jiaming yuan
Thank you for sharing, Ivan! This is really helpful.

From: Ivan Krylov 
Sent: Saturday, May 10, 2025 5:41:51 AM
To: jiaming yuan 
Cc: r-package-devel@r-project.org 
Subject: Re: [R-pkg-devel] CRAN Submission xgboost 1.7.11.1

� Fri, 9 May 2025 04:22:52 +
jiaming yuan  �:

> We are trying to resolve the test failures of XGBoost but so far no
> one has managed to reproduce them locally.
> https://github.com/dmlc/xgboost/issues/11431

One test failure really stands out:

>   Error ('test_feature_weights.R:17:5'): training with feature
> weights works
>   Error in `setinfo.xgb.DMatrix(dmat, names(p), p[[1]])`:
> cannot get data pointer of 'double' objects

This is particularly strange because the internal CHKVEC() function is
supposed to check for REALSXP vectors and pass them through. Such
"impossible" errors could be signs of a protection error. (Well, any
memory corruption, but arbitrary memory corruption is harder to
diagnose, so let's hope it's something to do with the garbage
collector.) Let's run the test suite check using a build of R-devel
compiled with .../configure --enable-strict-barrier.


testthat::test_check("xgboost")
# <...>
# Fatal error: Wrong thread calling 'RunFinalizers'
# Fatal error: Wrong thread calling 'RunFinalizers'
# Fatal error: Wrong thread calling 'RunFinalizers'
# Fatal error: Wrong thread calling 'RunFinalizers'
# Fatal error: Wrong thread calling 'RunFinalizers'
# Segmentation fault

Hmm.

Setting a breakpoint in Rstd_Suicide reveals the mistake. It's not a
protection error; it's R API being called from an OpenMP thread:

#5  ALTVEC_DATAPTR (x=0x2d825f58) at ../../../R/src/main/altrep.c:376
#6  0x7fbbd1e5ed98 in operator() (__closure=,
i=) at xgboost_R.cc:258
#7  dmlc::OMPException::Run, int> (this=0x7fffbfaef760, f=...)
at ./dmlc-core/include/dmlc/common.h:67
#8  
_ZN7xgboost6common11ParallelForIiZ18XGDMatrixSetInfo_REUlmE0_EEvT_iNS0_5SchedET0_._omp_fn.3(void)
 ()
at ./dmlc-core/include/../../src/common/threading_utils.h:208
#9  0x7fbbd4552a0e in gomp_thread_start (xdata=)
at ../../../libgomp/team.c:129
(gdb) frame 5
#5  ALTVEC_DATAPTR (x=0x2d825f58) at ../../../R/src/main/altrep.c:376
376 return ALTVEC_DATAPTR_EX(x, TRUE);
(gdb) call R_inspect(x)
@2d825f58 14 REALSXP g0c0 [REF(65535)]  1 : 9 (expanded)

The code would be better served by calling REAL_RO / INTEGER_RO once
and then using the returned pointer inside the OpenMP threads.

--
Best regards,
Ivan

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] CMake not on the PATH on CRAN macOS build/check servers?

2025-05-10 Thread Tyler
I recently submitted the package `libdeflate`, which successfully made
its way to the CRAN
(https://cran.r-project.org/web/packages/libdeflate/index.html) but
has failed to install on macOS:

https://cran.r-project.org/web/checks/check_results_libdeflate.html

Specifically, installation requires CMake, which is checked for during
the configure step with Sys.which("cmake"). This returns "" on macOS,
indicating it was not found. Note that cmake is indeed listed as a
SystemRequirement in the DESCRIPTION.

https://www.r-project.org/nosvn/R.check/r-release-macos-arm64/libdeflate-00install.html

* installing *source* package ‘libdeflate’ ...
** this is package ‘libdeflate’ version ‘1.23.0’
** package ‘libdeflate’ successfully unpacked and MD5 sums checked
** using staged installation
** preparing to configure package 'libdeflate' ...
sh: : command not found
Error in eval(parse(text = contents), envir = envir) :
  CMake configure step failed
Calls: source_file -> eval -> eval
In addition: Warning messages:
1: In normalizePath(Sys.which("cmake"), winslash = "/") :
  path[1]="": No such file or directory
2: In system2(CMAKE, cmake_cfg) : error in running command
Execution halted
ERROR: configuration failed for package ‘libdeflate’

I see that WRE also recommends checking
"/Applications/CMake.app/Contents/bin/cmake" on macOS. Before
submitting an update, though, it would be nice if someone could
confirm where cmake is located on the CRAN macOS environment so I can
be sure the fix will be successful.

Tyler

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] CMake not on the PATH on CRAN macOS build/check servers?

2025-05-10 Thread Dirk Eddelbuettel


On 10 May 2025 at 12:34, Tyler wrote:
| I recently submitted the package `libdeflate`, which successfully made
| its way to the CRAN
| (https://cran.r-project.org/web/packages/libdeflate/index.html) but
| has failed to install on macOS:
[...]
| I see that WRE also recommends checking
| "/Applications/CMake.app/Contents/bin/cmake" on macOS. Before
| submitting an update, though, it would be nice if someone could
| confirm where cmake is located on the CRAN macOS environment so I can
| be sure the fix will be successful.

It's a common issue, it's documented, and a pothole I also fell into not that
long ago. So here is a very simple script `configure` I use to check, and
then adjust src/Makevars, in package crc32c (which wraps a small external
library of the same name). You will note it credits Reed from an earlier
discussion on this very list.

-
#!/bin/sh

## With thanks to Reed A. Cartwright on r-package-devel on 2023-05-10
## Also end of Writing R Extensions, Section 1.2.6 'Using `cmake`'

if test -z "$CMAKE"; then
   # Look for a cmake binary in the current path
   CMAKE=`which cmake 2>/dev/null`
fi
if test -z "$CMAKE"; then
   # Check for a MacOS specific path
   CMAKE=`which /Applications/CMake.app/Contents/bin/cmake 2>/dev/null`
fi
if test -f "$CMAKE"; then
   echo "** cmake is ${CMAKE}"
else   
   echo "The 'cmake' program is required but not found."
   exit 1
fi   

sed -e "s|@cmake@|${CMAKE}|" src/Makevars.in > src/Makevars
-


By the way, a hidden gem of documentation is the ability to search all
current CRAN packages with the mirror at https://github.com/cran/

Cheers, Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] Failed test automatic checks CRAN

2025-05-10 Thread Lorenzo Sostero
Dear experts,

In the automatic checks performed by CRAN, I obtain the following error:



package EmiR_1.0.5.tar.gz does not pass the incoming checks automatically,
please see the following pre-tests (additional issue checks):
Windows: <
https://win-builder.r-project.org/incoming_pretest/EmiR_1.0.5_20250507_204028/Windows/00check.log
>
Status: 1 ERROR, 2 NOTEs
Debian: <
https://win-builder.r-project.org/incoming_pretest/EmiR_1.0.5_20250507_204028/Debian/00check.log
>
Status: 1 ERROR, 2 NOTEs

Last released version's CRAN status: NOTE: 13
See: 
>

CRAN Web: 

More details are given in the directory:
<
https://win-builder.r-project.org/incoming_pretest/EmiR_1.0.5_20250507_204028/
>

Flavor: r-devel-windows-x86_64
Check: tests, Result: ERROR
Running 'testthat.R'
  Running the tests in 'tests/testthat.R' failed.
  Complete output:
> library(testthat)
> library(EmiR)
> test_check("EmiR")
0%   10   20   30   40   50   60   70   80   90   100%
[||||||||||


Flavor: r-devel-linux-x86_64-debian-gcc
Check: tests, Result: ERROR
Running 'testthat.R' [1s/1s]
  Running the tests in 'tests/testthat.R' failed.
  Complete output:
> library(testthat)
> library(EmiR)
> test_check("EmiR")
0%   10   20   30   40   50   60   70   80   90   100%
[||||||||||
[ FAIL 2 | WARN 1 | SKIP 0 | PASS 96 ]

══ Failed tests

── Failure:
───
C stack usage  316451980572 is too close to the limit
── Error ('test-cpp.R:1:1'): (code run outside of `test_that()`)
───
Error in `path_to_connection(x)`: '' does not exist in current working
directory
('/srv/hornik/tmp/CRAN_pretest/EmiR.Rcheck/tests/testthat').
Backtrace:
▆
 1. └─testthat::run_cpp_tests("EmiR") at test-cpp.R:1:1
 2.   ├─xml2::read_xml(paste(output, collapse = "\n"))
 3.   └─xml2:::read_xml.character(paste(output, collapse = "\n"))
 4. └─xml2:::path_to_connection(x)
 5.   └─xml2:::check_path(path)
 6. └─cli::cli_abort(msg, call = call)
 7.   └─rlang::abort(...)

[ FAIL 2 | WARN 1 | SKIP 0 | PASS 96 ]
Error: Test failures
Execution halted
Segmentation fault



I cannot reproduce the same error by testing the package on a Windows and
macOS machine. Any suggestions on how to fix the error?

Best regards, Lorenzo.

-- 




Informativa sulla Privacy: https://www.unibs.it/it/node/1452 


[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel