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

Remove orphaned packages #35

Merged
merged 3 commits into from
Feb 24, 2025
Merged

Remove orphaned packages #35

merged 3 commits into from
Feb 24, 2025

Conversation

dscho
Copy link
Member

@dscho dscho commented Feb 18, 2025

There are quite a few packages (and files that are not even owned by any package) that should be dropped from git-sdk-arm64. This PR does that. It closely imitates git-for-windows#96.

This closes #27.

  $ pacman -Rns $(pacman -Qmq)
  checking dependencies...

  Packages (7) automake1.10-1.10.3-5  automake1.6-1.6.3-4
               automake1.7-1.7.9-4  automake1.8-1.8.5-5  automake1.9-1.9.6-4
               crypt-1.4-1  libcrypt-2.1-5

  Total Removed Size:  5.39 MiB

  :: Do you want to remove these packages? [Y/n] y
  :: Running pre-transaction hooks...
  (1/1) Removing old entries from the info directory file...
  :: Processing package changes...
  (1/7) removing crypt                               [################] 100%
  (2/7) removing libcrypt                            [################] 100%
  (3/7) removing automake1.9                         [################] 100%
  (4/7) removing automake1.8                         [################] 100%
  (5/7) removing automake1.7                         [################] 100%
  (6/7) removing automake1.6                         [################] 100%
  (7/7) removing automake1.10                        [################] 100%

This commit imitates
git-for-windows@327913e2d18c

Signed-off-by: Johannes Schindelin <[email protected]>
This trick was performed by:

  git -C / rm \
    $(comm -23 \
      <(git -C / ls-files usr/bin/\* |
        sort) \
      <(git -C /var /lib/pacman/local/ grep ^usr/bin/ \*/files |
        sed -n 's,^.*:\(.*[^/]\)$,\1,p' |
	sort))

and imitates
git-for-windows@e076b11ab107

Signed-off-by: Johannes Schindelin <[email protected]>
In `git-sdk-arm64`, there is little sense keeping these files around:
They target a completely different CPU architecture.

It looks like those files slipped through the cracks of 5f8de1d
(Remove all mingw64 packages through pacman, 2022-12-19) and of
c894534 (Remove all mingw32 packages through pacman, 2022-12-19).

`pacman -R` would have missed those because:

* I specifically retained some obsolete OpenSSL/libidn2 files (to allow
  an orderly upgrade to a newer versions that produce DLLs with
  different names, which would have broken git fetch and curl in the CI
  builds). However, I thought I had dropped these files in
  git-for-windows/build-extra@27f8403584 (Drop old OpenSSL and LibIDN2
  files, 2020-01-09). I guess I should have checked...  they're still
  there, even in `git-sdk-64` and `git-sdk-32`...

* The way I had originally installed `asciidoctor` with the extensions
  that Git still required back then was really hacky: calling `gem
  install` in the `pre_install` function of the
  `mingw-w64-asciidoctor-extensions` package (for details, see
  git-for-windows/MINGW-packages' 728e0fe8d1 (asciidoctor: bundle
  requirements to build git doc, 2015-04-14)), and of course I had not
  thought of adding a corresponding `post_remove` function...

Since we no longer install those now-obsolete packages, it should be
safe to delete them and they shouldn't come back just like that.

This trick was performed by:

  f() {
    comm -23 \
      <(git -C / ls-files $1\* |
        sort) \
      <(git -C /var/lib/pacman/local/ grep ^$1 \*/files |
        sed -n 's,^.*:\(.*[^/]\)$,\1,p' |
        sort)
    }
    f mingw |
    xargs -d '\n' -r git -C / rm

Signed-off-by: Johannes Schindelin <[email protected]>
@dscho dscho self-assigned this Feb 18, 2025
@dscho
Copy link
Member Author

dscho commented Feb 18, 2025

Just like in the sibling PR, I started a git-artifacts run manually, to verify that this is all safe and sound to merge.

jeremyd2019 added a commit to jeremyd2019/git-sdk-64 that referenced this pull request Feb 18, 2025
This repeats the exercise from git-for-windows#35, but
excludes a few files that might actually be relevant:

This trick was performed by:

  f() {
    comm -23 \
      <(git -C / ls-files $1\* |
        sort) \
      <(git -C /var/lib/pacman/local/ grep ^$1 \*/files |
        sed -n 's,^.*:\(.*[^/]\)$,\1,p' |
        sort)
  }
  f mingw |
  xargs -d '\n' -r git -C / rm

  git restore --staged mingw32/etc mingw64/etc mingw64/share mingw64/var

Signed-off-by: Jeremy Drake <[email protected]>
jeremyd2019 added a commit to jeremyd2019/git-sdk-64 that referenced this pull request Feb 18, 2025
This repeats the exercise from git-for-windows#35, but
excludes a few files that might actually be relevant:

This trick was performed by:

  f() {
    comm -23 \
      <(git -C / ls-files $1\* |
        sort) \
      <(git -C /var/lib/pacman/local/ grep ^$1 \*/files |
        sed -n 's,^.*:\(.*[^/]\)$,\1,p' |
        sort)
  }
  f mingw |
  xargs -d '\n' -r git -C / rm

  git restore --staged mingw32/etc mingw64/etc mingw64/share mingw64/var

Signed-off-by: Jeremy Drake <[email protected]>
jeremyd2019 added a commit to jeremyd2019/git-sdk-64 that referenced this pull request Feb 18, 2025
This repeats the exercise from git-for-windows#35, but
excludes a few files that might actually be relevant:

This trick was performed by:

  f() {
    comm -23 \
      <(git -C / ls-files $1\* |
        sort) \
      <(git -C /var/lib/pacman/local/ grep ^$1 \*/files |
        sed -n 's,^.*:\(.*[^/]\)$,\1,p' |
        sort)
  }
  f mingw |
  xargs -d '\n' -r git -C / rm

  git restore --staged mingw32/etc/git* mingw64/etc/git* mingw64/share

Signed-off-by: Jeremy Drake <[email protected]>
jeremyd2019 added a commit to jeremyd2019/git-sdk-64 that referenced this pull request Feb 18, 2025
This repeats the exercise from git-for-windows#35, but
excludes a few files that might actually be relevant:

This trick was performed by:

  f() {
    comm -23 \
      <(git -C / ls-files $1\* |
        sort) \
      <(git -C /var/lib/pacman/local/ grep ^$1 \*/files |
        sed -n 's,^.*:\(.*[^/]\)$,\1,p' |
        sort)
  }
  f mingw |
  xargs -d '\n' -r git -C / rm

  git restore --staged mingw32/etc/git* mingw64/etc/git* mingw64/share

Signed-off-by: Jeremy Drake <[email protected]>
jeremyd2019 added a commit to jeremyd2019/git-sdk-64 that referenced this pull request Feb 18, 2025
This repeats the exercise from git-for-windows#35

This trick was performed by:

  f() {
    comm -23 \
      <(git -C / ls-files $1\* |
        sort) \
      <(git -C /var/lib/pacman/local/ grep ^$1 \*/files |
        sed -n 's,^.*:\(.*[^/]\)$,\1,p' |
        sort)
  }
  f mingw |
  xargs -d '\n' -r git -C / rm

Signed-off-by: Jeremy Drake <[email protected]>
jeremyd2019 added a commit to git-for-windows/git-sdk-32 that referenced this pull request Feb 20, 2025
This repeats the exercise from git-for-windows/git-sdk-arm64#35

This trick was performed by:

  f() {
    comm -23 \
      <(git -C / ls-files $1\* |
        sort) \
      <(git -C /var/lib/pacman/local/ grep ^$1 \*/files |
        sed -n 's,^.*:\(.*[^/]\)$,\1,p' |
        sort)
  }
  f usr/bin |
  xargs -d '\n' -r git -C / rm
  f mingw |
  xargs -d '\n' -r git -C / rm

Signed-off-by: Jeremy Drake <[email protected]>
@dscho
Copy link
Member Author

dscho commented Feb 21, 2025

This run failed, in the same way, and we're tracking the issue in #36.

@dscho dscho marked this pull request as ready for review February 24, 2025 18:50
@dscho dscho merged commit c50cbb4 into main Feb 24, 2025
5 checks passed
@dscho dscho deleted the remove-orphaned-packages branch February 24, 2025 18:50
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

Successfully merging this pull request may close these issues.

Remove unwanted /mingw32/ and /mingw64/
1 participant