rust-build / rust-build.action

Automate publishing Rust build artifacts for GitHub releases through GitHub Actions
349 stars 51 forks source link

Builds for Linux don't seem to work (unlike for Windows) #85

Open sdasda7777 opened 10 months ago

sdasda7777 commented 10 months ago

Hi, I've been trying to set up a pipeline to automatically build my game. While the Windows builds work exactly as expected, Linux builds not so much (it works when built through cargo, but not through this action on GitHub)

You can check the generated releases here. The version 0.1.0 uses static linking for all platforms, and after launching the Linux build on my machines, it immediately panics (Failed to initialize any backend! Wayland status: NoCompositorListening). The version 0.1.1 uses dynamic linking for Linux (STATIC_LINKING: false), however this time I get very cryptic message bash: ./minesweeper6d: Directory or file does not exist.

Any ideas whether this is bug, issue of configuration, or something else?

Douile commented 10 months ago

I'm not sure about the missing backend, that would likely be caused by the program not being able to locate x11 or wayland: which are you using? Can other GUI apps launch from same terminal you launch this program?

It could possibly be caused if egui framework programmatically detects the display backend at compile time: the build container doesn't have wayland or x11 so they wouldn't be detected hence no backend compiled in. Although I'm just guessing, I'm not familiar with egui.

The file not found error is caused by the dynamic linking: the executable produced is trying to load a library not present on your system (that was present in the build environment). You can use a tool like ldd to find which library is missing.

sdasda7777 commented 10 months ago

Thanks for the reply. I sort of missed before that the continuation of the error I get with static linking is probably more relevant:

X11 status: LibraryOpenError(OpenError { kind: Library, detail: "opening library failed (Dynamic loading not supported); opening library failed (Dynamic loading not supported)" })

From this I am guessing egui does in fact determine the backend at runtime, not at compile time, however I'm not sure what the error really means, as I would hope static linking would be used for all the libraries.