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

Avoid usage of github.com/mtrmac/gpgme #5241

Closed
MovieStoreGuy opened this issue Sep 15, 2021 · 3 comments · Fixed by #5430
Closed

Avoid usage of github.com/mtrmac/gpgme #5241

MovieStoreGuy opened this issue Sep 15, 2021 · 3 comments · Fixed by #5430
Labels
bug Something isn't working

Comments

@MovieStoreGuy
Copy link
Contributor

Describe the bug
Trying to compile the otel collector contrib on MacOs fails within missing definitions. Furthermore, depends on cgo and limits ability to create a static binary that can be shipped anywhere.

Steps to reproduce
On an MacOS machine / Windows run make test

What did you expect to see?
make test works without issue.

What did you see instead?

/Users/smarciniak/go/pkg/mod/github.com/mtrmac/[email protected]/data.go:4:11: fatal error: 'gpgme.h' file not found
 #include <gpgme.h>
          ^~~~~~~~~

What version did you use?
Version: main @ 0d78df6

Environment
OS: MacOs 11.6
Compiler(if manually compiled): go 1.17.0

@MovieStoreGuy MovieStoreGuy added the bug Something isn't working label Sep 15, 2021
@mx-psi
Copy link
Member

mx-psi commented Sep 15, 2021

This comes from the Podman receiver.

❯ go mod why github.com/mtrmac/gpgme
# github.com/mtrmac/gpgme
github.com/open-telemetry/opentelemetry-collector-contrib/internal/components
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver
github.com/containers/podman/v3/pkg/bindings/containers
github.com/containers/podman/v3/pkg/api/handlers
github.com/containers/common/libimage
github.com/containers/image/v5/signature
github.com/mtrmac/gpgme

Also, make test is missing CGO_ENABLED=0 on its task definition. @MovieStoreGuy could you try and see if adding CGO_ENABLED=0 to make test fixes this for you?

@owais
Copy link
Contributor

owais commented Sep 15, 2021

Collector itself excludes these dependencies when building as they are not actually needed for the podman receiver.

You can do the same by using the following build tags:

containers_image_openpgp,exclude_graphdriver_btrfs,exclude_graphdriver_devicemapper

Ref: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/Makefile.Common#L21-L22

@MovieStoreGuy
Copy link
Contributor Author

@mx-psi I actually had issues also running make golint and suspected it to be the same issue but present in a different way.

bogdandrutu pushed a commit that referenced this issue Sep 27, 2021
podmanreceiver uses the official Go podman bindings but the bindings
pull in all of the podman codebase and it's dependencies. We are
essentially embedding podman into the collector. This causes a number of
problems both at compile and run time.

This commit ditches the podman library and uses net/http to consume the
podman v3 REST API instead.

Fixes #5244
Fixes #5414
Fixes #5241
Fixes #5245
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants