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

Support building on FreeBSD #1674

Open
dveeden opened this issue Jan 26, 2023 · 0 comments
Open

Support building on FreeBSD #1674

dveeden opened this issue Jan 26, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@dveeden
Copy link
Contributor

dveeden commented Jan 26, 2023

Hi,

I tried building confluentinc/cli on FreeBSD 13.1-RELEASE-p3 and found this:

The Makefile is GNU Make specific (not very unusual). The README.md says to use make deps and make build and the Makefile also calls make. Replacing make with gmake in both the README.md and Makefile fixes that. The gmake command is also available on Linux so this should make this more portable without requiring FreeBSD specific things.

For the cgo dependency for rdkafa I needed to do a pkg install librdkafka to get librdkafka 1.9.2.

Then to build I used gmake CGO_CFLAGS=`pkg-config --cflags rdkafka` CGO_LDFLAGS=`pkg-config --libs rdkafka` TAGS='dynamic' build. Afterwards I noticed that building with gmake TAGS='dynamic' build also works, but I'm not sure if that also works for fresh builds.

% go version -m ./dist/confluent_freebsd_amd64_v1/confluent | grep -vw dep
./dist/confluent_freebsd_amd64_v1/confluent: go1.19.5
	path	command-line-arguments
	build	-asmflags=all=-trimpath=/home/dveeden/git
	build	-compiler=gc
	build	-gcflags=all=-trimpath=/home/dveeden/git
	build	-ldflags="-s -w -X main.version=v3.0.0-dirty-dveeden -X main.commit=83072d47 -X main.date=2023-01-26T08:38:18Z"
	build	-tags=dynamic
	build	CGO_ENABLED=1
	build	CGO_CFLAGS=
	build	CGO_CPPFLAGS=
	build	CGO_CXXFLAGS=
	build	CGO_LDFLAGS=
	build	GOARCH=amd64
	build	GOOS=freebsd
	build	GOAMD64=v1
% file ./dist/confluent_freebsd_amd64_v1/confluent
./dist/confluent_freebsd_amd64_v1/confluent: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD 13.1, FreeBSD-style, Go BuildID=nbtGuL4rOvzdWcchfu4k/FWCY7oI7U3W9T22Jk4pU/SjSsSKJdis-nENQXiNjp/mXRzoVc2_k0MVOozlSpq, stripped
% ./dist/confluent_freebsd_amd64_v1/confluent version
confluent - Confluent CLI

Version:     v3.0.0-dirty-dveeden
Git Ref:     83072d47
Build Date:  2023-01-26T08:38:18Z
Go Version:  go1.19.5 (freebsd/amd64)
Development: true

dveeden added a commit to dveeden/confluent-cli that referenced this issue Jan 26, 2023
On many platforms `make` is GNU Make, but not on all. On FreeBSD it isn't. As the `Makefile` is GNU Make specific let's use `gmake` to allow this to work on more platforms.

Issue: confluentinc#1674
@brianstrauch brianstrauch added the enhancement New feature or request label May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants