r-lib / gert

Simple git client for R
https://docs.ropensci.org/gert/
Other
146 stars 31 forks source link

Problems compiling using gcc 14.1.1 #217

Closed zhushazang closed 3 months ago

zhushazang commented 3 months ago

When trying to compile the devtools package, a compilation problem occurred with the gert package. The attempt is carried out in an Arch Linux environment:

> install.packages("devtools",repos="https://brieger.esalq.usp.br/CRAN/",checkBuik=TRUE,Ncpus=8)
Installing package into ‘/home/rodolfo/R/x86_64-pc-linux-gnu-library/4.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘gert’, ‘usethis’

trying URL 'https://brieger.esalq.usp.br/CRAN/src/contrib/gert_2.0.1.tar.gz'
Content type 'application/x-gzip' length 122723 bytes (119 KB)
==================================================
downloaded 119 KB

trying URL 'https://brieger.esalq.usp.br/CRAN/src/contrib/usethis_2.2.3.tar.gz'
Content type 'application/x-gzip' length 371088 bytes (362 KB)
==================================================
downloaded 362 KB

trying URL 'https://brieger.esalq.usp.br/CRAN/src/contrib/devtools_2.4.5.tar.gz'
Content type 'application/x-gzip' length 374718 bytes (365 KB)
==================================================
downloaded 365 KB

begin installing package ‘gert’
make: *** [Makefile:4: gert.ts] Error 1
make: Target 'all' not remade because of errors.
* installing *source* package ‘gert’ ...
** package ‘gert’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=
Using PKG_LIBS=-lgit2
Configuration OK!
** libs
using C compiler: ‘gcc (GCC) 14.1.1 20240507’
make[1]: Entering directory '/home/rodolfo/R_TEMP/Rtmp7KJrLI/R.INSTALL28af53b336aec/gert/src'
rm -f gert.so branch.o clone.o commit.o config.o conflicts.o files.o ignore.o init.o merge.o rebase.o stash.o submodules.o tag.o utils.o version.o
gcc -I"/usr/include/R/" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects  -c branch.c -o branch.o
gcc -I"/usr/include/R/" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects  -c clone.c -o clone.o
gcc -I"/usr/include/R/" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects  -c commit.c -o commit.o
commit.c: In function ‘R_git_commit_create’:
commit.c:162:60: error: passing argument 10 of ‘git_commit_create’ from incompatible pointer type [-Wincompatible-pointer-types]
  162 |                             msg.ptr, tree, number_parents, parents), "git_commit_create");
      |                                                            ^~~~~~~
      |                                                            |
      |                                                            const git_commit **
In file included from /usr/include/git2/repository.h:14,
                 from /usr/include/git2/annotated_commit.h:11,
                 from /usr/include/git2.h:11,
                 from utils.h:1,
                 from commit.c:2:
/usr/include/git2/commit.h:369:28: note: expected ‘git_commit * const*’ but argument is of type ‘const git_commit **’
  369 |         git_commit * const parents[]);
      |         ~~~~~~~~~~~~~~~~~~~^~~~~~~~~
make[1]: *** [/usr/lib64/R/etc/Makeconf:195: commit.o] Error 1
make[1]: Leaving directory '/home/rodolfo/R_TEMP/Rtmp7KJrLI/R.INSTALL28af53b336aec/gert/src'
ERROR: compilation failed for package ‘gert’
* removing ‘/home/rodolfo/R/x86_64-pc-linux-gnu-library/4.4/gert’

The downloaded source packages are in
    ‘/home/rodolfo/R_TEMP/RtmpxqEwbb/downloaded_packages’
Warning message:
In install.packages("devtools", repos = "https://brieger.esalq.usp.br/CRAN/",  :
  installation of 3 packages failed:  ‘gert’, ‘usethis’, ‘devtools’
> 

If any new information is needed, I will make it available.

Best regards.

jeroen commented 3 months ago

Duplicate of https://github.com/r-lib/gert/issues/213, already fixed in the main branch.

jeroen commented 1 month ago

A patch release gert 2.1.0 is now on CRAN.