Bug 248547 (caddy-zstd) - www/caddy: fix build broken by obsolete zstd golang wrapper dependency
Summary: www/caddy: fix build broken by obsolete zstd golang wrapper dependency
Status: Closed FIXED
Alias: caddy-zstd
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Fernando Apesteguía
URL: https://caddyserver.com/v2
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-09 07:35 UTC by Sklad
Modified: 2020-08-10 16:37 UTC (History)
2 users (show)

See Also:
daniel.tihanyi: maintainer-feedback+


Attachments
updates DataDog's zstd golang wrapper to v1.4.5 (1.88 KB, patch)
2020-08-09 07:35 UTC, Sklad
no flags Details | Diff
additional improvements on top of submitter's patch (1.94 KB, patch)
2020-08-09 17:33 UTC, Fernando Apesteguía
daniel.tihanyi: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sklad 2020-08-09 07:35:24 UTC
Created attachment 217103 [details]
updates DataDog's zstd golang wrapper to v1.4.5

In case archivers/zstd is installed, www/caddy port build process detects that fact, and tries to build stale version of Golang wrapper (v1.4.1) around libzstd, which uses incompatible obsolete zstd API. This breaks the build.

Noticed on trying to upgrade Caddy to 2.1.1 (bug #246623)

Switching to latest zstd wrapper release (v1.4.5) fixes the build.
Comment 1 Fernando Apesteguía freebsd_committer 2020-08-09 17:33:04 UTC
Created attachment 217116 [details]
additional improvements on top of submitter's patch
Comment 2 Fernando Apesteguía freebsd_committer 2020-08-09 17:38:09 UTC
Thanks for the report and the PR.

I can confirm the problem:

In file included from vendor/github.com/DataDog/zstd/zstd_stream.go:7:
/usr/local/include/zbuff.h:31:10: error: '../zstd.h' file not found, did you mean 'zstd.h'?
#include "../zstd.h"        /* ZSTD_CStream, ZSTD_DStream, ZSTDLIB_API */
         ^~~~~~~~~~~
         "zstd.h"
1 error generated.

And the patch fixes it in 12.1 amd64. Build tests for other versions/platforms didn't finish yet.

Clearing merge-quaterly since the version in 2020Q3 does not use DataDog:zstd at all.

As a note, please ensure the patch is in "Unix" text format as opposed as "ASCII text, with CRLF line terminators" :-)


I'll wait for the maintainer to provide feedback.
Comment 3 Sklad 2020-08-10 06:36:00 UTC
Thanks for your review. My pleasure to help.

As for CRLF line terminators, I suspect they had been inserted by the browser, and Bugzilla had just passed them on untouched.

I had provided my patch by pasting it into Bugzilla's textarea field, not via file upload.

HTML5 standard mandates compliant web browsers to submit form values containing line endings, forced normalized as CRLF. Looks like Bugzilla needs a small tweak to keep up with the times :)

Until that is sorted, if ever, I'll be using file upload from now on to provide patches via FreeBSD's Bugzilla.

Thanks for your note.
Comment 4 Daniel Tihanyi 2020-08-10 16:00:23 UTC
I could reproduce this issue on my own and this patch indeed solves it.
I'll check upstream if they can use the newer zstd so that we don't need to patch the coming releases.
Comment 5 commit-hook freebsd_committer 2020-08-10 16:36:33 UTC
A commit references this bug:

Author: fernape
Date: Mon Aug 10 16:36:26 UTC 2020
New revision: 544626
URL: https://svnweb.freebsd.org/changeset/ports/544626

Log:
  www/caddy: fix build when archivers/zstd is installed

  www/caddy ships with an obsoleted go wrapper for zstd. We need a newer one or
  the build will fail if archivers/zstd is installed.

  PR:	248547
  Submitted by:	riedre@ya.ru
  Reviewed by:	daniel.tihanyi@tetragir.com (maintainer)

Changes:
  head/www/caddy/Makefile
  head/www/caddy/distinfo
Comment 6 Fernando Apesteguía freebsd_committer 2020-08-10 16:37:15 UTC
Committed,

Thanks to all!