r-lib / cpp11

cpp11 helps you to interact with R objects using C++ code.
https://cpp11.r-lib.org/
Other
199 stars 46 forks source link

Error when calling sourced cpp11 function after multiple `cpp_source` calls #202

Closed sbearrows closed 3 years ago

sbearrows commented 3 years ago
cpp11::cpp_source("xyz.cpp")
> boo()
#> [1] 10
> cpp11::cpp_source("xyz.cpp")
> boo()
#> Error in .Call("_xyz_2_boo", PACKAGE = "xyz_2") : 
  "_xyz_2_boo" not available for .Call() for package "xyz_2"

This is likely due to our changes to the temp file names. We will have to re-evaluate how we are handling temporary file names.

Restarting the R session removes this error.

jimhester commented 3 years ago

Here are the bisect results for where this behavior was introduced.

git bisect start
# bad: [5c6feec8df0f0379702155f4d76be79937d249d9] Tweaks
git bisect bad 5c6feec8df0f0379702155f4d76be79937d249d9
# good: [28bfea537bf860e5ebe1825a38cb5e25ad09a303] Add note to news
git bisect good 28bfea537bf860e5ebe1825a38cb5e25ad09a303
# bad: [18bdd29a5c81e729bb6aecc48e036d76aeb26773] Reformat news for release
git bisect bad 18bdd29a5c81e729bb6aecc48e036d76aeb26773
# bad: [7a7da573a3bbbfc92c3b0ec6857b5cb57a299478] Feature add error message for incorrect decorators (#180)
git bisect bad 7a7da573a3bbbfc92c3b0ec6857b5cb57a299478
# skip: [ad6a19ed994fcdb06beaa49140c0174844eed5fe] adding tests for bug fix
git bisect skip ad6a19ed994fcdb06beaa49140c0174844eed5fe
# bad: [e94239c4a5d88fad1066c3020b9919b5416894fe] removed empty test from test-source
git bisect bad e94239c4a5d88fad1066c3020b9919b5416894fe
# good: [5839e36aee0a0b21d81b3bae31a267b08bf758a4] fine-tuning file name changes
git bisect good 5839e36aee0a0b21d81b3bae31a267b08bf758a4
# bad: [cf7763d14d07fa0d93824e3c21dc32c1f20701b7] cprevent changes to source code filename
git bisect bad cf7763d14d07fa0d93824e3c21dc32c1f20701b7
# only skipped commits left to test
# possible first bad commit: [cf7763d14d07fa0d93824e3c21dc32c1f20701b7] cprevent changes to source code filename
# possible first bad commit: [ad6a19ed994fcdb06beaa49140c0174844eed5fe] adding tests for bug fix