-
-
Notifications
You must be signed in to change notification settings - Fork 234
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
"No backend is available" error with examples #1236
Comments
No backend is available
error with examples
The source of the issue is glutin. More details available in this closed issue. I fixed the issue myself by building a simple nix package in the root of the cargo directory:
The most important part here is the This can probably be marked as solved now. If the maintainer wishes to document this somewhere please do. Maybe even just a link to this issue in the readme so people on NixOS don't get stuck and quit trying. |
Found this issue after going through the same struggle with backend errors, and I am also on NixOS. For others that find this, the package above is a good solution! Here's my entire flake if anyone wants it. {
description = "Basic Rust environment with toolchain and language server";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
inherit (pkgs) mkShell rust mesa libGL patchelf rustPlatform wayland xorg;
inherit (xorg) libX11 libXcursor libXi libXxf86vm libXrandr;
pname = "simple-game";
version = "0.1.0";
nvimrc = ''local servers = { "rust_analyzer" }
local caps = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities());
for _, lsp in ipairs(servers) do
require("lspconfig")[lsp].setup {capabilities = caps}
end
vim.cmd("LspStart");'';
in
rec
{
# Executed by `nix build`
packages.default = rustPlatform.buildRustPackage {
inherit pname version;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
buildInputs = [ patchelf ];
fixupPhase = ''
patchelf --set-rpath ${libGL}/lib:${mesa}/lib:${wayland}/lib:${libX11}/lib:${libXi}/lib:${libXcursor}/lib:${libXxf86vm}/lib:${libXrandr}/lib \
$out/bin/${pname}
'';
};
# Executed by `nix run`
apps.default = flake-utils.lib.mkApp { drv = packages.default; };
# Used by `nix develop`
devShells.default = mkShell {
buildInputs = with pkgs; [
cargo
rustc
clippy
rustfmt
rust-analyzer
pkg-config
];
RUST_SRC_PATH = "${rust.packages.stable.rustPlatform.rustLibSrc}";
shellHook = ''echo '${nvimrc}' > .nvimrc.lua'';
};
}
);
} |
I am trying to build and run an example from piston.rs, here is the code fore reference:
but get error:
I am running NixOS, so problem may be with dynamically loading libraries. Is there a way to find out which
libs do I need?
As far as I can understand the problem is in
XConnection::new
function:I've tried to explicitly "install" all mentioned libs via
nix-shell -p "[x11 gcc] ++ (with xorg; [libXcursor xrandr xinput libxcb])"
, but got the same error as above.The text was updated successfully, but these errors were encountered: