Bug 254293 - net/cloudflared: could not determine kind of name for C.BrotliDecoderSetCustomDictionary
Summary: net/cloudflared: could not determine kind of name for C.BrotliDecoderSetCusto...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Vinícius Zavam
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-15 01:24 UTC by orzodk
Modified: 2021-06-24 21:27 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description orzodk 2021-03-15 01:24:15 UTC
I am unable to build the net/cloudflared port.

This may be an upstream bug but nobody has reported it as an issue.

```
# uname -a
FreeBSD ox 12.2-RELEASE-p3 FreeBSD 12.2-RELEASE-p3 7851f4a452d(HEAD) TRUENAS  amd64

# go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="freebsd"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/freebsd_amd64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build408488873=/tmp/go-build -gno-record-gcc-switches"

# make install
===>  Building for cloudflared-2020.11.11
(cd /usr/ports/net/cloudflared/work/cloudflared-2020.11.11;  for t in github.com/cloudflare/cloudflared/cmd/cloudflared; do  out=$(/usr/bin/basename $(echo ${t} |  /usr/bin/sed -Ee 's/^[^:]*:([^:]+).*$/\1/' -e 's/^\.$/cloudflared/'));  pkg=$(echo ${t} |  /usr/bin/sed -Ee 's/^([^:]*).*$/\1/' -e 's/^cloudflared$/./');  echo "===>  Building ${out} from ${pkg}";  /usr/bin/env XDG_DATA_HOME=/usr/ports/net/cloudflared/work  XDG_CONFIG_HOME=/usr/ports/net/cloudflared/work  HOME=/usr/ports/net/cloudflared/work PATH=/usr/ports/net/cloudflared/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" CGO_ENABLED=1  CGO_CFLAGS="-I/usr/local/include"  CGO_LDFLAGS="-L/usr/local/lib"  GOARM= GOPATH="/usr/ports/distfiles/go/net_cloudflared"  GOBIN="/usr/ports/net/cloudflared/work/bin"  GO111MODULE=on  GOFLAGS=-modcacherw  GOSUMDB=sum.golang.org GO_NO_VENDOR_CHECKS=1 GOPROXY=off /usr/local/bin/go build -ldflags '-s -w -X main.Version=2020.11.11' -v -buildmode=exe -mod=vendor  -o /usr/ports/net/cloudflared/work/bin/${out}  ${pkg};  done)
===>  Building cloudflared from github.com/cloudflare/cloudflared/cmd/cloudflared
github.com/cloudflare/brotli-go
# github.com/cloudflare/brotli-go
vendor/github.com/cloudflare/brotli-go/reader.go:79:2: could not determine kind of name for C.BrotliDecoderSetCustomDictionary
*** Error code 2

Stop.
make: stopped in /usr/ports/net/cloudflared
```
Comment 1 commit-hook freebsd_committer 2021-03-26 20:47:26 UTC
A commit references this bug:

Author: egypcio
Date: Fri Mar 26 20:47:22 UTC 2021
New revision: 569269
URL: https://svnweb.freebsd.org/changeset/ports/569269

Log:
  net/cloudflared: update 2020.11.11 to 2021.3.2

    - github.com/cloudflare/cloudflared/blob/2021.3.2/RELEASE_NOTES

  PR:		254293
  Reported by:	orzodk % neomailbox.net

Changes:
  head/net/cloudflared/Makefile
  head/net/cloudflared/distinfo
Comment 2 Boris Polujin 2021-04-18 21:04:37 UTC
I got the same issue, with FreeBSD 13


13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 04:24:09 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64



GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="freebsd"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/freebsd_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build540740794=/tmp/go-build -gno-record-gcc-switches"



===>  Building for cloudflared-2021.4.0
(cd /usr/ports/net/cloudflared/work/cloudflared-2021.4.0;  for t in github.com/cloudflare/cloudflared/cmd/cloudflared; do  out=$(/usr/bin/basename $(echo ${t} |  /usr/bin/sed -Ee 's/^[^:]*:([^:]+).*$/\1/' -e 's/^\.$/cloudflared/'));  pkg=$(echo ${t} |  /usr/bin/sed -Ee 's/^([^:]*).*$/\1/' -e 's/^cloudflared$/./');  echo "===>  Building ${out} from ${pkg}";  /usr/bin/env XDG_DATA_HOME=/usr/ports/net/cloudflared/work  XDG_CONFIG_HOME=/usr/ports/net/cloudflared/work  HOME=/usr/ports/net/cloudflared/work PATH=/usr/ports/net/cloudflared/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" CGO_ENABLED=1  CGO_CFLAGS="-I/usr/local/include"  CGO_LDFLAGS="-L/usr/local/lib"  GOARM= GOPATH="/usr/ports/distfiles/go/net_cloudflared"  GOBIN="/usr/ports/net/cloudflared/work/bin"  GO111MODULE=on  GOFLAGS=-modcacherw  GOSUMDB=sum.golang.org GO_NO_VENDOR_CHECKS=1 GOPROXY=off /usr/local/bin/go build -ldflags '-s -w -X main.Version=2021.4.0' -v -buildmode=exe -mod=vendor  -o /usr/ports/net/cloudflared/work/bin/${out}  ${pkg};  done)
===>  Building cloudflared from github.com/cloudflare/cloudflared/cmd/cloudflared
github.com/cloudflare/brotli-go
# github.com/cloudflare/brotli-go
vendor/github.com/cloudflare/brotli-go/reader.go:79:2: could not determine kind of name for C.BrotliDecoderSetCustomDictionary
*** Error code 2
Comment 3 Boris Polujin 2021-04-19 05:33:12 UTC
So, comparing this:
https://github.com/cloudflare/brotli-go/blob/master/reader.go

and THIS:
https://github.com/google/brotli/blob/master/go/cbrotli/reader.go

it is clear that this C.BrotliDecoderSetCustomDictionary function does not exist anymore in the newer version.

So, I don't understand how others are getting this to build, maybe i'm missing something...

Does cloudflared even require this SetDictionary ( C.BrotliDecoderSetCustomDictionary ) function?
Comment 4 Boris Polujin 2021-04-22 19:35:37 UTC
Anyways, this seems to me like an issue upstream so I opened a bug report there:

https://github.com/cloudflare/cloudflared/issues/361
Comment 5 orzodk 2021-06-24 21:19:49 UTC
Finally got my hardware back to test again. I'm still getting the error and it doesn't seem related to just FreeBSD 13.0. This is a fresh 12.2 jail on TrueNAS 12.0-U4


$ uname -a
FreeBSD ox 12.2-RELEASE-p6 FreeBSD 12.2-RELEASE-p6 df578562304(HEAD) TRUENAS  amd64



$ sudo make install
Password:
===>  Building for cloudflared-2021.4.0
(cd /usr/ports/net/cloudflared/work/cloudflared-2021.4.0;  for t in github.com/cloudflare/cloudflared/cmd/cloudflared; do  out=$(/usr/bin/basename $(echo ${t} |  /usr/bin/sed -Ee 's/^[^:]*:([^:]+).*$/\1/' -e 's/^\.$/cloudflared/'));  pkg=$(echo ${t} |  /usr/bin/sed -Ee 's/^([^:]*).*$/\1/' -e 's/^cloudflared$/./');  echo "===>  Building ${out} from ${pkg}";  /usr/bin/env XDG_DATA_HOME=/usr/ports/net/cloudflared/work  XDG_CONFIG_HOME=/usr/ports/net/cloudflared/work  HOME=/usr/ports/net/cloudflared/work PATH=/usr/ports/net/cloudflared/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" CGO_ENABLED=1  CGO_CFLAGS="-I/usr/local/include"  CGO_LDFLAGS="-L/usr/local/lib"  GOARM= GOPATH="/usr/ports/distfiles/go/net_cloudflared"  GOBIN="/usr/ports/net/cloudflared/work/bin"  GO111MODULE=on  GOFLAGS=-modcacherw  GOSUMDB=sum.golang.org GO_NO_VENDOR_CHECKS=1 GOPROXY=off /usr/local/bin/go build -ldflags '-s -w -X main.Version=2021.4.0' -v -buildmode=exe -trimpath -mod=vendor  -o /usr/ports/net/cloudflared/work/bin/${out}  ${pkg};  done)
===>  Building cloudflared from github.com/cloudflare/cloudflared/cmd/cloudflared
github.com/cloudflare/brotli-go
# github.com/cloudflare/brotli-go
vendor/github.com/cloudflare/brotli-go/reader.go:79:2: could not determine kind of name for C.BrotliDecoderSetCustomDictionary
*** Error code 2

Stop.
make: stopped in /usr/ports/net/cloudflared
Comment 6 orzodk 2021-06-24 21:27:01 UTC
And for the record, upgrading to the latest version doesn't solve the issue:

$ sudo make install
===>  Building for cloudflared-2021.6.0
(cd /usr/ports/net/cloudflared/work/cloudflared-2021.6.0;  for t in github.com/cloudflare/cloudflared/cmd/cloudflared; do  out=$(/usr/bin/basename $(echo ${t} |  /usr/bin/sed -Ee 's/^[^:]*:([^:]+).*$/\1/' -e 's/^\.$/cloudflared/'));  pkg=$(echo ${t} |  /usr/bin/sed -Ee 's/^([^:]*).*$/\1/' -e 's/^cloudflared$/./');  echo "===>  Building ${out} from ${pkg}";  /usr/bin/env XDG_DATA_HOME=/usr/ports/net/cloudflared/work  XDG_CONFIG_HOME=/usr/ports/net/cloudflared/work  HOME=/usr/ports/net/cloudflared/work PATH=/usr/ports/net/cloudflared/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS=""  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" CGO_ENABLED=1  CGO_CFLAGS="-I/usr/local/include"  CGO_LDFLAGS="-L/usr/local/lib"  GOARM= GOPATH="/usr/ports/distfiles/go/net_cloudflared"  GOBIN="/usr/ports/net/cloudflared/work/bin"  GO111MODULE=on  GOFLAGS=-modcacherw  GOSUMDB=sum.golang.org GO_NO_VENDOR_CHECKS=1 GOPROXY=off /usr/local/bin/go build -ldflags '-s -w -X main.Version=2021.6.0' -v -buildmode=exe -trimpath -mod=vendor  -o /usr/ports/net/cloudflared/work/bin/${out}  ${pkg};  done)
===>  Building cloudflared from github.com/cloudflare/cloudflared/cmd/cloudflared
github.com/cloudflare/brotli-go
# github.com/cloudflare/brotli-go
vendor/github.com/cloudflare/brotli-go/reader.go:79:2: could not determine kind of name for C.BrotliDecoderSetCustomDictionary
*** Error code 2

Stop.
make: stopped in /usr/ports/net/cloudflared