Compile R packages for Windows in Linux

I am using a GitLab CI pipeline where in a stage I build the targz of my R package using devtools::build(), the idea is that at the final stage I push this targz in a nexus repository. My problem is that in my company we push a targz and a zip for Windows users. So I wanted to know if there is a way to create the zip on linux. The docker image used by our GitLab runner is based on an Almalinux 8 image.

Tried devtools::build(binary = TRUE) but later I figured out that it's platform dependent so it only generates a zip on windows machines.

1 Like

You cannot cross-compile binary windows R packages on Linux today, as far as I know. At least there is no streamlined open source tooling available for this.

1 Like