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

Can't build with "headless" build tag #738

Open
kori-irrlicht opened this issue Aug 5, 2020 · 2 comments
Open

Can't build with "headless" build tag #738

kori-irrlicht opened this issue Aug 5, 2020 · 2 comments
Labels
Milestone

Comments

@kori-irrlicht
Copy link
Contributor

I tried to build my project with the headless tag, but got the following error:
github.com/!engo!engine/engo@v1.0.5/engo_empty.go:79:4: fallthrough statement out of place

@Noofbiz Noofbiz added the bug label Aug 5, 2020
@Noofbiz Noofbiz added this to the 1.1 milestone Aug 5, 2020
@Noofbiz
Copy link
Member

Noofbiz commented Aug 5, 2020

Hmm it looks like a fall through doesn't work with select, maybe the compiler used to build it anyway? I know I've built a headless app to make sure it worked at some point lol

All it needs is the fall through part run on it's own goroutine like it does for the glfw version. Not sure why it doesn't already though

@Noofbiz
Copy link
Member

Noofbiz commented Aug 7, 2020

I really hoped go built smarter and only the packages actually used. That way just having that headless variable check would take care of it.

There’s a few options. You can use your headless build of oto, maybe even submit a PR to oto so it can be put in the project. I can see lots of uses for it, such as testing and building on servers.
Another option is to use a dummy driver on the server. This would be very useful for testing, since you can get the byte output of the sound driver to ensure you’re outputting what you’re inputting. Your case I don’t believe it offers any advantages over the headless version.
The last option is to split common/audio.go into common/audio_headless.go and common/audio.go and use build tags to ensure oto is never touched when you pass the headless tag to engo. I think this one might be good just so that next time someone tries to build with the headless tag it works as expected.

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

No branches or pull requests

2 participants