Re: [R-pkg-devel] How to debug segfault when running build -> document in Rstudio that includes TMB module

2024-01-23 Thread James Lamb
Carl,

Consider performing these tasks without the use of the 'devtools' package,
running the following from a shell.

```shell
R CMD build .
R CMD INSTALL --with-keep.source ./SPAS_*.tar.gz

# (assuming you use roxygen2)
Rscript -e "roxygen2::roxygenize(load = 'installed')"

R CMD check --as-cran ./SPAS_*.tar.gz
```

If those commands are successful, then you know the problem lies somewhere
in the difference between that approach and what 'devtools' does, which
might help to narrow it down.

Cheers,

-James


On Tue, Jan 23, 2024 at 9:23 PM Carl Schwarz 
wrote:

> I'm trying to update my SPAS package to respond to a CRAN check. Before
> starting the changes, I tried to rebuild my package, but now get a segfault
> when I try to do a devtools::document() or devtools::check(args =
> c('--as-cran')). See below for output from the Rstudio "Build" window.
>
> I've
> - reinstalled ALL packages
> - reinstalled R (4.3.2 on MacOS Intel Chip)
> - reinstalled Rstudio
>
> When I try a rebuild/document on a sister package it runs fine, so I
> suspect that the problem is related to using a TMB module that is part of
> the SPAS package written in Cpp.
>
> How do I start to "debug" this to identify the problem?
>
> Thanks
> Carl Schwarz
>
>
>
>
> ==> devtools::document(roclets = c('rd', 'collate', 'namespace',
> 'vignette'))
> ℹ Updating SPAS documentationℹ Loading SPAS
>
>  *** caught segfault ***
> address 0x54e40, cause 'memory not mapped'
>
> Traceback:
>  1: dyn.load(dll_copy_file)
>  2: library.dynam2(path, lib)
>  3: load_dll(path)
>  4: pkgload::load_all(path, helpers = FALSE, attach_testthat = FALSE)
>  5: load_code(base_path)
>  6: roxygen2::roxygenise(pkg$path, roclets)
>  7: devtools::document(roclets = c("rd", "collate", "namespace",
> "vignette"))
>  8: withCallingHandlers(expr, packageStartupMessage = function(c)
> tryInvokeRestart("muffleMessage"))
>  9: suppressPackageStartupMessages({oldLC <-
> Sys.getlocale(category = "LC_COLLATE")Sys.setlocale(category =
> "LC_COLLATE", locale = "C")on.exit(Sys.setlocale(category =
> "LC_COLLATE", locale = oldLC))devtools::document(roclets = c("rd",
> "collate", "namespace", "vignette"))})
> An irrecoverable exception occurred. R is aborting now ...
>
> Exited with status 139.
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>


-- 
James Lamb (he/him)
GitHub  | LinkedIn


[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] How to debug segfault when running build -> document in Rstudio that includes TMB module

2024-01-23 Thread Carl Schwarz
I'm trying to update my SPAS package to respond to a CRAN check. Before
starting the changes, I tried to rebuild my package, but now get a segfault
when I try to do a devtools::document() or devtools::check(args =
c('--as-cran')). See below for output from the Rstudio "Build" window.

I've
- reinstalled ALL packages
- reinstalled R (4.3.2 on MacOS Intel Chip)
- reinstalled Rstudio

When I try a rebuild/document on a sister package it runs fine, so I
suspect that the problem is related to using a TMB module that is part of
the SPAS package written in Cpp.

How do I start to "debug" this to identify the problem?

Thanks
Carl Schwarz




==> devtools::document(roclets = c('rd', 'collate', 'namespace', 'vignette'))
ℹ Updating SPAS documentationℹ Loading SPAS

 *** caught segfault ***
address 0x54e40, cause 'memory not mapped'

Traceback:
 1: dyn.load(dll_copy_file)
 2: library.dynam2(path, lib)
 3: load_dll(path)
 4: pkgload::load_all(path, helpers = FALSE, attach_testthat = FALSE)
 5: load_code(base_path)
 6: roxygen2::roxygenise(pkg$path, roclets)
 7: devtools::document(roclets = c("rd", "collate", "namespace",
"vignette"))
 8: withCallingHandlers(expr, packageStartupMessage = function(c)
tryInvokeRestart("muffleMessage"))
 9: suppressPackageStartupMessages({oldLC <-
Sys.getlocale(category = "LC_COLLATE")Sys.setlocale(category =
"LC_COLLATE", locale = "C")on.exit(Sys.setlocale(category =
"LC_COLLATE", locale = oldLC))devtools::document(roclets = c("rd",
"collate", "namespace", "vignette"))})
An irrecoverable exception occurred. R is aborting now ...

Exited with status 139.

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] lost braces note on CRAN pretest related to \itemize

2024-01-23 Thread Georgi Boshnakov
The notes you get illustrate why they are useful, if you look at your rendered 
documentation you probably will see something wrong. Thousands of packages on 
CRAN, including some of mines have had this kind of infelicities for years.

Firstly, the two sets of braces suggest that you meant a description 
environment, not itemize (in which  its only argument doesn't need braces).

Secondly, in the value section, \item is implicitly enclosed in \describe and 
you don't need to include the latter.

Georgi Boshnakov


Sent from Outlook for Android


From: R-package-devel  on behalf of 
Patrick Giraudoux 
Sent: Tuesday, January 23, 2024 7:09:22 pm
To: Dirk Eddelbuettel 
Cc: R Package Development 
Subject: Re: [R-pkg-devel]  lost braces note on CRAN pretest related to \itemize

OK. Clear enough. CRAN applies a new "filter" as it was going through
without crying a note since decades ;-). However, indeed, re-checking
the manual "Writing R extensions" my syntax was wrong...
Thanks for the guidance,
Patrick

Le 23/01/2024 � 19:58, Dirk Eddelbuettel a �crit :
> On 23 January 2024 at 19:39, Patrick Giraudoux wrote:
> | Has anyone an idea about what is going wrong ?
>
> \item has no braces following it.  From a package I submitted today and for
> which I still have NEWS.Rd in the editor (indented here):
>
>\section{Changes in version 0.0.22 (2024-01-23)}{
>  \itemize{
>\item Replace empty examples macros to satisfy CRAN request.
>  }
>}
>
> Hth,  Dirk
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r-package-devel__;!!PDiH4ENfjr2_Jw!Gu9AhS4Yi4k5IC8TXv4B8xpznl-8-Jhl-cdxRZ6zVrRCdmDaSTVYpaG5XDoitdms9FuHQGV7adP-Q6WD6w2bMws_b5UnszsH5VsXFBMUIvFX4Nc$
 [stat[.]ethz[.]ch]


[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] lost braces note on CRAN pretest related to \itemize

2024-01-23 Thread Patrick Giraudoux
OK. Clear enough. CRAN applies a new "filter" as it was going through 
without crying a note since decades ;-). However, indeed, re-checking 
the manual "Writing R extensions" my syntax was wrong...
Thanks for the guidance,
Patrick

Le 23/01/2024 à 19:58, Dirk Eddelbuettel a écrit :
> On 23 January 2024 at 19:39, Patrick Giraudoux wrote:
> | Has anyone an idea about what is going wrong ?
>
> \item has no braces following it.  From a package I submitted today and for
> which I still have NEWS.Rd in the editor (indented here):
>
>\section{Changes in version 0.0.22 (2024-01-23)}{
>  \itemize{
>\item Replace empty examples macros to satisfy CRAN request.
>  }
>}
>
> Hth,  Dirk
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] lost braces note on CRAN pretest related to \itemize

2024-01-23 Thread Ivan Krylov via R-package-devel
В Tue, 23 Jan 2024 19:39:54 +0100
Patrick Giraudoux  пишет:

>    \itemize{
>    \item{.}{lm and glm objects can be passed directly as the upper
> scope of term addition (all terms added).

Inside the \itemize and \enumerate commands, the \item command doesn't
take any arguments:
https://cran.r-project.org/doc/manuals/R-exts.html#Lists-and-tables

Instead, it starts a new paragraph with a number (\enumerate) or a
bullet point (\itemize). R CMD check is reminding you that \itemize{
\item{foo}{bar} } is equivalent to \itemize{ \item foo bar } without
any braces.

If you meant to highlight a word by making it an argument of the \item
command, use the \describe command. Here, you're highlighting a dot,
which would be rendered with a bullet point before it, so it's probably
neither semantically nor visually appropriate.

> \value{
>    A \code{\link[sf]{sfc}} object, of POINT geometry, with the
> following columns:
>    \itemize{
>    \item{ID}{ ID number}

The same problem applies here.

Additionally, R CMD check is reminding you that \value{} is implicitly
a special case of a \describe{} environment:
https://cran.r-project.org/doc/manuals/R-exts.html#index-_005cvalue

Since you're already using \item{}{} labels to name the components of
the value, just drop the \itemize{} (but keep its contents). \value{} is
enough.

-- 
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] lost braces note on CRAN pretest related to \itemize

2024-01-23 Thread Dirk Eddelbuettel


On 23 January 2024 at 19:39, Patrick Giraudoux wrote:
| Has anyone an idea about what is going wrong ?

\item has no braces following it.  From a package I submitted today and for
which I still have NEWS.Rd in the editor (indented here):

  \section{Changes in version 0.0.22 (2024-01-23)}{
\itemize{
  \item Replace empty examples macros to satisfy CRAN request.
}
  }

Hth,  Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] lost braces note on CRAN pretest related to \itemize

2024-01-23 Thread Patrick Giraudoux
Dear listers,

I meet a problem with the  submission of the package pgirmess. In fact 
the package goes through R CMD check --as-cran and R-wind-builder 
smoothly with no problem, but submitted to CRAN, I get this:

Flavor: r-devel-linux-x86_64-debian-gcc, r-devel-windows-x86_64
Check: CRAN incoming feasibility, Result: Note_to_CRAN_maintainers
   Maintainer: 'Patrick Giraudoux'

Flavor: r-devel-linux-x86_64-debian-gcc, r-devel-windows-x86_64
Check: Rd files, Result: NOTE
   checkRd: (-1) mergeTrackObs.rd:24: Lost braces in \itemize; \value handles 
\item{}{} directly
   checkRd: (-1) mergeTrackObs.rd:25: Lost braces in \itemize; \value handles 
\item{}{} directly
   checkRd: (-1) mergeTrackObs.rd:26: Lost braces in \itemize; \value handles 
\item{}{} directly
   checkRd: (-1) selMod.rd:29-31: Lost braces in \itemize; meant \describe ?
   checkRd: (-1) selMod.rd:32-33: Lost braces in \itemize; meant \describe ?
   checkRd: (-1) selMod.rd:54: Lost braces in \itemize; meant \describe ?
   checkRd: (-1) selMod.rd:55: Lost braces in \itemize; meant \describe ?

The code that seems to make problem (although braces are balanced; I 
wonder why a claim 'lost braces') is

- for mergeTrackObs.rd

\value{
   A \code{\link[sf]{sfc}} object, of POINT geometry, with the following 
columns:
   \itemize{
   \item{ID}{ ID number}
   \item{nObs}{ The number of observations in the interval}
   \item{geometry} {POINT geometry}
   }
}

- for selMod.rd

\details{
   This function provides parameters used in the information theoretic 
methods for model comparisons.
   \itemize{
   \item{.}{lm and glm objects can be passed directly as the upper scope 
of term addition (all terms added).
   Every model from y\eqn{\sim}{~}1 is computed adding one term at a 
time until the upper scope model is derived. This is a stepwise analysis 
where the terms are added sequentially and this does NOT provide all 
combinations of terms and interactions. Offset terms cannot be proceeded 
here.
   }
   \item{.}{A list of user specified lm, glm, nls, lme or nlme objects 
(actually any object for which AIC and logLik functions are applicable) 
to compare can alternately be passed.
   }
   }
}

Has anyone an idea about what is going wrong ?

Patrick





[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel