I tried @wds15’s solution, and it fixed the overwriting problem, though looks as if I was wrong about package compiling with C++17 (given @wds15’s helpful explanation of the problem, github actions was obviously also overwriting Makevars during package build). I’ll post the error trace and what seems to be the major error during compilation in case it is of use to anyone, but will just go forward with trying to tell CRAN C++14 is a must for my package. Thank you @phcooney again for the thread and everyone for their help!
Error trace:
<system_command_status_error/rlib_error_3_0/rlib_error/error>
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, …`:
! System command 'Rcmd.exe' failed
---
Exit status: 1
stdout & stderr: <printed>
---
Backtrace:
1. devtools::build()
2. pkgbuild::build(path = pkg, dest_path = path, binary = binary, …
3. withr::with_temp_libpaths(rcmd_build_tools(options$cmd, c(options$path, …
4. base::force(code)
5. pkgbuild::rcmd_build_tools(options$cmd, c(options$path, options$args), …
6. pkgbuild::with_build_tools({ …
7. withr::with_path(rtools_path(), code)
8. base::force(code)
9. base::withCallingHandlers(callr::rcmd_safe(..., env = env, spinner = FALSE, …
10. callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE, …
11. callr:::run_r(options)
12. base::with(options, with_envvar(env, do.call(processx::run, c(list(bin, …
13. base::with.default(options, with_envvar(env, do.call(processx::run, …
14. base::eval(substitute(expr), data, enclos = parent.frame())
15. base::eval(substitute(expr), data, enclos = parent.frame())
16. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args = real_cmdargs, …
17. base::force(code)
18. base::do.call(processx::run, c(list(bin, args = real_cmdargs, stdout_line_callback = real_callback(s…
19. (function (command = NULL, args = character(), error_on_status = TRUE, …
20. base::throw(new_process_error(res, call = sys.call(), echo = echo, …
21. | base::signalCondition(cond)
22. (function (e) …
23. asNamespace("callr")$err$throw(e)
Error during compilation:
error: ll of overloaded 'size(const std::vector<stan::math::var_value<double>, std::allocator<stan::math::var_value<double> > >&)ambiguous
87 | logp -= sum(log_y) * N / size(y)
| ~~~~^~~
In file included from C:/Users/isaac/Documents/R/win-library/4.1/StanHeaders/include/stan/math/prim/err/elementwise_check.hpp:6
from C:/Users/isaac/Documents/R/win-library/4.1/StanHeaders/include/stan/math/prim/err/check_not_nan.hpp:5
from C:/Users/isaac/Documents/R/win-library/4.1/StanHeaders/include/stan/math/prim/err/check_2F1_converges.hpp:5
from C:/Users/isaac/Documents/R/win-library/4.1/StanHeaders/include/stan/math/prim/err.hpp:4
from C:/Users/isaac/Documents/R/win-library/4.1/StanHeaders/include/stan/math/prim.hpp:12
from C:/Users/isaac/Documents/R/win-library/4.1/StanHeaders/include/src/stan/io/dump.hpp:10
from C:/Users/isaac/Documents/R/win-library/4.1/rstan/include/rstan/stan_fit.hpp:43
from C:/Users/isaac/Documents/R/win-library/4.1/rstan/include/rstan/rstaninc.hpp:4
from stanExports_MCMC.h:23
from stanExports_MCMC.cc:5
C:/Users/isaac/Documents/R/win-library/4.1/StanHeaders/include/stan/math/prim/fun/size.hpp:28:15: