Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgit2.so.1.7 not found on GH actions ubuntu latest #760

Open
tdhock opened this issue Apr 2, 2025 · 4 comments
Open

libgit2.so.1.7 not found on GH actions ubuntu latest #760

tdhock opened this issue Apr 2, 2025 · 4 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@tdhock
Copy link

tdhock commented Apr 2, 2025

hi @gaborcsardi
I see that pak is used in r-lib/actions/setup-r-dependencies so I'm filing here (please tell me if it is not appropriate).
I expected that my tests should pass on github actions ubuntu latest, but I am seeing a libgit2.so.1.7 not found, https://github.com/tdhock/atime/actions/runs/14228891516/job/39874934273#step:8:226

Error in `dyn.load(file, DLLpath = DLLpath, ...)`: unable to load shared object '/home/runner/work/_temp/Library/git2r/libs/git2r.so':
  libgit2.so.1.7: cannot open shared object file: No such file or directory

this package has Imports: git2r so I assumed that git2r and its dependencies should be installed prior to package checking. And it works fine on other versions of ubuntu, so maybe there is some configuration issue with the new ubuntu image? https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250330.1 this worked in the past and it looks like this new runner image was deployed just 2 days ago.
Thanks in advance if you can help.

@gaborcsardi
Copy link
Member

gaborcsardi commented Apr 3, 2025

Seems like a bug indeed, IDK why libgit2-dev is missing:

❯ pak::pkg_sysreqs("git2r", sysreqs_platform="ubuntu-2404")
── Install scripts ─────────────────────────────────────────────── Ubuntu 2404 ──
apt-get -y update
apt-get -y install libssh2-1-dev libssl-dev

── Packages and their system dependencies ───────────────────────────────────────
git2r – libssh2-1-dev, libssl-dev

As a workaround you can install it manually for now.

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Apr 3, 2025
@tdhock
Copy link
Author

tdhock commented Apr 3, 2025

I tried install.packages("git2r") in the actions workflow which downloads a binary package from posit server, and still does not work, so maybe that is the issue?

> install.packages("git2r")
Installing package into/home/runner/work/_temp/Library’
(aslibis unspecified)
trying URL 'https://packagemanager.posit.co/cran/__linux__/noble/latest/src/contrib/git2r_0.36.2.tar.gz'

https://github.com/tdhock/atime/actions/runs/14229862608/job/39877988708#step:8:35

@gaborcsardi
Copy link
Member

I meant installing the libgit2-dev Ubuntu package manually.

@tdhock
Copy link
Author

tdhock commented Apr 3, 2025

I tried both.
Turns out that libgit2-dev is already installed on the runner image (no need to apt-get it).
The fix was to add a step to the workflow, after setup-r-dependencies, and before check-r-package:

      - name: install git2r
        shell: bash
        run: R -e 'install.packages("git2r",type="source",repos="http://cloud.r-project.org")'

The output I got was

> system("sudo apt install libgit2-dev");install.packages("git2r",type="source",repos="http://cloud.r-project.org/")

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
libgit2-dev is already the newest version (1.7.2+ds-1ubuntu3).
0 upgraded, 0 newly installed, 0 to remove and 104 not upgraded.
Installing package into ‘/home/runner/work/_temp/Library’
(as ‘lib’ is unspecified)
trying URL 'http://cloud.r-project.org/src/contrib/git2r_0.36.2.tar.gz'
Content type 'application/x-gzip' length 239417 bytes (233 KB)
==================================================
downloaded 233 KB

* installing *source* package ‘git2r’ ...
** this is package ‘git2r’ version ‘0.36.2’
** package ‘git2r’ successfully unpacked and MD5 sums checked
** using staged installation
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
Found pkg-config cflags and libs!
checking whether the libgit2 version will work in git2r... yes
----- Results of the git2r package configure -----

  PKG_CFLAGS: 
  PKG_LIBS: -lgit2 

--------------------------------------------------
configure: creating ./config.status
config.status: creating src/Makevars
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r.c -o git2r.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_S3.c -o git2r_S3.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_arg.c -o git2r_arg.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_blame.c -o git2r_blame.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_blob.c -o git2r_blob.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_branch.c -o git2r_branch.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_checkout.c -o git2r_checkout.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_clone.c -o git2r_clone.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_commit.c -o git2r_commit.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_config.c -o git2r_config.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_cred.c -o git2r_cred.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_diff.c -o git2r_diff.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_error.c -o git2r_error.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_graph.c -o git2r_graph.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_index.c -o git2r_index.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_libgit2.c -o git2r_libgit2.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_merge.c -o git2r_merge.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_note.c -o git2r_note.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_object.c -o git2r_object.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_odb.c -o git2r_odb.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_oid.c -o git2r_oid.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_proxy.c -o git2r_proxy.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_push.c -o git2r_push.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_reference.c -o git2r_reference.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_reflog.c -o git2r_reflog.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_remote.c -o git2r_remote.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_repository.c -o git2r_repository.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_reset.c -o git2r_reset.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_revparse.c -o git2r_revparse.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_revwalk.c -o git2r_revwalk.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_signature.c -o git2r_signature.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_stash.c -o git2r_stash.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_status.c -o git2r_status.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_tag.c -o git2r_tag.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_transfer.c -o git2r_transfer.o
gcc -std=gnu2x -I"/opt/R/devel/lib/R/include" -DNDEBUG -DR_NO_REMAP -DSTRICT_R_HEADERS  -I/usr/local/include   -fvisibility=hidden -fpic  -g -O2  -c git2r_tree.c -o git2r_tree.o
gcc -std=gnu2x -shared -L/opt/R/devel/lib/R/lib -L/usr/local/lib -o git2r.so git2r.o git2r_S3.o git2r_arg.o git2r_blame.o git2r_blob.o git2r_branch.o git2r_checkout.o git2r_clone.o git2r_commit.o git2r_config.o git2r_cred.o git2r_diff.o git2r_error.o git2r_graph.o git2r_index.o git2r_libgit2.o git2r_merge.o git2r_note.o git2r_object.o git2r_odb.o git2r_oid.o git2r_proxy.o git2r_push.o git2r_reference.o git2r_reflog.o git2r_remote.o git2r_repository.o git2r_reset.o git2r_revparse.o git2r_revwalk.o git2r_signature.o git2r_stash.o git2r_status.o git2r_tag.o git2r_transfer.o git2r_tree.o -lgit2 -L/opt/R/devel/lib/R/lib -lR
installing to /home/runner/work/_temp/Library/00LOCK-git2r/00new/git2r/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (git2r)

https://github.com/tdhock/atime/actions/runs/14241985711/job/39913793703

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants