Skip to content

Commit 66612ae

Browse files
authored
Merge pull request #697 from RcppCore/bugfix/pkg-dir-routine-registration
use pkg dir rather that getwd() for native routine registration
2 parents 48b13bc + 76090d3 commit 66612ae

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2017-05-23 JJ Allaire <[email protected]>
2+
3+
* R/Attributes.R: Execute tools::package_native_routine_registration_skeleton
4+
within package rather than current working directory.
5+
* src/attributes.cpp: Execute tools::package_native_routine_registration_skeleton
6+
within package rather than current working directory.
7+
18
2017-05-22 Dirk Eddelbuettel <[email protected]>
29

310
* R/inline.R (Rcpp.plugin.maker): Whitespace changes

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 0.12.11
3+
Version: 0.12.11.1
44
Date: 2017-05-20
55
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,
66
Nathan Russell, Douglas Bates and John Chambers

R/Attributes.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) {
11541154
as.character(token)
11551155
}
11561156

1157-
.extraRoutineRegistrations <- function(routines) {
1157+
.extraRoutineRegistrations <- function(targetFile, routines) {
11581158

11591159
declarations = character()
11601160
call_entries = character()
@@ -1163,11 +1163,14 @@ sourceCppFunction <- function(func, isVoid, dll, symbol) {
11631163
# to automatically discover additional native routines that require registration
11641164
if (getRversion() >= "3.4") {
11651165

1166+
# determine the package directory
1167+
pkgdir <- dirname(dirname(targetFile))
1168+
11661169
# get the generated code from R
11671170
con <- textConnection(object = NULL, open = "w")
11681171
on.exit(close(con), add = TRUE)
11691172
tools::package_native_routine_registration_skeleton(
1170-
dir = ".",
1173+
dir = pkgdir,
11711174
con = con,
11721175
character_only = FALSE
11731176
)

inst/NEWS.Rd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
\newcommand{\ghpr}{\href{https://github.com/RcppCore/Rcpp/pull/#1}{##1}}
44
\newcommand{\ghit}{\href{https://github.com/RcppCore/Rcpp/issues/#1}{##1}}
55

6+
\section{Changes in Rcpp version 0.12.12 (Unreleased)}{
7+
\itemize{
8+
\item Changes in Rcpp Attributes:
9+
\itemize{
10+
\item Execute tools::package_native_routine_registration_skeleton
11+
within package rather than current working directory.
12+
}
13+
}
14+
}
15+
616
\section{Changes in Rcpp version 0.12.11 (2017-05-20)}{
717
\itemize{
818
\item Changes in Rcpp API:

src/attributes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1972,7 +1972,7 @@ namespace attributes {
19721972

19731973
// see if there are additional registrations to perform
19741974
Rcpp::Function extraRoutinesFunc = Environment::namespace_env("Rcpp")[".extraRoutineRegistrations"];
1975-
List extraRoutines = extraRoutinesFunc(routineNames);
1975+
List extraRoutines = extraRoutinesFunc(targetFile(), routineNames);
19761976
std::vector<std::string> declarations = extraRoutines["declarations"];
19771977
std::vector<std::string> callEntries = extraRoutines["call_entries"];
19781978

0 commit comments

Comments
 (0)