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

net-proxy/squid: add workaround for 4.x to 5.x upgrade #29138

Closed
wants to merge 1 commit into from

Conversation

floppym
Copy link
Contributor

@floppym floppym commented Jan 16, 2023

Move /usr/share/squid/errors out of the way to avoid triggering an error from Portage when replacing symlinks with directories.

We must do this in pkg_setup because the Portage safety check runs before pkg_preinst.

Closes: https://bugs.gentoo.org/834503

Move /usr/share/squid/errors out of the way to avoid triggering an
error from Portage when replacing symlinks with directories.

We must do this in pkg_setup because the Portage safety check runs
before pkg_preinst.

Closes: https://bugs.gentoo.org/834503
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
@gentoo-bot
Copy link

Pull Request assignment

Submitter: @floppym
Areas affected: ebuilds
Packages affected: net-proxy/squid

net-proxy/squid: @hlein, @gentoo/proxy-maint

Linked bugs

Bugs linked: 834503


In order to force reassignment and/or bug reference scan, please append [please reassign] to the pull request title.

Docs: Code of ConductCopyright policy (expl.) ● DevmanualGitHub PRsProxy-maint guide

@gentoo-bot gentoo-bot added assigned PR successfully assigned to the package maintainer(s). bug linked Bug/Closes found in footer, and cross-linked with the PR. labels Jan 16, 2023
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull request CI report

Report generated at: 2023-01-16 20:28 UTC
Newest commit scanned: e00432a
Status: ✅ good

There are existing issues already. Please look into the report to make sure none of them affect the packages in question:
https://qa-reports.gentoo.org/output/gentoo-ci/ce9f0b889e/output.html

@floppym floppym closed this Jan 16, 2023
@floppym floppym deleted the bug834503-squid-upgrade branch January 16, 2023 20:29
@hlein
Copy link
Contributor

hlein commented Jan 16, 2023

Move /usr/share/squid/errors out of the way to avoid triggering an error from Portage when replacing symlinks with directories.

We must do this in pkg_setup because the Portage safety check runs before pkg_preinst.

I like this, but I also worry: doesn't this mean that before src_* begin, we will have already removed the link that a (presumably currently running) squid expects? So for instance if src_compile fails, we'll be left with the currently installed & running squid not being able to find its errors where it expects them?

If I'm right to worry, @zmedico proposed an alternative: https://bugs.gentoo.org/664940#c3

Basically... rename to a temp name in src_*, which will satisfy the safety check, and then in pkg_preinst, remove old && rename new. That way we make no changes to the real system until we have a built copy ready to install.

@thesamesam
Copy link
Member

thesamesam commented Jan 16, 2023

I think your concern is valid - I wouldn't worry about it too much given the situation we're in anyway if we couldn't think of a solution, but you've posed one that sounds workable. We can rename in just src_install (so it's as late as possible).

I'm happy to implement that change if @floppym can't see a problem with it.

I'm wondering why I didn't do it before though, but maybe that was just because I'd started looking at adjusting the Portage behaviour..?

@hlein
Copy link
Contributor

hlein commented Jan 16, 2023

I'm wondering why I didn't do it before though, but maybe that was just because I'd started looking at adjusting the Portage behaviour..?

Maybe. "Handle this situation once and for all in the tooling" would be nice. But "have a pattern that can be applied whenever this arises" feels good enough ;)

@floppym
Copy link
Contributor Author

floppym commented Jan 16, 2023

Yeah, the possibility of a build failure is why I renamed the directory in pkg_setup instead of just removing it.

Zac's proposed solution (rename in src_install/pkg_preinst) seems good to me.

@thesamesam
Copy link
Member

Thanks folks, I'll pick that up now.

gentoo-bot pushed a commit that referenced this pull request Jan 18, 2023
Do it in src_install/pkg_preinst/pkg_postinst instead to reduce the window
of fragility (if compile failed before for example, or did "ebuild ... clean configure",
would have a half-migrated state).

Bug: https://bugs.gentoo.org/834503
See: #29138
Signed-off-by: Sam James <sam@gentoo.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned PR successfully assigned to the package maintainer(s). bug linked Bug/Closes found in footer, and cross-linked with the PR.
Projects
None yet
5 participants