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

[BSD] ctestenums.cc:2:48: fatal error: webrtc/api/peerconnectioninterface.h: No such file or directory #76

Open
anadahz opened this issue Mar 25, 2018 · 4 comments

Comments

@anadahz
Copy link

anadahz commented Mar 25, 2018

Why I'm here: go-webrtc is a snowflake dependency

go get github.com/keroserene/go-webrtc results in

ctestenums.cc:2:48: fatal error: webrtc/api/peerconnectioninterface.h: No such file or directory
compilation terminated.

% go env

go env
GOARCH="amd64"
GOBIN="/home/user/go/bin"
GOCACHE="/home/user/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="dragonfly"
GOOS="dragonfly"
GOPATH="/home/user/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/dragonfly_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build032258926=/tmp/go-build -gno-record-gcc-switches"

Happy to provide any required details in order to help resolve this issue.

@uumaro
Copy link
Collaborator

uumaro commented Mar 26, 2018

Note that this is an attempt to build on BSD (GOOS="dragonfly").

The immediate cause is that the build is missing the -I option to include the files in the include directory.

That's because the -I option comes from webrtc-darwin-amd64.pc, webrtc-linux-386.pc, webrtc-linux-amd64.pc, or webrtc-linux-arm.pc. There isn't one yet for BSD.

You could try making a new file webrtc-dragonfly-amd64.pc containing the necessary flags. (-I${pc}/include is the crucial one for including the proper headers.) You may have to also add a new #cgo line to certain .go files, like here.

But then there will still be a problem, because there's no precompiled library for BSD in the lib directory. go-webrtc is an interface to a massive underlying C++ library. So the build will fail at the linking stage. Until we have a prebuilt library for BSD, you will have to compile the webrtc library yourself, and unfortunately it's a little involved. See build.sh and the "hard way" of README#Building. I don't know if anyone has tried building the library on BSD yet.

@anadahz anadahz changed the title ctestenums.cc:2:48: fatal error: webrtc/api/peerconnectioninterface.h: No such file or directory [BSD] ctestenums.cc:2:48: fatal error: webrtc/api/peerconnectioninterface.h: No such file or directory Mar 26, 2018
@anadahz
Copy link
Author

anadahz commented Mar 26, 2018

@uumaro Thanks for your response.

I can try build go-webrtc in BSD but it seems that are many dependencies and things that may go wrong.
Is there any related BSD go build script were I can start from?

@uumaro
Copy link
Collaborator

uumaro commented Mar 26, 2018

It's not the Go part of go-webrtc that's difficult to build. It's the WebRTC native code library that's big. (It's not really difficult to build, just huge (source code is ~9 GB).) You can try making some minor modifications to build.sh and see if it works, but I suspect you would be the first one to try it. Unfortunately, https://webrtc.org/native-code/development/ says "The currently supported platforms are Windows, Mac OS X, Linux, Android and iOS."

It may work on BSD anyway; for example we are cross-compiling linux→mac for Tor Browser, which isn't a supported configuration. But it took some patches to make it work.

@anadahz
Copy link
Author

anadahz commented Mar 28, 2018

@uumaro great thanks for the guidelines.
@egypcio is working on a freebsd port of snowflake.

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

2 participants