You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Heroku-24, Git only exists in the build image and not the run image. As such, if Git is needed at runtime it has to be installed using the APT buildpack. This install succeeds, and a git --version works at run-time, however, when attempting to actually clone a repository Git gives an error message:
$ mkdir testcase-git && cd $_
$ echo git > Aptfile
$ git init && git add -A && git commit -m '.'
$ h create --stack heroku-24 --buildpack heroku-community/apt
$ git push heroku main
...
remote: -----> Building on the Heroku-24 stack
remote: -----> Using buildpack: heroku-community/apt
remote: -----> Apt app detected
remote: -----> Detected Aptfile or Stack changes, flushing cache
remote: -----> Updating APT package index
...
remote: -----> Fetching .debs for git
remote: Reading package lists...
remote: Building dependency tree...
remote: 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 12 not upgraded.
remote: Need to get 3,679 kB of archives.
remote: After this operation, 0 B of additional disk space will be used.
remote: Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 git amd64 1:2.43.0-1ubuntu7.1 [3,679 kB]
remote: Fetched 3,679 kB in 1s (4,106 kB/s)
remote: Download complete and in download only mode
remote: -----> Installing git_1%3a2.43.0-1ubuntu7.1_amd64.deb
remote: -----> Writing profile script
remote: -----> Rewrite package-config files
remote: -----> Discovering process types
...
$ h run bash
~ $ git --version
git version 2.43.0
~ $ git clone https://github.com/heroku/12factor.git
Cloning into '12factor'...
warning: templates not found in /usr/share/git-core/templates
git: 'remote-https' is not a git command. See 'git --help'.
This is because Git internally uses a number of sub-commands that must be found on PATH, and Git cannot find the git-remote-https command, which is installed by this buildpack to /app/.apt/usr/lib/git-core, since Git is still looking at the normal system location (set when Git was compiled):
To save users from having to set the config var GIT_EXEC_PATH=/app/.apt/usr/lib/git-core on their Heroku app, the APT buildpack could set this env var automatically iff the /app/.apt/usr/lib/git-core directory exists (ie if a userland install of Git was performed).
The text was updated successfully, but these errors were encountered:
@colincasey I don't suppose this is something you would have time to take a look at? The env var would only need to be set at run time, and only when the git package was installed.
On Heroku-24, Git only exists in the build image and not the run image. As such, if Git is needed at runtime it has to be installed using the APT buildpack. This install succeeds, and a
git --version
works at run-time, however, when attempting to actually clone a repository Git gives an error message:This is because Git internally uses a number of sub-commands that must be found on
PATH
, and Git cannot find thegit-remote-https
command, which is installed by this buildpack to/app/.apt/usr/lib/git-core
, since Git is still looking at the normal system location (set when Git was compiled):However, Git allows for this location to be changed via the
GIT_EXEC_PATH
env var:https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables
So if that is set, cloning then works:
To save users from having to set the config var
GIT_EXEC_PATH=/app/.apt/usr/lib/git-core
on their Heroku app, the APT buildpack could set this env var automatically iff the/app/.apt/usr/lib/git-core
directory exists (ie if a userland install of Git was performed).The text was updated successfully, but these errors were encountered: