Nix shell environment to debug a build of an R package

I am trying to investigate It looks like the configure script is failing and config.log file can provide some hints. How do I create a nix-shell sandbox where config.log is not removed?


Maybe --keep-failed?

@rmcgibbo Yes, thank you! It looks like something is wrong with the Azul JDK. Running

$ nix-shell --pure -p rPackages.rJava --keep-failed

did allow me to examine that config.log file where I found that there is a missing header file in the directory:

In file included from conftest.c:30:                                                                                                                                             
/nix/store/3xlg2rn1mkpypxd2xvz26xrlgfrbrmnr-zulu- fatal error: jni_md.h: No such file or directory                                                 
   45 | #include "jni_md.h"                                                                                                                                                      
      |          ^~~~~~~~~~                                                                                                                                                      
compilation terminated.     

Comparing the Azul JDK to Open JDK it is clear that the file is in include\linux subdirectory but while OpenJDK symlinks it back to include, Azul JDK doesn’t - and there is an issue for that ( Too bad the issue is still unresolved :frowning:

1 Like

you can also do nix-shell default.nix -A rPackages.rJava
which will drop you into the shell used to conduct the build. You can then do unpackSource and the other phases locally. Really useful when doing a new package and might hit many hiccups.

I have an example using this in