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

Git not installed on containers (/git submodules) #612

Closed
fhenz opened this issue May 30, 2024 · 3 comments
Closed

Git not installed on containers (/git submodules) #612

fhenz opened this issue May 30, 2024 · 3 comments

Comments

@fhenz
Copy link

fhenz commented May 30, 2024

Git seems to not be installed on at least GCC14 & clang19 containers when the repo gets checked out (step r-hub/actions/checkout@v1).

I encountered this originally because I was testing git submodules, and manually added submodules: true to that step in the workflow file. This then led the action to fail (Input 'submodules' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git 2.18 or higher to the PATH.). I checked afterwards and even without submodules, checkouts output contains this: The repository will be downloaded using the GitHub REST API To create a local Git repository instead, add Git 2.18 or higher to the PATH.

My first workaround attempt was running git submodule update --init --recursive after the checkout, but this then gave the error /__w/_temp/f02433a2-2220-4eaa-8f18-86cf765ab970.sh: line 1: git: command not found. After some debugging (which git/git --version) it seemed git was not installed on the container.

The second attempt was adding git as SystemRequirements to the DESCRIPTION file (following #600) and running the submodule update after r-hub/actions/setup-deps@v1. This kind of works, the problem here is that the original checkout doesn't create a local git repository (since fallback to REST API) so the submodule update returns: fatal: not a git repository.

My solution now is to install git via the package manager in a step before checkout (then submodules: true works), but this is of course not great with the different containers (dnf for gcc14, apt-get for clang19, etc.).

@gaborcsardi
Copy link
Collaborator

Yeah, originally this was intentional, because git was also not installed on some of the CRAN machines. OTOH, I am not sure if that's still true, and since we are running the checks on GitHub, it certainly causes problems.

So yeah, I think we should install git on the containers.

@gaborcsardi
Copy link
Collaborator

The containers will be rebuilt overnight, so this should be fixed tomorrow.

@fhenz
Copy link
Author

fhenz commented May 30, 2024

Cool, thanks for the quick response & resolution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants