Bug 251040

Summary: textproc/libxml2: Patch size mismatch, fails to build.
Product: Ports & Packages Reporter: David Armstrong <freebsd-bugzillaqarmuxq9>
Component: Individual Port(s)Assignee: freebsd-desktop (Team) <desktop>
Status: Closed FIXED    
Severity: Affects Only Me CC: diizzy, jcfyecrayz, tcberner, zeising
Priority: --- Flags: tcberner: maintainer-feedback+
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
Patch for libxml2
none
Patch for libxml2 v2 none

Description David Armstrong 2020-11-11 10:00:44 UTC
textproc/libxml2

I'd originally incorrectly opened bug under /databases/mariadb105-server: bug #251009

Size mismatch (when fetching from gitlab.gnome.org) or not found (when fetching from distcache.FreeBSD.org) on four of the patches causes failure to build.

0e1a49c8907645d2e155f0d89d4d9895ac5112b5.patch
50f06b3efb638efb0abd95dc62dca05ae67882c2.patch
7ffcd44d7e6c46704f8af0321d9314cd26e0e18a.patch
edc7b6abb0c125eeb888748c334897f60aab0854.patch


Example errors:

=> Attempting to fetch https://gitlab.gnome.org/GNOME/libxml2/commit/0e1a49c8907645d2e155f0d89d4d9895ac5112b5.patch
fetch: https://gitlab.gnome.org/GNOME/libxml2/commit/0e1a49c8907645d2e155f0d89d4d9895ac5112b5.patch: size mismatch: expected 996, actual 994


=> Attempting to fetch https://gitlab.gnome.org/GNOME/libxml2/commit/7ffcd44d7e6c46704f8af0321d9314cd26e0e18a.patch
fetch: https://gitlab.gnome.org/GNOME/libxml2/commit/7ffcd44d7e6c46704f8af0321d9314cd26e0e18a.patch: size mismatch: expected 1015, actual 1013


I was able to temporarily resolve this by manually fetching the versions here (which have the correct hash) and placing them in /usr/ports/distfiles/gnome2/ 
https://mirror.xtom.com/freebsd-ports/distfiles/gnome2/
Comment 1 David Armstrong 2020-11-11 10:01:46 UTC
*** Bug 251009 has been marked as a duplicate of this bug. ***
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2020-11-11 21:39:07 UTC
Created attachment 219575 [details]
Patch for libxml2

Update distinfo due to upstream change in GitLab instance
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2020-11-11 21:40:50 UTC
The cause is index line(s) being generated differently

< index 301c8449..39d92182 100644
---
> index 301c84499..39d92182f 100644
Comment 4 Tobias C. Berner freebsd_committer freebsd_triage 2020-11-12 05:52:15 UTC
Moin moin 

I think it's better to include the files in ${FILESDIR} when coming from gitlab.
Could you update the patch accordingly?

mfg Tobias
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2020-11-16 07:56:55 UTC
Created attachment 219723 [details]
Patch for libxml2 v2

Host patches locally
Comment 6 Niclas Zeising freebsd_committer freebsd_triage 2020-11-16 09:42:34 UTC
Is the gnome gitlab very different from other gitlab instances (for instance, the freedesktop.org one)?

We use this to pull in patches from upstream git repos quite a lot, I'm a bit surprised it doesn't work in this case.

I have no objections to local patches, I'm just curious about the issue.
Comment 7 Daniel Engberg freebsd_committer freebsd_triage 2020-11-16 10:32:13 UTC
They most likely just updated their instance which changed how patches are generated, at least that's my guess.
Comment 8 Daniel Engberg freebsd_committer freebsd_triage 2020-11-30 16:55:11 UTC
Friendly ping :-)
Comment 9 Tobias C. Berner freebsd_committer freebsd_triage 2020-11-30 18:36:27 UTC
Friendly "woah, what happened to week three and four of november" pong :D 


Will commit shortly...
Comment 10 commit-hook freebsd_committer freebsd_triage 2020-11-30 18:45:08 UTC
A commit references this bug:

Author: tcberner
Date: Mon Nov 30 18:45:05 UTC 2020
New revision: 556670
URL: https://svnweb.freebsd.org/changeset/ports/556670

Log:
  textproc/libxml2: ship patches via files/ due to gitlab

  - gitlab has a tendency to change checksum of patches due to metadata changes
  - switch to including the patches in the tree directly instead of using PATCH_FILES

  PR:             251040
  Submitted by:   daniel.engberg.lists@pyret.net
  Reported by:    David Armstrong <bink19th@pm.me>

Changes:
  head/textproc/libxml2/Makefile
  head/textproc/libxml2/files/patch-CVE-2019-20388
  head/textproc/libxml2/files/patch-CVE-2020-24977
  head/textproc/libxml2/files/patch-CVE-2020-7595
  head/textproc/libxml2/files/patch-Python-39-support
Comment 11 Tobias C. Berner freebsd_committer freebsd_triage 2020-11-30 18:45:30 UTC
Committed, and sorry for the wait.
Comment 12 John Hein 2020-12-03 15:06:12 UTC
(In reply to Tobias C. Berner from comment #11)
Was there a change in this that required the PORTREVISION bump?  I'm going to skip building this locally, but I just wanted to confirm I didn't miss anything.
Comment 13 Daniel Engberg freebsd_committer freebsd_triage 2020-12-05 11:07:00 UTC
Hi, 

There's no change that needs a PORTREVISION bump it's just a compilation fix.