Bug 272524 - www/squid: Update to 6.1
Summary: www/squid: Update to 6.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Robert Clausecker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-15 22:07 UTC by Joshua Kinard
Modified: 2023-10-26 12:56 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (timp87)


Attachments
Patch to update port to squid-6.1 (97.82 KB, application/mbox)
2023-07-15 22:07 UTC, Joshua Kinard
no flags Details
Patch to update port to squid-6.3 (98.63 KB, patch)
2023-09-23 02:34 UTC, Joshua Kinard
no flags Details | Diff
port patch from maintainer (98.61 KB, patch)
2023-10-09 04:44 UTC, Pavel Timofeev
timp87: maintainer-approval+
Details | Diff
port patch 2 from maintainer (98.55 KB, patch)
2023-10-09 04:48 UTC, Pavel Timofeev
timp87: maintainer-approval+
Details | Diff
port patch 3 from maintainer (99.23 KB, patch)
2023-10-09 17:06 UTC, Pavel Timofeev
timp87: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Kinard 2023-07-15 22:07:56 UTC
Created attachment 243412 [details]
Patch to update port to squid-6.1

Adding a patch that does the bulk of the work to upgrade www/squid for the recently-released version 6.1, but it probably needs some more massaging before being committed.  I am not 100% confident in how I regenerated pkg-plist, because I could not work out the errors/xx-yy/* files that don't seem to be installed by squid by default, so it only includes the errors/templates/* files.  Advice on how to get pkg-plist to capture everything would be great.

But I think I got most everything else.  Updated most of the patches, and had to add a new patch for src/base/RandomUuid.cc to add an "#include <arpa/inet.h>" so that references to htonl/htons/ntohl/ntohs are handled.  Also would like extra eyeballs on the change in configure options between squid-5.9 and 6.1.  LDAP got a new --without-ldap flag, so I *think* I have that handled right, and several other --enable flags changed to --disable, so I assumed that meant they are now enabled by default.  Also added a new (I think?) flag, --enable-arch-native, to the configure args that Makefile passes.

Compile test works using my specific set options, but I did not try to rebuild the port with a variety of other options.  Upgrading my squid jail and restarting it was seamless.  I am sure there are changes I should do to my squid configuration, but those are outside the scope of updating the port.
Comment 1 Pavel Timofeev 2023-07-17 14:24:43 UTC
Thank you for your contribution!
I have squid-6x in my private repo.
So I'll merge your job and provide a patch this week.
Comment 2 Joshua Kinard 2023-07-19 15:51:51 UTC
(In reply to Pavel Timofeev from comment #1)

No problem!  The 6.1 pkg produced by my attempt seems to generally work well, so it seems like a straight-forward update.  I still get periodic "Bug: Missing MemObject::storeId value" entries in cache.log, but upstream seems to have not yet found a cause and fix for that.  I think it's being tracked under Squid Bug #4527:
https://bugs.squid-cache.org/show_bug.cgi?id=4527

I would also look at Squid Bug #5451 and see if any of the commits identified in GH PR#947 or #1421 may be worth applying to the 6.1 port as well.  I'm the originator for #5451 cause I was having issues w/ Squid attempting to use IPv6 addresses returned in DNS AAAA records over their IPv4 equivalents, so I disabled IPv6 support in Squid, and that led to the discovery of that assertion being hit, which started writing out pretty huge core files.

https://bugs.squid-cache.org/show_bug.cgi?id=5154
https://github.com/squid-cache/squid/pull/947
https://github.com/squid-cache/squid/pull/1421
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2023-09-22 15:35:04 UTC
(In reply to Pavel Timofeev from comment #1)

Any progress on this?  If not, I'll go ahead and commit Joshua's patch soon.
Comment 4 Joshua Kinard 2023-09-23 01:20:22 UTC
(In reply to Robert Clausecker from comment #3)

Note that my patch is somewhat incomplete, as the pkg-plist does not contain all of the error page translations in the proper order.  Not really sure how to get it to do that, as squid-6.x has moved some things around and there's not a whole lot of guidance I can find on those plist files.

The current upstream release is also 6.3, so I need to re-roll the patch, as I think I had to tweak one of the squid patches in my local setup.  I'll do that shortly, but I think Pavel will still have to fix the pkg-plist file up to be correct, before this gets added to ports.
Comment 5 Pavel Timofeev 2023-09-23 01:26:18 UTC
I promise to provide the patch this weekend
Comment 6 Robert Clausecker freebsd_committer freebsd_triage 2023-09-23 02:18:33 UTC
(In reply to Joshua Kinard from comment #4)

Usually you make the port install all the files it should install, and then you run "make makeplist" to generate a pkg-plist.  Review the plist generated and add @... commands as necessary.

@Pavel great!
Comment 7 Joshua Kinard 2023-09-23 02:34:39 UTC
Created attachment 245134 [details]
Patch to update port to squid-6.3

(In reply to Robert Clausecker from comment #6)
Yup, I worked that much out.  I wasn't sure how Pavel got the additional translations in if they weren't installed.  Assumed there was some trick somewhere that I was missing.

Attaching an updated patch for squid-6.3.  Like the earlier one, the pkg-plist needs some fixups, but this gets most of the way there.
Comment 8 Robert Clausecker freebsd_committer freebsd_triage 2023-10-02 17:41:45 UTC
(In reply to Pavel Timofeev from comment #5)

So... that was a long weekend.  Any progress?
Comment 9 Pavel Timofeev 2023-10-02 19:14:44 UTC
Sorry, having hard time being on-call at job.
Working on it now.
Comment 10 Robert Clausecker freebsd_committer freebsd_triage 2023-10-07 03:26:22 UTC
(In reply to Joshua Kinard from comment #7)

Are you able to complete your patch?  I am not certain that we'll see anything from the maintainer any time soon.
Comment 11 Joshua Kinard 2023-10-07 04:38:55 UTC
(In reply to Robert Clausecker from comment #10)
I'll see if I can find some time this weekend to take another look at doing the plist file correctly.  Probably just need to stare at it a bit longer and then it'll "click".
Comment 12 Pavel Timofeev 2023-10-09 04:44:49 UTC
Created attachment 245516 [details]
port patch from maintainer

- update to 6.3
- modernize a few options handling
- remove configure args which are default now
Comment 13 Pavel Timofeev 2023-10-09 04:48:47 UTC
Created attachment 245517 [details]
port patch 2 from maintainer

- reorder a few things and remove useless comment
Comment 14 Joshua Kinard 2023-10-09 08:36:15 UTC
(In reply to Pavel Timofeev from comment #13)
This works good on my end so far.  It does look like Squid-6.x no longer installs all of those error translations for some reason.  Not sure if that's a fluke in their code or not.
Comment 15 Pavel Timofeev 2023-10-09 14:38:55 UTC
There is option --enable-translation to enable it back. It's off by default now.
But as far as I understand they want you to use translation files separately.
There is www/squid-langpack port for that, maintained by someone else.

BTW, I noticed patch-src_ip_Address.cc patch you provided. Can you describe it?
Comment 16 Pavel Timofeev 2023-10-09 14:52:51 UTC
Hmm, I just thought that it makes sense to update pkg-message with the info about translation. What do you think?
Comment 17 Robert Clausecker freebsd_committer freebsd_triage 2023-10-09 16:43:04 UTC
Patch appears reasonable, thank you for getting around to write it.

Could you link to the changelog(s) for the update so I can include it/them in the commit message?

> Hmm, I just thought that it makes sense to update pkg-message with the info about translation. What do you think?

It's okay.  You could have also added e.g. an NLS option that adds the error messages port as a dependency and amends the sample configuration file to point to it, but this way is good enough.
Comment 19 Pavel Timofeev 2023-10-09 17:06:09 UTC
Created attachment 245532 [details]
port patch 3 from maintainer

Added pkg-message entry for translated error messages
Comment 20 Joshua Kinard 2023-10-09 17:22:10 UTC
(In reply to Pavel Timofeev from comment #15)
> 
> BTW, I noticed patch-src_ip_Address.cc patch you provided. Can you describe it?
> 

I honestly forgot about that one.  It's a proposed fix from Alex Rousskov on a Squid bug I filed back in 2021 regarding Squid's handling of IPv6 and IPv4 when both are seemingly available on a network:
https://bugs.squid-cache.org/show_bug.cgi?id=5154
https://github.com/squid-cache/squid/pull/1421/commits/a3b22cced0339be9348d70dd8c6b502399d06bcb

Squid got rid of the 'dns_v4_first' option a while back, so it favors IPv6 AAAA records coming back in DNS over IPv4 A records when determining which one to use.  The bug above was citing a case of some daffy logic handling over this, which when combined with my local Unbound resolver returning 0.0.0.0 addressing for blocked domains (in 2021; I use RPZ now), was triggering a crash in a squid kid, which in turn caused Squid to simply refuse to connect to the site.  Fun one to chase down.

Technically still unresolved, and that patch is based off the latest upstream pull request to fix it, but it hasn't been approved yet.  You can ignore it in this case.  I'll need to keep better notes to not let experimental patches slip in again next time.
Comment 21 Pavel Timofeev 2023-10-10 03:44:43 UTC
(In reply to Joshua Kinard from comment #20)
Thanks a lot for the explanation!
Comment 22 commit-hook freebsd_committer freebsd_triage 2023-10-11 06:05:29 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=53134607143382ef9029f30acd586d53183efc39

commit 53134607143382ef9029f30acd586d53183efc39
Author:     Pavel Timofeev <timp87@gmail.com>
AuthorDate: 2023-10-09 17:05:14 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-10-11 06:04:38 +0000

    www/squid: update to 6.3

    Error message translation files are now part of www/squid-langpack.

    Changelog: http://www.squid-cache.org/Versions/v6/squid-6.3-RELEASENOTES.html

    PR:             272524

 www/squid/Makefile                                 |   53 +-
 www/squid/distinfo                                 |    6 +-
 www/squid/files/patch-compat_shm.cc                |    4 +-
 www/squid/files/patch-configure                    |   15 +-
 www/squid/files/patch-include_squid.h              |    4 +-
 www/squid/files/patch-src-cf.data.pre              |    4 +-
 .../files/patch-src_DiskIO_Mmapped_MmappedFile.cc  |    6 +-
 www/squid/files/patch-src_base_RandomUuid.cc (new) |   10 +
 www/squid/files/patch-src_ip_Intercept.cc          |    6 +-
 www/squid/files/patch-src_ipc_mem_Segment.cc       |    9 +-
 www/squid/files/patch-src_tools.cc                 |    4 +-
 www/squid/files/pkg-message.in                     |    3 +
 www/squid/pkg-plist                                | 2121 +-------------------
 13 files changed, 76 insertions(+), 2169 deletions(-)
Comment 23 Robert Clausecker freebsd_committer freebsd_triage 2023-10-11 06:12:19 UTC
Thank you for your contribution.
Comment 24 commit-hook freebsd_committer freebsd_triage 2023-10-26 12:56:32 UTC
A commit in branch 2023Q4 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=88b1e50105abae8c3b0cedec0edc3b0d55e99991

commit 88b1e50105abae8c3b0cedec0edc3b0d55e99991
Author:     Pavel Timofeev <timp87@gmail.com>
AuthorDate: 2023-10-09 17:05:14 +0000
Commit:     Joel Bodenmann <jbo@FreeBSD.org>
CommitDate: 2023-10-26 12:43:10 +0000

    www/squid: update to 6.3

    Error message translation files are now part of www/squid-langpack.

    Changelog: http://www.squid-cache.org/Versions/v6/squid-6.3-RELEASENOTES.html

    PR:             272524
    (cherry picked from commit 53134607143382ef9029f30acd586d53183efc39)

 www/squid/Makefile                                 |   53 +-
 www/squid/distinfo                                 |    6 +-
 www/squid/files/patch-compat_shm.cc                |    4 +-
 www/squid/files/patch-configure                    |   15 +-
 www/squid/files/patch-include_squid.h              |    4 +-
 www/squid/files/patch-src-cf.data.pre              |    4 +-
 .../files/patch-src_DiskIO_Mmapped_MmappedFile.cc  |    6 +-
 www/squid/files/patch-src_base_RandomUuid.cc (new) |   10 +
 www/squid/files/patch-src_ip_Intercept.cc          |    6 +-
 www/squid/files/patch-src_ipc_mem_Segment.cc       |    9 +-
 www/squid/files/patch-src_tools.cc                 |    4 +-
 www/squid/files/pkg-message.in                     |    3 +
 www/squid/pkg-plist                                | 2121 +-------------------
 13 files changed, 76 insertions(+), 2169 deletions(-)