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

oc fails to build on macOS with "Unknown type name gss_const_name_t" #415

Closed
c3d opened this issue May 12, 2020 · 5 comments
Closed

oc fails to build on macOS with "Unknown type name gss_const_name_t" #415

c3d opened this issue May 12, 2020 · 5 comments

Comments

@c3d
Copy link

c3d commented May 12, 2020

Not sure exactly if I'm doing anything wrong. The same source version builds on Fedora32 without a problem:

%make
go build -mod=vendor -tags 'include_gcs include_oss containers_image_openpgp gssapi' -ldflags "-s -w -X github.com/openshift/oc/pkg/version.versionFromGit="v4.2.0-alpha.0-571-gf415627" -X github.com/openshift/oc/pkg/version.commitFromGit="f415627b3" -X github.com/openshift/oc/pkg/version.gitTreeState="clean" -X github.com/openshift/oc/pkg/version.buildDate="2020-05-12T14:11:00Z" -X k8s.io/component-base/version.gitMajor="1" -X k8s.io/component-base/version.gitMinor="18" -X k8s.io/component-base/version.gitVersion="v1.18.2-0-g52c56ce" -X k8s.io/component-base/version.gitCommit="f415627b3" -X k8s.io/component-base/version.buildDate="2020-05-12T14:10:57Z" -X k8s.io/component-base/version.gitTreeState="clean" -X k8s.io/client-go/pkg/version.gitVersion="v4.2.0-alpha.0-571-gf415627" -X k8s.io/client-go/pkg/version.gitCommit="f415627b3" -X k8s.io/client-go/pkg/version.buildDate="2020-05-12T14:10:57Z" -X k8s.io/client-go/pkg/version.gitTreeState="clean"" github.com/openshift/oc/cmd/oc
# github.com/apcera/gssapi
vendor/github.com/apcera/gssapi/name.go:213:9: could not determine kind of name for C.wrap_gss_canonicalize_name
cgo: 
clang errors for preamble:
vendor/github.com/apcera/gssapi/name.go:90:2: error: unknown type name 'gss_const_name_t'
        gss_const_name_t input_name,
        ^
1 error generated.

make: *** [build] Error 2

@c3d
Copy link
Author

c3d commented May 12, 2020

Go version 1.14.2_1 from Homebrew, if that's relevant. Catalina 10.15.4.

@c3d
Copy link
Author

c3d commented May 12, 2020

Apparently this is a known issue. There seems to be a hack to build some headers, need to manually install them I guess.

#cgo darwin CFLAGS: -I/opt/local/include -I/usr/local/opt/heimdal/include

@c3d
Copy link
Author

c3d commented May 12, 2020

Used brew install heimdal to get the missing headers, and the build works. Closing.

@c3d c3d closed this as completed May 12, 2020
@jwmatthews
Copy link
Member

In addition to installing heimdal, had to explicitly call out the include path:

CGO_CFLAGS="-I/opt/homebrew/opt/heimdal/include" make oc

compiled successfully with above on macos arm64

@kaovilai
Copy link
Member

kaovilai commented Apr 7, 2023

Thanks @jwmatthews !! worked like a charm

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

No branches or pull requests

3 participants