Set environment variable when "Build All" targets Makefile

When a project has a Makefile, the Build tab's "Build All" button will call make. What environment is make called from? How can I customize that environment?

My build needs access to a private GitHub token, which I have set in my ~/.profile and have tried setting in my ~/.Renviron. When I run make from the Terminal, the token is available and the build succeeds. When I run make with the Build All button ... no token.

RStudio launches make as a sub-process when building projects with a Makefile, and I believe the sub-process explicitly inherits the environment variables from the R session. Does that not appear to be true in your case?

Works as expected, my mistake. I hadn't specified the .Renviron correctly, and when I checked what Sys.getenv() showed, the token was missing. Got it working by fixing my .Renviron.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.