R-nvim / R.nvim

Neovim plugin to edit R files
GNU General Public License v3.0
129 stars 15 forks source link

Latest commits breaks Windows Build of Nvimcom #90

Closed akthe-at closed 3 months ago

akthe-at commented 3 months ago

OS: Windows 10 commit: a5f8666 branch: main

Problem seems to be with this commit here

Attempts to fix: change setenv to getenv, doesn't work if you keep the arguments as is...fails with warning about too many arguments. If you you remove the extra arguments besides the environment variable string, the build works. But that fix doesn't make sense based on a quick google search of setenv and the arguments you provided in the above commit.

Going to paste in my error message.

* preparing 'nvimcom':
* checking DESCRIPTION meta-information ...
 OK
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building 'nvimcom_0.9.35.tar.gz'
gcc  -I"C:/Users/ARK010/AppData/Local/Programs/R/R-4.3.1/include" -DNDEBUG     -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"  -D`C:/Users/ARK010/AppData/Local/Programs/R/R-4.3.1/bin/R --slave -e 'cat(Sy
s.info()[[1]])'` -DLWS_NO_FORK  -DWIN32   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c common.c -o common.o
gcc  -I"C:/Users/ARK010/AppData/Local/Programs/R/R-4.3.1/include" -DNDEBUG     -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"  -D`C:/Users/ARK010/AppData/Local/Programs/R/R-4.3.1/bin/R --slave -e 'cat(Sy
s.info()[[1]])'` -DLWS_NO_FORK  -DWIN32   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c nvimcom.c -o nvimcom.o
gcc  -I"C:/Users/ARK010/AppData/Local/Programs/R/R-4.3.1/include" -DNDEBUG     -I"C:/rtools43/x86_64-w64-mingw32.static.posix/include"  -D`C:/Users/ARK010/AppData/Local/Programs/R/R-4.3.1/bin/R --slave -e 'cat(Sy
s.info()[[1]])'` -DLWS_NO_FORK  -DWIN32   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign  -c rd2md.c -o rd2md.o
gcc -shared -s -static-libgcc -o nvimcom.dll tmp.def common.o nvimcom.o rd2md.o -lWs2_32 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib/x64 -LC:/rtools43/x86_64-w64-mingw32.static.posix/lib -LC:/Users/ARK010/A
ppData/Local/Programs/R/R-4.3.1/bin/x64 -lR
(cd apps; make -f Makefile.win)
make[1]: Entering directory '/c/Users/ARK010/AppData/Local/Temp/RtmpyagKBD/R.INSTALL1ea02f8e5b26/nvimcom/src/apps'gcc -mwindows -std=gnu99 -O3 -Wall -DWIN32 -m64 complete.c data_structures.c logging.c rnvimserver
.c obbr.c rgui.c tcp.c utilities.c ../common.c -o rnvimserver.exe -lWs2_32
make[1]: Leaving directory '/c/Users/ARK010/AppData/Local/Temp/RtmpyagKBD/R.INSTALL1ea02f8e5b26/nvimcom/src/apps'

Why build nvimcom: nvimcom version mismatch
Time:
  windows setup: 0.2154036
  before_rns.R: 18.1124079
  global setup: 0.2318926
before_rns.R stderr:
.build_packages() exit status 0
* installing to library 'C:/Users/ARK010/AppData/Local/Programs/R/R-4.3.1/library'
* installing *source* package 'nvimcom' ...
** using staged installation
** libs
using C compiler: 'gcc.exe (GCC) 12.3.0'
rnvimserver.c: In function 'stdin_loop':rnvimserver.c:158:17: warning: implicit declaration of function 'setenv'; did you mean 'getenv'? [-Wimplicit-function-declaration]  158 |                 setenv("CMPR_DOC_W
IDTH", msg, 1);      |                 ^~~~~~      |                 getenv
C:\rtools43\x86_64-w64-mingw32.static.posix\bin/ld.exe: C:\Users\ARK010\AppData\Local\Temp\
cczb0t3b.o:rnvimserver.c:(.text+0x400): undefined reference to `
sete
nv'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [Makefile.win:17: rnvimserver.exe] Error 1
make: *** [Makevars.win:11: nvimapps] Error 2
ERROR: compilation failed for package 'nvimcom'
* removing 'C:/Users/ARK010/AppData/Local/Programs/R/R-4.3.1/library/nvimcom'
* restoring previous 'C:/Users/ARK010/AppData/Local/Programs/R/R-4.3.1/library/nvimcom'
Error in do_exit(status = status) : .install_packages() exit status 1
* removing 'C:/Users/ARK010/AppData/Local/Programs/R/R-4.3.1/library/nvimcom'
Error in do_exit(status = status) : .install_packages() exit status 1
Execution halted
jalvesaq commented 3 months ago

Thanks for reporting the bug! I avoided calling setenv and it should be fixed now.