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

ubuntu2004 fails to install git-email due to missing ppa:git-core apt sources #3923

Closed
1 of 7 tasks
stefanha opened this issue Aug 18, 2021 · 5 comments
Closed
1 of 7 tasks
Assignees
Labels
OS: Ubuntu question Further information is requested

Comments

@stefanha
Copy link

Description

If a workflow tries to install the git-email package, there is a failure because the ppa:git-core apt sources from which git was installed has been removed in the ubuntu2004 image:

- name: Install git-email
  run: sudo apt-get install -qy git-email

The following apt-get error occurs:

The following packages have unmet dependencies:
 git-email : Depends: git (< 1:2.25.1-.) but 1:2.32.0-1~ppa0~ubuntu20.04.1 is to be installed
             Recommends: libemail-valid-perl but it is not going to be installed

The ubuntu2004 scripts remove the ppa:git-core repository here:
https://github.com/actions/virtual-environments/blob/main/images/linux/scripts/installers/git.sh#L27

@dibir-magomedsaygitov This is a regression introduced by commit d1de678

Virtual environments affected

  • Ubuntu 16.04
  • Ubuntu 18.04
  • Ubuntu 20.04
  • macOS 10.15
  • macOS 11
  • Windows Server 2016
  • Windows Server 2019

Image version and build link

ubuntu2004 20210810.1

Is it regression?

Yes, introduced by d1de678

Expected behavior

The ppa:git-core ppa from which the git package was installed should be available so further git-related packages can be installed without dependency conflicts. Resolving the dependency conflict manually is time-consuming and not user-friendly. Furthermore, this is a regression because ppa:git-core used to be available in the image.

Actual behavior

The ppa:git-core ppa is removed when the image is built. Attempts to install git-related packages can fail with dependency conflicts because apt tries to install Ubuntu system git packages instead of the ppa:git-core packages.

Repro steps

Try this:

- name: Install git-email
  run: sudo apt-get install -qy git-email
@al-cheb
Copy link
Contributor

al-cheb commented Aug 19, 2021

Hi, @stefanha

We intentionally removed this repo in the #3095 PR. Please add manually the repo in runtime.

jobs:
  build:
    name: Build
    runs-on: ubuntu-20.04
    steps:
        - run: |
            GIT_REPO="ppa:git-core/ppa"
            sudo add-apt-repository $GIT_REPO -y
            sudo apt-get update
            sudo apt-get install -qy git-email

@al-cheb al-cheb closed this as completed Aug 19, 2021
@al-cheb al-cheb added OS: Ubuntu question Further information is requested and removed needs triage labels Aug 19, 2021
@al-cheb al-cheb self-assigned this Aug 19, 2021
@stefanha
Copy link
Author

stefanha commented Aug 19, 2021

Hi, @stefanha

We intentionally removed this repo in the #3095 PR. Please add manually the repo in runtime.

jobs:
  build:
    name: Build
    runs-on: ubuntu-20.04
    steps:
        - run: |
            GIT_REPO="ppa:git-core/ppa"
            sudo add-apt-repository $GIT_REPO -y
            sudo apt-get update
            sudo apt-get install -qy git-email

I know how to work around this but removing the git apt sources isn't user-friendly.

Although the points in #2951 seem valid to me, they ignore that users will need to troubleshoot dependency problems due to this policy of removing apt sources that have installed packages. Troubleshooting is time-consuming and you'll get more bug reports like this one in the future from other users.

Please either use system git if you want to minimize apt sources or keep the ppa:git-core apt sources in the image if you really need that version of git.

A more long-term solution would be to see if apt sources can be configured or apt can be extended to support smart updates that avoid refreshing unnecessarily or failing due to network errors from non-essential apt sources.

@al-cheb
Copy link
Contributor

al-cheb commented Aug 19, 2021

Although the points in #2951 seem valid to me, they ignore that users will need to troubleshoot dependency problems due to this policy of removing apt sources that have installed packages. Troubleshooting is time-consuming and you'll get more bug reports like this one in the future from other users.

Please either use system git if you want to minimize apt sources or keep the ppa:git-core apt sources in the image if you really need that version of git.

A more long-term solution would be to see if apt sources can be configured or apt can be extended to support smart updates that avoid refreshing unnecessarily or failing due to network errors from non-essential apt sources.

We used to this approach and installed from official repo, but git version is outdated/security issues, that's why we got requests to update to the latest version - #3923 (comment). The best approach for our mind is to pre-installed the latest one and remove ppa repo.

@stefanha
Copy link
Author

stefanha commented Aug 19, 2021

Ideally the failed job output would contain a message saying you may need to manually enable repos that were used in the creation of this image. That would save time when people hit this type of issue in the future.

Also, this change broke existing GitHub Actions workflows. Maybe only introduce breaking changes when releasing new virtual environments so existing ones aren't affected?

Thanks for the discussion. I understand there's no perfect solution and I just wanted to share drawbacks I see with this policy.

@al-cheb
Copy link
Contributor

al-cheb commented Aug 19, 2021

Thank you. We will think about it.

felipec added a commit to felipec/git-send-series that referenced this issue Aug 2, 2022
They add the repository, update git, and remove the repository.

See actions/runner-images#3923.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: Ubuntu question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants