pak icon indicating copy to clipboard operation
pak copied to clipboard

pak::pak() doesn't have a way to pass arbitrary environment variables

Open ArnaudKunzi opened this issue 1 year ago • 1 comments

Some packages have build-time options passed by environment variables, e.g. package V8:

image

On Archlinux, compiling libv8 is bit bothersome with build deps on python2 etc... so setting DOWNLOAD_STATIC_V8=1 is actually desirable.
However, sys.setEnv(DOWNLOAD_STATIC_V8=1) doesn't seem to work as the env variable isn't passed to the subprocesses. It seems only ENV variables prefixed with PKG_ are, and pak::pak() doesn't propagate parameters not prefixed with pkg. either.

install.packages() works as intended in this instance.

Did I overlook a mechanism to pass the environment variable or is this indeed not possible at the moment?

> sessionInfo() R version 4.3.0 (2023-04-21) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Arch Linux

System info:

> uname -a Linux main 6.3.4-arch2-1 #1 SMP PREEMPT_DYNAMIC Mon, 29 May 2023 13:58:34 +0000 x86_64 GNU/Linux

ArnaudKunzi avatar Jun 04 '23 19:06 ArnaudKunzi