From eab839aed05478ce11c607a205452f576c43df3e Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 13 Oct 2020 19:12:55 +0800 Subject: [PATCH] follow changes in zynq-rs --- cargo-xbuild.nix | 23 ------------------- default.nix | 4 ++-- shell.nix | 6 ++--- src/Cargo.lock | 20 ++++++++-------- ...=> xbuild_override_compiler_builtins.patch | 0 zynq-rs.nix | 4 ++-- 6 files changed, 17 insertions(+), 40 deletions(-) delete mode 100644 cargo-xbuild.nix rename cargo-xbuild.patch => xbuild_override_compiler_builtins.patch (100%) diff --git a/cargo-xbuild.nix b/cargo-xbuild.nix deleted file mode 100644 index fcb61a3..0000000 --- a/cargo-xbuild.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ pkgs }: -pkgs.rustPlatform.buildRustPackage rec { - pname = "cargo-xbuild"; - version = "0.5.21"; - - src = pkgs.fetchFromGitHub { - owner = "rust-osdev"; - repo = pname; - rev = "v${version}"; - sha256 = "08mpnj3l6bcm1jg22lw1gcs0lkm4320fwl4p5y1s44w64963kzf7"; - }; - - patches = [ ./cargo-xbuild.patch ]; - - cargoSha256 = "1pj4x8y5vfpnn8vhxqqm3vicn29870r3jh0b17q3riq4vz1a2afp"; - - meta = with pkgs.stdenv.lib; { - description = "Automatically cross-compiles the sysroot crates core, compiler_builtins, and alloc"; - homepage = "https://github.com/rust-osdev/cargo-xbuild"; - license = with licenses; [ mit asl20 ]; - maintainers = with maintainers; [ johntitor xrelkd ]; - }; -} diff --git a/default.nix b/default.nix index 3448cfc..faf227b 100644 --- a/default.nix +++ b/default.nix @@ -13,7 +13,7 @@ let version = "0.1.0"; src = ./src; - cargoSha256 = "10hap25cy2qgwr7b86jid73i6fp480iym29r3r97jindfxk0svi0"; + cargoSha256 = "152k0jvx02a66dafyc25pz60wlg7i3kln9hh7nwl2wcanmqzzkbw"; nativeBuildInputs = [ pkgs.gnumake @@ -23,7 +23,7 @@ let pkgs.llvmPackages_9.clang-unwrapped ]; buildPhase = '' - export XARGO_RUST_SRC="${rustPlatform.rust.rustc.src}/src" + export XARGO_RUST_SRC="${rustPlatform.rust.rustc.src}/library" export CARGO_HOME=$(mktemp -d cargo-home.XXX) make VARIANT=${variant} ''; diff --git a/shell.nix b/shell.nix index 23679e9..233f6ee 100644 --- a/shell.nix +++ b/shell.nix @@ -2,10 +2,10 @@ let zynq-rs = (import ./zynq-rs.nix); pkgs = import { overlays = [ (import "${zynq-rs}/nix/mozilla-overlay.nix") ]; }; rustPlatform = (import "${zynq-rs}/nix/rust-platform.nix" { inherit pkgs; }); + cargo-xbuild = (import zynq-rs).cargo-xbuild; artiq-fast = ; artiqpkgs = import "${artiq-fast}/default.nix" { inherit pkgs; }; vivado = import "${artiq-fast}/vivado.nix" { inherit pkgs; }; - cargo-xbuild = import ./cargo-xbuild.nix { inherit pkgs; }; zc706-szl = (import zynq-rs).zc706-szl; in pkgs.stdenv.mkDerivation { @@ -17,7 +17,7 @@ in pkgs.llvmPackages_9.llvm pkgs.llvmPackages_9.clang-unwrapped pkgs.cacert - cargo-xbuild + (cargo-xbuild.overrideAttrs(oa: { patches = oa.patches ++ [ ./xbuild_override_compiler_builtins.patch ]; } )) pkgs.openocd pkgs.openssh pkgs.rsync @@ -29,7 +29,7 @@ in (import "${zynq-rs}/nix/mkbootimage.nix" { inherit pkgs; }) ]; - XARGO_RUST_SRC = "${rustPlatform.rust.rustc.src}/src"; + XARGO_RUST_SRC = "${rustPlatform.rust.rustc.src}/library"; OPENOCD_ZYNQ = "${zynq-rs}/openocd"; SZL = "${zc706-szl}/szl.elf"; } diff --git a/src/Cargo.lock b/src/Cargo.lock index 5297a98..64f03ad 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -58,7 +58,7 @@ dependencies = [ [[package]] name = "core_io" version = "0.1.20200410" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#7360984efbd772ae992ef00af09786b0ae8430f0" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#6266d280951c3fe5d4963a4b1ca45ce369d6b773" dependencies = [ "memchr", ] @@ -188,11 +188,11 @@ dependencies = [ [[package]] name = "libasync" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#7360984efbd772ae992ef00af09786b0ae8430f0" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#6266d280951c3fe5d4963a4b1ca45ce369d6b773" dependencies = [ "embedded-hal", "libcortex_a9", - "nb 0.1.3", + "nb 1.0.0", "pin-utils", "smoltcp", ] @@ -200,7 +200,7 @@ dependencies = [ [[package]] name = "libboard_zynq" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#7360984efbd772ae992ef00af09786b0ae8430f0" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#6266d280951c3fe5d4963a4b1ca45ce369d6b773" dependencies = [ "bit_field", "embedded-hal", @@ -224,7 +224,7 @@ dependencies = [ [[package]] name = "libconfig" version = "0.1.0" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#7360984efbd772ae992ef00af09786b0ae8430f0" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#6266d280951c3fe5d4963a4b1ca45ce369d6b773" dependencies = [ "core_io", "fatfs", @@ -235,7 +235,7 @@ dependencies = [ [[package]] name = "libcortex_a9" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#7360984efbd772ae992ef00af09786b0ae8430f0" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#6266d280951c3fe5d4963a4b1ca45ce369d6b773" dependencies = [ "bit_field", "libregister", @@ -251,7 +251,7 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libregister" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#7360984efbd772ae992ef00af09786b0ae8430f0" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#6266d280951c3fe5d4963a4b1ca45ce369d6b773" dependencies = [ "bit_field", "vcell", @@ -261,7 +261,7 @@ dependencies = [ [[package]] name = "libsupport_zynq" version = "0.0.0" -source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#7360984efbd772ae992ef00af09786b0ae8430f0" +source = "git+https://git.m-labs.hk/M-Labs/zynq-rs.git#6266d280951c3fe5d4963a4b1ca45ce369d6b773" dependencies = [ "compiler_builtins", "libboard_zynq", @@ -273,9 +273,9 @@ dependencies = [ [[package]] name = "linked_list_allocator" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "660b26e6156a7d00eefb19052fe1943cf5ab2f353a723a577fad6ba2f99d1f90" +checksum = "84565678e403453d1a27a0886882b3b271701e65146d972d9d7d9a4c4a0ff498" [[package]] name = "log" diff --git a/cargo-xbuild.patch b/xbuild_override_compiler_builtins.patch similarity index 100% rename from cargo-xbuild.patch rename to xbuild_override_compiler_builtins.patch diff --git a/zynq-rs.nix b/zynq-rs.nix index cc3c174..03c7c14 100644 --- a/zynq-rs.nix +++ b/zynq-rs.nix @@ -3,6 +3,6 @@ let in pkgs.fetchgit { url = "https://git.m-labs.hk/M-Labs/zynq-rs.git"; - rev = "7360984efbd772ae992ef00af09786b0ae8430f0"; - sha256 = "10xrkhvrs6p0pn50cccvbnzi7l9lp8a6xmqy0pv5vg0f1qq3zxif"; + rev = "6266d280951c3fe5d4963a4b1ca45ce369d6b773"; + sha256 = "13cnxlnafj5s0rd9a9k369b6xfb1gnvp40vfk81kbr1924a1c04d"; }