stan-dev / rstan

RStan, the R interface to Stan
https://mc-stan.org
1.02k stars 264 forks source link

stanc: preserve blank lines in source #1124

Open WardBrian opened 2 months ago

WardBrian commented 2 months ago

Summary:

This adds the blank.lines.skip=FALSE argument to scan used in stanc_process, which fixes the issue where line numbers reported by stanc did not match the source in compiler or runtime errors.

Intended Effect:

Closes #1123

How to Verify:

The code in #1123 now yields a straight line plot as expected

Side Effects:

None

Documentation:

None

Reviewer Suggestions:

@bgoodri @andrjohns

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):

Simons Foundation

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

WardBrian commented 2 months ago

@bgoodri the failures in github actions seem to be unrelated. Do you think this could make it into a CRAN patch in the near future?

bgoodri commented 2 months ago

Yes, although StanHeaders and / or rstanarm are more critical at the moment.

WardBrian commented 2 months ago

Sure. I'm going to try to take another look at the rstanarm issue tomorrow, is there something else with StanHeaders?

bgoodri commented 2 months ago

Well, we still do not know why geostan stops compiling, although the other package that was stopping is going all the way through again.

cdriveraus commented 2 months ago

@bgoodri re geostan, that looks a lot like what happens to ctsem (but ctsem is worse, https://cran.r-project.org/web/checks/check_results_ctsem.html ) , always assumed it was just timeout settings on CRAN boxes...

WardBrian commented 2 months ago

Yeah, g++-13: fatal error: Killed signal terminated program cc1plus and make[1]: *** [/home/hornik/tmp/R.check/r-patched-gcc/Work/build/etc/Makeconf:200: stanExports_ctsm.o] Terminated both point to the program being killed, not encountering an error. Either running out of time or running out of memory are almost certainly to blame

bgoodri commented 2 months ago

This is unrelated to the rstan issue with the javascript parser not preserving blank lines, but whatever.

Has anyone gotten a notice from CRAN saying their package is subject to removal due to the mysterious halting of the C++ compiler?

cdriveraus commented 2 months ago

It's been a vague concern (of mine) for years with ctsem, at some point years ago I had to remove a bunch of features to get it working on all boxes, as I had the unwanted attention of a rather infamous cran persona. Since then the termination errors have often been around, but (i think) variable in that sometimes all builds succeed, and no removal notices.