-
-
Notifications
You must be signed in to change notification settings - Fork 267
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
RStan is passing the wrong type for the code argument to stanc.js on Windows #1145
Comments
Note that directly using The array being passed seems to be split at newlines: @hsbadr could you look into this? It's generating a lot of noise in the stanc3 repo, and it looks like most of the users are using |
Note: setting my line endings to CRLF on ubuntu still didn't trigger the same behavior as Windows |
@WardBrian something might have changed recently, but I'm not able to reproduce this error across either Windows 10 or Windows 11 (with a fresh install of All attempts return:
|
That is the correct error for the specific model I posted, since you can’t use Did you also try CRAN rstans? |
Similar for CRAN rstan, just an error about the missing semicolons instead:
|
I was just able to reproduce on a completely clean install of Win 11 24H2 (26100.2605) (using Windows Sandbox) with the same model as in the OP. I created the file and ran the code in the RGui, if that matters for some reason? |
It also seems RStan on runiverse hasn’t been re built since I added type checking to the compiler inputs, because it’s still just throwing a “should never happen” |
What does the
Could you upload/attach the model text file? So we can rule out the editor/file saving |
Ah, looks like the |
Ah managed to reproduce it in the Windows Sandbox, odd that it doesn't happen in the native system - even if I use the file created in the Sandbox. How bizarre, will do a bit more debugging over the next few days and update the experimental branch |
Oh, super weird! I assume the users who have been reporting aren’t all running in a VM, so there must be some difference in that environment compared to your real install. Maybe it is an encoding thing? I won’t have access to my windows machine until the end of the day at this point |
The errors seem to come from this block which seems to have something to do with processing '#' characters using the C pre-processor, but I have no idea why it's necessary and removing it fixes things. Can you try installing this branch of rstan to see if it works for you: remotes::install_github("stan-dev/rstan@no-pound-process", subdir = "rstan/rstan") (Or just edit a local source to remove the block) |
At least on the experimental branch, that code can definitely be removed and replaced with stan-dev/stanc3#1433 I’ll give it a try later today! |
The no-pound-process branch did fix it for me, so that block does seem to be the culprit |
This has lead to stan-dev/stanc3#1446 and the seven duplicates therein.
I think the issue is the code that reads from a file is returning a vector of strings, rather than just one string. No idea why this is OS-specific.
This might be related to my pr #1124 which touches some of the same code
Description:
This model consistently raises an error on Windows, but not on other platforms:
> rstan::stanc("./m2.stan")
yieldsBy replacing the
stanc.js
with the non-minified version, and adding some extra printing code to it, this became clear:b
above is the code stringThat is why this code does not lead to a crash:
(though, it does raise a genuine syntax error, which is good!)
RStan Version:
‘2.36.0.9000’
R Version:
"R version 4.4.2 (2024-10-31 ucrt)"
Operating System:
Windows 11
The text was updated successfully, but these errors were encountered: