Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/win debug dll (closes #1035) #1037

Merged
merged 5 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
2019-12-17 Dirk Eddelbuettel <edd@debian.org>

* R/Attributes.R (sourceCpp): Very minor cosmetic changes

2019-12-15 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION (Version, Date): Roll minor version
* inst/include/Rcpp/config.h: Idem

2019-12-14 Dirk Eddelbuettel <edd@debian.org>

* R/Attributes.R (sourceCpp): Support new argument windowsDebugDLL to
create a debug DLL, supported on Windows only
* man/sourceCpp.Rd: Document it

* src/date.cpp: A few more #nocov tage

2019-12-13 Dirk Eddelbuettel <edd@debian.org>
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: Rcpp
Title: Seamless R and C++ Integration
Version: 1.0.3.4
Date: 2019-12-07
Version: 1.0.3.5
Date: 2019-12-14
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,
Nathan Russell, Douglas Bates and John Chambers
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Expand Down
13 changes: 10 additions & 3 deletions R/Attributes.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Copyright (C) 2012 - 2018 JJ Allaire, Dirk Eddelbuettel and Romain Francois
# Copyright (C) 2012 - 2019 JJ Allaire, Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
Expand Down Expand Up @@ -27,7 +27,8 @@ sourceCpp <- function(file = "",
cleanupCacheDir = FALSE,
showOutput = verbose,
verbose = getOption("verbose"),
dryRun = FALSE) {
dryRun = FALSE,
windowsDebugDLL = FALSE) {

# use an architecture/version specific subdirectory of the cacheDir
# (since cached dynlibs can now perist across sessions we need to be
Expand Down Expand Up @@ -62,7 +63,12 @@ sourceCpp <- function(file = "",
if (grepl(' ', basename(file), fixed=TRUE)) {
stop("The filename '", basename(file), "' contains spaces. This ",
"is not permitted.")
} # #nocov end
}
} else {
if (verbose && windowsDebugDLL) {
message("The 'windowsDebugDLL' toggle is ignored on non-Windows platforms.")
windowsDebugDLL <- FALSE # now we do not need to deal with OS choice below
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be outside the if()? As it stands now, this will only trigger if verbose = TRUE is passed (it normally isn't.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. I think you are correct. Will fix.

Copy link
Member Author

@eddelbuettel eddelbuettel Dec 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New variant:

            if (verbose) {                                                                                                                                                                                         
                message("The 'windowsDebugDLL' toggle is ignored on "                                                                                                                                              
                        "non-Windows platforms.")                                                                                                                                                                  
            }                                                                                                                                                                                                      
            windowsDebugDLL <- FALSE    # now we do not need to deal with OS choice below                                                                                                                          
        }                                                       # #nocov end   

Better...

} # #nocov end
}

# get the context (does code generation as necessary)
Expand Down Expand Up @@ -121,6 +127,7 @@ sourceCpp <- function(file = "",
# prepare the command (output if we are in showOutput mode)
cmd <- paste(R.home(component="bin"), .Platform$file.sep, "R ",
"CMD SHLIB ",
ifelse(windowsDebugDLL, "-d ", ""),
"-o ", shQuote(context$dynlibFilename), " ",
ifelse(rebuild, "--preclean ", ""),
ifelse(dryRun, "--dry-run ", ""),
Expand Down
11 changes: 11 additions & 0 deletions inst/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
\itemize{
\item Safer \code{Rcpp_list*}, \code{Rcpp_lang*} and
\code{Function.operator()} (Romain in \ghpr{1014}, \ghit{1015}).
\item A number of \code{#nocov} markers were added (Dirk in
\ghprP1036}).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
\ghprP1036}).
\ghpr{1036}).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmpf. I could swear I can a check which should spotted that. Will fix!

}
\item Changes in Rcpp Attributes:
\itemize{
Expand All @@ -17,18 +19,27 @@
\ghit{1017}).
\item Invisible return object are now supported via new option (Kun Ren
in \ghpr{1025} fixing \ghit{1024}).
\item Unavailable packages referred to in \code{LinkingTo} are now
reported (Dirk in \ghpr{1027} fixing \ghit{1026}).
\item The \code{sourceCpp} function can now create a debug DLL on
Windows (Dirk in \ghpr{1037} fixing \ghit{ghit}).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, there's \ghit{ghit}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah. Something must be wrong with the water. Or the coffee. Or both.

Changed to \ghit{1035}. Thanks again.

}
\item Changes in Rcpp Documentation:
\itemize{
\item The \code{.github/} directory now has more explicit guidance on
contributinh, issues, and pull requests (Dirk).
\item The Rcpp Attributes vignette describe the new invisible return
objection option (Kun Ren in \ghpr{1025}).
\item Vignettes are now included as pre-made pdf files (Dirk in \ghpr{1029})
\item The Rcpp FAQ has new entry on the recommended
\code{importFrom} directive (Dirk in \ghpr{1031} fixing \ghit{1030}).
}
\item Changes in Rcpp Deployment:
\itemize{
\item Added unit test to check if C++ version remains remains aligned
with the package number (Dirk in \ghpr{1022} fixing \ghit{1021}).
\item The unit test system was switched to tinytest (Dirk in
\ghpr{1028}, \ghpr{1032}, \ghpr{1033}).
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions inst/include/Rcpp/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define RCPP_VERSION_STRING "1.0.3"

// the current source snapshot
#define RCPP_DEV_VERSION RcppDevVersion(1,0,3,4)
#define RCPP_DEV_VERSION_STRING "1.0.3.4"
#define RCPP_DEV_VERSION RcppDevVersion(1,0,3,5)
#define RCPP_DEV_VERSION_STRING "1.0.3.5"

#endif
6 changes: 5 additions & 1 deletion man/sourceCpp.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ and RCPP_MODULE declarations. A shared library is then built and its exported fu
\usage{
sourceCpp(file = "", code = NULL, env = globalenv(), embeddedR = TRUE, rebuild = FALSE,
cacheDir = getOption("rcpp.cache.dir", tempdir()), cleanupCacheDir = FALSE,
showOutput = verbose, verbose = getOption("verbose"), dryRun = FALSE)
showOutput = verbose, verbose = getOption("verbose"), dryRun = FALSE,
windowsDebugDLL = FALSE)
}
\arguments{
\item{file}{
Expand Down Expand Up @@ -43,6 +44,9 @@ sourceCpp(file = "", code = NULL, env = globalenv(), embeddedR = TRUE, rebuild =
\item{dryRun}{
\code{TRUE} to do a dry run (showing commands that would be used rather than
actually executing the commands).
}
\item{windowsDebugDLL}{
\code{TRUE} to create a debug DLL on Windows (and ignored on other platforms).
}
}
\details{
Expand Down