From 8ca75a3fb91f2de5416568f3fb14a09f75219c60 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 14 Sep 2023 10:57:37 +0800 Subject: [PATCH] firmware: deal with rust nonsense Fixes "error: edition 2021 is unstable and only available with -Z unstable-options. error: could not compile `alloc`" --- flake.nix | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index 565211391..42964e9ee 100644 --- a/flake.nix +++ b/flake.nix @@ -43,15 +43,18 @@ cargo = rust; }); + cargo-xbuild = pkgs.cargo-xbuild.overrideAttrs(oa: { + postPatch = "substituteInPlace src/sysroot.rs --replace 2021 2018"; + }); + vivadoDeps = pkgs: with pkgs; let - # Apply patch from https://github.com/nix-community/nix-environments/pull/54 - # to fix ncurses libtinfo.so's soname issue + # Apply patch from https://github.com/nix-community/nix-environments/pull/54 + # to fix ncurses libtinfo.so's soname issue ncurses' = ncurses5.overrideAttrs (old: { configureFlags = old.configureFlags ++ [ "--with-termlib" ]; postFixup = ""; }); - in - [ + in [ libxcrypt-legacy (ncurses'.override { unicodeSupport = false; }) zlib @@ -263,7 +266,7 @@ nativeBuildInputs = [ (pkgs.python3.withPackages(ps: [ migen misoc (artiq.withExperimentalFeatures experimentalFeatures) ps.packaging ])) rust - pkgs.cargo-xbuild + cargo-xbuild pkgs.llvmPackages_14.clang-unwrapped pkgs.llvm_14 pkgs.lld_14 @@ -435,7 +438,7 @@ buildInputs = [ (pkgs.python3.withPackages(ps: with packages.x86_64-linux; [ migen misoc ps.paramiko microscope ps.packaging ] ++ artiq.propagatedBuildInputs )) rust - pkgs.cargo-xbuild + cargo-xbuild pkgs.llvmPackages_14.clang-unwrapped pkgs.llvm_14 pkgs.lld_14 @@ -463,7 +466,7 @@ buildInputs = [ (pkgs.python3.withPackages(ps: with packages.x86_64-linux; [ migen misoc artiq ps.packaging ])) rust - pkgs.cargo-xbuild + cargo-xbuild pkgs.llvmPackages_14.clang-unwrapped pkgs.llvm_14 pkgs.lld_14