You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Somebody in ##rust on irc had issues due to using a pre-2021 edition of rustc/cargo, turned out they were following the Recipe: Nix as development environment chapter of the godot-rust book which pins a specific version of nixpkgs:
let
# Get an up-to-date package for enabling OpenGL support in Nix
nixgl = import (fetchTarball "https://github.com/guibou/nixGL/archive/master.tar.gz") {};
# Pin the version of the nix package repository that has Godot 3.2.3 and compatible with godot-rust 0.9.3
# You might want to update the commit hash into the one that have your desired version of Godot
# You could search for the commit hash of a particular package by using this website https://lazamar.co.uk/nix-versions
pkgs = import (fetchTarball "https://github.com/nixos/nixpkgs/archive/5658fadedb748cb0bdbcb569a53bd6065a5704a9.tar.gz") {};
in
# Configure the dependency of your shell
# Add support for clang for bindgen in godot-rust
pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
buildInputs = [
# Rust related dependencies
pkgs.rustc
pkgs.cargo
pkgs.rustfmt
pkgs.libclang
# Godot Engine Editor
pkgs.godot
# The support for OpenGL in Nix
nixgl.nixGLDefault
];
# Point bindgen to where the clang library would be
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
# Make clang aware of a few headers (stdbool.h, wchar.h)
BINDGEN_EXTRA_CLANG_ARGS = with pkgs; ''
-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion clang}/include
-isystem ${llvmPackages.libclang.out}/lib/clang/${lib.getVersion clang}/include
-isystem ${glibc.dev}/include
'';
# For Rust language server and rust-analyzer
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
# Alias the godot engine to use nixGL
shellHook = ''
alias godot="nixGL godot -e"
'';
}
The gdnative-core crate of the godot-rust project depends on indexmap = "1.6.0", this resolves to indexmap 1.9.1 which uses 2021 edition.
The text was updated successfully, but these errors were encountered:
Someone recently updated the Nix recipe (https://github.com/godot-rust/book/pull/80), but it seems like more is needed. It also looks like the recipe refers to Godot 3.2.3 and gdnative 0.9.3, both of which are quite outdated.
Hey @kpcyrd, is this still an issue? I tried out the script today and it worked fine for me. Also note that you can always update the version of nixpkgs used as stated in the comments at the top above let pkgs = ....
If it's still an issue some more context would be helpful for resolving this, like
What is the exact error message and when does it occur?
Somebody in ##rust on irc had issues due to using a pre-2021 edition of rustc/cargo, turned out they were following the Recipe: Nix as development environment chapter of the godot-rust book which pins a specific version of nixpkgs:
The
gdnative-core
crate of the godot-rust project depends onindexmap = "1.6.0"
, this resolves to indexmap 1.9.1 which uses 2021 edition.The text was updated successfully, but these errors were encountered: