Skip to content

Keg: fix alias and versioned symlink handling.#10327

Merged
MikeMcQuaid merged 2 commits intoHomebrew:masterfrom
MikeMcQuaid:keg-fix-alias-handling
Jan 14, 2021
Merged

Keg: fix alias and versioned symlink handling.#10327
MikeMcQuaid merged 2 commits intoHomebrew:masterfrom
MikeMcQuaid:keg-fix-alias-handling

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

Previously, brew upgrade gcc@10 could get overzealous and remove the LinkedKeg record for gcc@9. This is bad because we then think gcc@9 is unlinked when it is not and it causes a tonne of conflicts when trying to link gcc@9 again.

Instead, fix up the alias and versioned alias cleanup to be more precise and only delete the symlinks that point to the current rack,opt_record or linked_keg_record and unify the logic so it's performed consistently.

While we're here:

  • don't remove_old_aliases every time we try to unlink a directory but just perform it once per unlink operation
  • remove the linked keg record on uninstall

Fixes Homebrew/homebrew-core#68866
Replaces #10312

Previously, `brew upgrade gcc@10` could get overzealous and remove the
`LinkedKeg` record for `gcc@9`. This is bad because we then think
`gcc@9` is unlinked when it is not and it causes a tonne of conflicts
when trying to link `gcc@9` again.

Instead, fix up the alias and versioned alias cleanup to be more
precise and only delete the symlinks that point to the current `rack`,
`opt_record` or `linked_keg_record` and unify the logic so it's
performed consistently.

While we're here:
- don't `remove_old_aliases` every time we try to unlink a directory
  but just perform it once per `unlink` operation
- remove the linked keg record on `uninstall`
@BrewTestBot
Copy link
Copy Markdown
Contributor

Review period will end on 2021-01-15 at 16:04:10 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Jan 14, 2021
@MikeMcQuaid MikeMcQuaid added the critical Critical change which should be shipped as soon as possible. label Jan 14, 2021
@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Jan 14, 2021
@BrewTestBot
Copy link
Copy Markdown
Contributor

Review period skipped due to critical label.

@MikeMcQuaid MikeMcQuaid merged commit e989a0f into Homebrew:master Jan 14, 2021
@MikeMcQuaid MikeMcQuaid deleted the keg-fix-alias-handling branch January 14, 2021 16:58
mgeplf added a commit to BlueBrain/libsonata that referenced this pull request Feb 1, 2021
* the HDF5 bottle uses gcc10; https://formulae.brew.sh/formula/hdf5 so
  we are hit by this: Homebrew/homebrew-core#68866
  sadly, it seems Homebrew/brew#10327 doesn't fix it, so we unlink old
  gcc's manually
mgeplf added a commit to BlueBrain/libsonata that referenced this pull request Feb 2, 2021
* the HDF5 bottle uses gcc10; https://formulae.brew.sh/formula/hdf5 so
  we are hit by this: Homebrew/homebrew-core#68866
  sadly, it seems Homebrew/brew#10327 doesn't fix it, so we unlink old
  gcc's manually
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Feb 14, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Feb 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gcc8 and gcc9 failed to update through brew upgrade

3 participants