r-lib / actions

GitHub Actions for the R community
Creative Commons Zero v1.0 Universal
957 stars 207 forks source link

MacOS R-devel builds failing because gfortran is not found #724

Closed dmurdoch closed 1 year ago

dmurdoch commented 1 year ago

Describe the bug

The deldir package has some Fortran in it. I have R CMD check actions failing on MacOS R-devel (since the release of R 4.3.0) because deldir is failing to install. It gets a bunch of warnings; I think those don't matter. Then it fails when some gfortran libs are not found.

To Reproduce

I've set up a small testpkg that doesn't do anything, but it imports deldir. The check log here:

https://github.com/dmurdoch/testpkg/actions/runs/4861226608/jobs/8666011526

ends with this error:

  clang -mmacosx-version-min=10.13 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o deldir.so acchk.o addpt.o adjchk.o binsrt.o circen.o cross.o crossutil.o delet.o delet1.o delout.o delseg.o dirout.o dirseg.o dldins.o init.o initad.o insrt.o insrt1.o intri.o locn.o master.o mnnd.o pred.o qtest.o qtest1.o stoke.o succ.o swap.o testeq.o triar.o trifnd.o -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
  ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
  ld: warning: directory not found for option '-L/usr/local/gfortran/lib'
  ld: library not found for -lgfortran
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make: *** [deldir.so] Error 1
  ERROR: compilation failed for package ‘deldir’
  * removing ‘/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/RtmpotXreJ/pkg-libd9a608a2256/deldir’

Expected behavior

deldir is buildable on other platforms. I don't think it is doing anything fancy about libs; those are just the R defaults, so it should install.

gaborcsardi commented 1 year ago

I think this is because there is only an old R-devel build available at https://mac.r-project.org/, which does not have the toolchain updates that are already in R 4.3.0.

I am not sure what we could do about this, except waiting for a newer build?

dmurdoch commented 1 year ago

I asked Simon about it, and he said he would re-enable the builds, so this should fix itself soon.

s-u commented 1 year ago

@gaborcsardi what you can do is ask - nothing will happen if you don't ask. If Duncan didn't send me an email I wouldn't even know about this thread. I was not building R-devel, because it's essentially identical to R-patched at this point so I didn't expect anyone needing it.

Please note that package builds won't exist on CRAN for a long time as they make no sense for R-devel until it solidifies closer to the release, so I would not recommend using R-devel unless you plan to build all packages from sources.

s-u commented 1 year ago

Both R-devel builds (arm64 and x86_64) are now up.

dmurdoch commented 1 year ago

I just tried another build of the test package, and got the same error: https://github.com/dmurdoch/testpkg/actions/runs/4866724249

This might just be caching somewhere; I'll try again in the morning.

s-u commented 1 year ago

It is using ancient Fortran flags from years ago (from Fortran 8.2) instead of the ones provided by R (Fortran 12.2) - it looks like it's picking up a wrong R version on the runner (it shows High Sierra target instead of Big Sur). Unfortunately, r-setup doesn't print the R version nor does it show the URL, so it's hard to tell, but @gaborcsardi may be able to debug the action.

gaborcsardi commented 1 year ago

I updated the URL, so hopefully all is good now.

Re debugging, you can enable debug logging: https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging

It is also possible to enable it from the "Re-run jobs / Re-run failed job" button.

dmurdoch commented 1 year ago

Thanks, that does fix it. The run still fails because testpkg is junk, but deldir installs.

github-actions[bot] commented 1 year ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue