Closed csbrown closed 11 months ago
Current workaround is to not use "." in your package name.
Assigning to @perrydv
@csbrown thanks for the report and careful reprex. Sorry for the delay in dealing with this. It will be fixed in next release (1.1.0) in the next few weeks.
Fixing this now on branch fix_1332
. The issue is that the mangling we do in Rname2CppName
for "." needs to be also done when we set up names for RCfunctions and nimbleFunctions, i.e., via labelFunctionMetaCreator
. In looking at the transformations in Rname2CppName
, I don't think any of the rest of the syntax is allowed in R package names.
Issue Type:
Bug
Description:
When Nimble transpiles R code into C++ code, sometimes it does not correctly translate "." into "_dot_" when packages contain "." in the package name.
Minimal Reproducible Example:
1) Create a new package using
devtools
with a "." in the name, such asdevtools::create("my.example")
2) Put the above code into an R file in the R directory 3)devtools::document()
4) Ensure that theNAMESPACE
exports bothexample
andexample1
5) Ensure that theDESCRIPTION
depends on nimble:Depends: nimble
6)devtools::install()
the package 7) Restart R, andlibrary("my.example")
to import this code. 8) Try to compile the nimbleFunctions from your librarycompileNimble(example1)
This succeedscompileNimble(example)
This fails 9) Inspecting the C++ code generated by the failed compilation step reveals a "." in a name somewhere where there should be, I think, a "_dot_". SeeprintErrors()
and output the C++ code withdirName
to see this.Expected Behavior:
The transpilation step should correctly find the "." in the package name and translate it to "_dot_" so that the package will successfully compile.