diff --git a/ChangeLog b/ChangeLog index 272a68bd1..4de0b2f5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2026-04-02 Dirk Eddelbuettel + + * DESCRIPTION (Date, Version): Hotfix non-release 1.1.1-1 + + * Rcpp/inst/include/Rcpp/api/meat/Rcpp_eval.h: Changes from PR 1466 + that address the sudden disappearance of R_UnboundValue + * Rcpp/inst/include/Rcpp/Environment.h: Idem, also carried over one + change from PR 1460 + * Rcpp/inst/include/Rcpp/Function.h: Idem, also R_getRegisteredNamespace + * Rcpp/inst/include/Rcpp/Function.h: Idem + 2026-01-08 Dirk Eddelbuettel * DESCRIPTION (Date, Version): Release 1.1.1 @@ -9,7 +20,7 @@ * vignettes/pdf/*: Rebuilt - * vignettes/rmd/Rcpp.bib: Updates to several URLs + * vignettes/rmd/Rcpp.bib: Update to several URLs * inst/bib/Rcpp.bib: Idem * vignettes/rmd/*: Idem * README.md: Idem diff --git a/DESCRIPTION b/DESCRIPTION index 17503c2c2..3b6f1bc8b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: Rcpp Title: Seamless R and C++ Integration -Version: 1.1.1 -Date: 2026-01-07 +Version: 1.1.1-1 +Date: 2026-04-02 Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "edd@debian.org", comment = c(ORCID = "0000-0001-6419-907X")), person("Romain", "Francois", role = "aut", @@ -33,6 +33,19 @@ Suggests: tinytest, inline, rbenchmark, pkgKitten (>= 0.1.2) URL: https://www.rcpp.org, https://dirk.eddelbuettel.com/code/rcpp.html, https://github.com/RcppCore/Rcpp License: GPL (>= 2) BugReports: https://github.com/RcppCore/Rcpp/issues +MailingList: rcpp-devel@lists.r-forge.r-project.org RoxygenNote: 6.1.1 Encoding: UTF-8 VignetteBuilder: Rcpp +NeedsCompilation: yes +Packaged: 2026-04-02 12:55:00 UTC; edd +Author: Dirk Eddelbuettel [aut, cre] (ORCID: ), + Romain Francois [aut] (ORCID: ), + JJ Allaire [aut] (ORCID: ), + Kevin Ushey [aut] (ORCID: ), + Qiang Kou [aut] (ORCID: ), + Nathan Russell [aut], + IƱaki Ucar [aut] (ORCID: ), + Doug Bates [aut] (ORCID: ), + John Chambers [aut] +Maintainer: Dirk Eddelbuettel diff --git a/README.md b/README.md index bb42b2f21..2ffadf41f 100644 --- a/README.md +++ b/README.md @@ -166,9 +166,11 @@ we cannot test on outdated versions of R or your OS. ### Support -The best place for questions is the [discussion section of the GitHub -repo](https://github.com/RcppCore/Rcpp/discussions) as the previously used mailing list at R-forge -is no longer operational. +The best place for questions is the +[Rcpp-devel](https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel) +mailing list hosted at R-forge. Note that in order to keep spam down, you must +be a subscriber in order to post. One can also consult the list archives to see +if your question has been asked before. The [issue tickets at the GitHub repo](https://github.com/RcppCore/Rcpp/issues) are the primary bug reporting interface. As with the other web resources, diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index f77d7d30b..79ed687cc 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -3,6 +3,15 @@ \newcommand{\ghpr}{\href{https://github.com/RcppCore/Rcpp/pull/#1}{##1}} \newcommand{\ghit}{\href{https://github.com/RcppCore/Rcpp/issues/#1}{##1}} +\section{Changes in Rcpp non-release version 1.1.1-1 (2026-04-02)}{ + \itemize{ + \item Please see pr \ghpr{1466} addressing \ghit{1465} for context (plus + change from \ghpr{1460} closing \ghit{1459}, and R_getRegisteredNamespace) + \item This is an unplanned, unscheduled and uncalled for non-release + made solely to unplug CRAN from late-breaking changes in R 4.6.0 + } +} + \section{Changes in Rcpp release version 1.1.1 (2026-01-08)}{ \itemize{ \item Changes in Rcpp API: diff --git a/inst/include/Rcpp/Environment.h b/inst/include/Rcpp/Environment.h index bc89a702f..97c7b3090 100644 --- a/inst/include/Rcpp/Environment.h +++ b/inst/include/Rcpp/Environment.h @@ -95,20 +95,8 @@ namespace Rcpp{ * @return a SEXP (possibly R_NilValue) */ SEXP get(const std::string& name) const { - SEXP env = Storage::get__() ; - SEXP nameSym = Rf_install(name.c_str()); -#if R_VERSION < R_Version(4,5,0) - SEXP res = Rf_findVarInFrame( env, nameSym ) ; -#else - SEXP res = R_getVarEx(nameSym, env, FALSE, R_UnboundValue); -#endif - if( res == R_UnboundValue ) return R_NilValue ; - - /* We need to evaluate if it is a promise */ - if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; // #nocov - } - return res ; + Symbol nameSym = Rf_install(name.c_str()); + return get(nameSym); } /** @@ -122,16 +110,12 @@ namespace Rcpp{ SEXP env = Storage::get__() ; #if R_VERSION < R_Version(4,5,0) SEXP res = Rf_findVarInFrame( env, name ) ; + if (res == R_UnboundValue) return R_NilValue; + if (TYPEOF(res) == PROMSXP) + res = internal::Rcpp_eval_impl(res, env); #else - SEXP res = R_getVarEx(name, env, FALSE, R_UnboundValue); + SEXP res = R_getVarEx(name, env, FALSE, R_NilValue); #endif - - if( res == R_UnboundValue ) return R_NilValue ; - - /* We need to evaluate if it is a promise */ - if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; - } return res ; } @@ -144,21 +128,8 @@ namespace Rcpp{ * */ SEXP find( const std::string& name) const{ - SEXP env = Storage::get__() ; - SEXP nameSym = Rf_install(name.c_str()); -#if R_VERSION < R_Version(4,5,0) - SEXP res = Rf_findVar( nameSym, env ) ; -#else - SEXP res = R_getVarEx(nameSym, env, TRUE, R_UnboundValue); -#endif - - if( res == R_UnboundValue ) throw binding_not_found(name) ; - - /* We need to evaluate if it is a promise */ - if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; - } - return res ; + Symbol nameSym = Rf_install(name.c_str()); + return find(nameSym); } /** @@ -171,19 +142,13 @@ namespace Rcpp{ SEXP env = Storage::get__() ; #if R_VERSION < R_Version(4,5,0) SEXP res = Rf_findVar( name, env ) ; + if (res == R_UnboundValue) throw binding_not_found(name.c_str()); + if (TYPEOF(res) == PROMSXP) + res = internal::Rcpp_eval_impl(res, env); #else - SEXP res = R_getVarEx(name, env, TRUE, R_UnboundValue); + SEXP res = R_getVarEx(name, env, TRUE, NULL); + if (res == NULL) throw binding_not_found(name.c_str()); #endif - if( res == R_UnboundValue ) { - // Pass on the const char* to the RCPP_EXCEPTION_CLASS's - // const std::string& requirement - throw binding_not_found(name.c_str()) ; - } - - /* We need to evaluate if it is a promise */ - if( TYPEOF(res) == PROMSXP){ - res = internal::Rcpp_eval_impl( res, env ) ; - } return res ; } @@ -199,10 +164,11 @@ namespace Rcpp{ SEXP nameSym = Rf_install(name.c_str()); #if R_VERSION < R_Version(4,5,0) SEXP res = Rf_findVarInFrame( Storage::get__() , nameSym ) ; + return res != R_UnboundValue; #else - SEXP res = R_getVarEx(nameSym, Storage::get__(), FALSE, R_UnboundValue); + SEXP res = R_getVarEx(nameSym, Storage::get__(), FALSE, NULL); + return res != NULL; #endif - return res != R_UnboundValue ; } /** @@ -389,7 +355,11 @@ namespace Rcpp{ * The parent environment of this environment */ Environment_Impl parent() const { +#if R_VERSION < R_Version(4,5,0) return Environment_Impl( ENCLOS(Storage::get__()) ) ; +#else + return Environment_Impl(R_ParentEnv(Storage::get__())); +#endif } /** diff --git a/inst/include/Rcpp/Function.h b/inst/include/Rcpp/Function.h index 783318b39..c7f65fc87 100644 --- a/inst/include/Rcpp/Function.h +++ b/inst/include/Rcpp/Function.h @@ -69,14 +69,15 @@ namespace Rcpp{ } Function_Impl(const std::string& name, const std::string& ns) { -#if R_VERSION < R_Version(4,5,0) +#if R_VERSION < R_Version(4,6,0) Shield env(Rf_findVarInFrame(R_NamespaceRegistry, Rf_install(ns.c_str()))); + if (env == R_UnboundValue) + stop("there is no namespace called \"%s\"", ns); #else - Shield env(R_getVarEx(Rf_install(ns.c_str()), R_NamespaceRegistry, FALSE, R_UnboundValue)); -#endif - if (env == R_UnboundValue) { + Shield env(R_getRegisteredNamespace(ns.c_str())); + if (env == R_NilValue) stop("there is no namespace called \"%s\"", ns); - } +#endif get_function(name, env); } diff --git a/inst/include/Rcpp/Promise.h b/inst/include/Rcpp/Promise.h index 8b4096a01..9afa253de 100644 --- a/inst/include/Rcpp/Promise.h +++ b/inst/include/Rcpp/Promise.h @@ -48,13 +48,18 @@ namespace Rcpp{ * Return the result of the PRVALUE macro on the promise */ SEXP value() const{ - SEXP val = PRVALUE( Storage::get__() ) ; - if( val == R_UnboundValue ) throw unevaluated_promise() ; - return val ; + if (!was_evaluated()) throw unevaluated_promise(); + return PRVALUE(Storage::get__()); } bool was_evaluated() const { +#if R_VERSION < R_Version(4,6,0) return PRVALUE(Storage::get__()) != R_UnboundValue ; +#else + SEXP env = environment(); + R_BindingType_t bt = R_GetBindingType(Storage::get__(), env); + return bt != R_BindingTypeUnbound; +#endif } /** diff --git a/inst/include/Rcpp/api/meat/Rcpp_eval.h b/inst/include/Rcpp/api/meat/Rcpp_eval.h index 340d2ac7a..e2fcab35e 100644 --- a/inst/include/Rcpp/api/meat/Rcpp_eval.h +++ b/inst/include/Rcpp/api/meat/Rcpp_eval.h @@ -56,10 +56,6 @@ inline SEXP Rcpp_eval(SEXP expr, SEXP env) { // 'identity' function used to capture errors, interrupts Shield identity(Rf_findFun(::Rf_install("identity"), R_BaseNamespace)); - if (identity == R_UnboundValue) { - stop("Failed to find 'base::identity()'"); - } - // define the evalq call -- the actual R evaluation we want to execute Shield evalqCall(Rf_lang3(::Rf_install("evalq"), expr, env)); diff --git a/inst/include/Rcpp/config.h b/inst/include/Rcpp/config.h index 18562d34c..448f09e44 100644 --- a/inst/include/Rcpp/config.h +++ b/inst/include/Rcpp/config.h @@ -31,7 +31,7 @@ #define RCPP_VERSION_STRING "1.1.1" // the current source snapshot (using four components, if a fifth is used in DESCRIPTION we ignore it) -#define RCPP_DEV_VERSION RcppDevVersion(1,1,1,0) -#define RCPP_DEV_VERSION_STRING "1.1.1.0" +#define RCPP_DEV_VERSION RcppDevVersion(1,1,1,1) +#define RCPP_DEV_VERSION_STRING "1.1.1-1" #endif diff --git a/src/Makevars.win b/src/Makevars.win index c020bce78..f75dd3aff 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,2 +1,2 @@ -PKG_CPPFLAGS = -I../inst/include/ - +PKG_CPPFLAGS = -I../inst/include/ + diff --git a/tests/tinytest.R b/tests/tinytest.R index 61cc2b8a7..676dc496f 100644 --- a/tests/tinytest.R +++ b/tests/tinytest.R @@ -14,7 +14,8 @@ if (requireNamespace("tinytest", quietly=TRUE)) { ## Force tests to be executed if in dev release which we define as ## having a sub-release, eg 0.9.15.5 is one whereas 0.9.16 is not - if (length(strsplit(format(packageVersion("Rcpp")), "\\.")[[1]]) > 3) { # dev rel, and + if (length(strsplit(format(packageVersion("Rcpp")), "\\.")[[1]]) > 3 && # dev rel, and + isFALSE(grepl("-", packageDescription("Rcpp", field="Version")))) { # not hotfix if (Sys.getenv("RunAllRcppTests") != "no") { # if env.var not yet set message("Setting \"RunAllRcppTests\"=\"yes\" for development release") Sys.setenv("RunAllRcppTests"="yes") diff --git a/vignettes/Rcpp-introduction.pdf b/vignettes/Rcpp-introduction.pdf index 268930ea9..b4e927abc 100644 Binary files a/vignettes/Rcpp-introduction.pdf and b/vignettes/Rcpp-introduction.pdf differ