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

Fix build without cgo #1182

Merged
merged 1 commit into from
Oct 2, 2018
Merged

Fix build without cgo #1182

merged 1 commit into from
Oct 2, 2018

Conversation

muirdm
Copy link

@muirdm muirdm commented Oct 2, 2018

The github.com/DataDog/zstd library wraps a c library, so it requires
cgo to compile. Add zstd wrapper funcs to sarama and put the zstd
import behind a build flag requiring cgo. Without cgo, the wrapper
funcs return an error saying zstd doesn't work without cgo.

Resolves #1179

The github.com/DataDog/zstd library wraps a c library, so it requires
cgo to compile. Add zstd wrapper funcs to sarama and put the zstd
import behind a build flag requiring cgo. Without cgo, the wrapper
funcs return an error saying zstd doesn't work without cgo.
@bai
Copy link
Contributor

bai commented Oct 2, 2018

Thank you!

cc: @bobrik -- could you please 👀 this one too?

Copy link
Contributor

@bobrik bobrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one minor question.

"errors"
)

var errZstdCgo = errors.New("zstd compression requires building with cgo enabled")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this error be public?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered that, but I didn't think it would be useful (what is the user going to do differently in this case?). If it were public, we would have to maintain it forever to keep backwards compatibility (e.g. even after switching to a pure-go zstd library).

@bai bai merged commit f1aa91b into IBM:master Oct 2, 2018
@Nesze
Copy link

Nesze commented Oct 3, 2018

Thanks for the fix, folks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants