Giter VIP home page Giter VIP logo

cargo-xbuild's People

Contributors

aehmlo avatar alschwalm avatar ascjones avatar axelmontini avatar blutack avatar bors[bot] avatar homunkulus avatar japaric avatar johnthagen avatar k0pernicus avatar koushiro avatar luqmana avatar nils-tud avatar parasyte avatar parraman avatar pfmooney avatar phil-opp avatar ralfjung avatar regexident avatar rkarp avatar roblabla avatar rybot666 avatar stlankes avatar thejpster avatar thinkofname avatar tjhu avatar toku-sa-n avatar upsuper avatar victorkoenders avatar woyten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cargo-xbuild's Issues

Doesn't work with build.target-dir set for Cargo

I have build.target-dir in ~/.cargo/config set to some specific directory so that

  • dependencies from multiple projects can share build result,
  • the directory can be cleaned up regularly after upgrading Rust, and
  • I can make backup skip such directory.

However, this breaks cargo-xbuild because it seems to rely on that target directory is always in the project directory.

There are two possible way to fix as far as I can see:

  1. read the target directory from cargo metadata, or
  2. explicitly set CARGO_TARGET_DIR when it calls into cargo.

I would prefer the first so that the global configuration is respected.

error: failed to get bitcode from object file for LTO

Hello. I use cargo xbuild to build my OS. Recently build failed with the following error message.

error: failed to get bitcode from object file for LTO (Bitcode section not found in object file)

My repository is this and cargo_settings.json is specified as the target. You can reproduce this by running make on the master branch. I also tried with phil-opp's .json file, but build failed. The only thing which made it possible to build is to disable lto ( lto = false in Cargo.toml) . cargo clean && cargo xbuild did not solve the problem.
This is my CI history. You can see that the same commit succeeds and fails to build.

error: parsing package.metadata.cargo-xbuild section failed

I get this new error message (introduced in #57) with no additional way to diagnose the cause.

error: parsing package.metadata.cargo-xbuild section failed
note: run with `RUST_BACKTRACE=1` for a backtrace

Setting RUST_BACKTRACE=1 hides the second line from the error message and produces no backtrace.

This causes my CI to fail. E.g. https://travis-ci.org/rust-console/cargo-n64/builds/650914215

FWIW, the cargo-n64 repo is setup with a workspace manifest, and I do not have a package.metadata.cargo-xbuild section in any of the crate manifests. cargo xbuild is invoked something like this:

cargo xbuild --target=/tmp/mips-nintendo64-none.json --package=hello-ipl3font --release
Where the contents of the target JSON file is:
{
  "arch": "mips",
  "cpu": "mips3",
  "data-layout": "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32:64-S64",
  "disable-redzone": true,
  "env": "unknown",
  "executables": true,
  "features": "+mips3,+gp64,+fpxx,+nooddspreg",
  "linker": "rust-lld",
  "linker-flavor": "ld.lld",
  "llvm-target": "mips-unknown-unknown",
  "os": "none",
  "panic-strategy": "abort",
  "pre-link-args": {
    "ld.lld": [
      "--script=/tmp/linker.ld"
    ]
  },
  "relocation-model": "static",
  "target-c-int-width": "32",
  "target-endian": "big",
  "target-pointer-width": "32",
  "vendor": "nintendo64"
}
And the contents of the linker script:
ENTRY(_start)

SECTIONS {
    . = 0x80000400;
    __boot_start = .;

    .boot : {
        *(.boot)
    }

    .text : {
        *(.text .text.*)
    }

    .rodata : {
        *(.rodata .rodata.*)
    }

    .data : {
        *(.data .data.*)
    }

    .bss : {
        . = ALIGN(4);
        __bss_start = .;
        *(.bss .bss.*)
        __bss_end = .;
    }

    . = ALIGN(2);
    __rom_end = . - __boot_start + 0xB0001000;

    /DISCARD/ : {
        *(.MIPS.*)
        *(.comment)
        *(.mdebug.*)
        *(.pdr)
        *(.reginfo)

        /*
         * We may need the global offset table some day.
         * Our target is currently set with a static relocation-model, so this
         * might not be needed after all.
         */
        *(.got)
    }
}

Incorrect linking using sysroot from xbuild

Hi.

I am trying to use cargo xbuild to build for target "thumbv7em-none-eabihf".

When i am using cargo build, everything correctly links, resulting in

size target/thumbv7em-none-eabihf/debug/factbird-rs       
   text	   data	    bss	    dec	    hex	filename
   6562	      0	      8	   6570	   19aa	target/thumbv7em-none-eabihf/debug/factbird-rs

But, building the exact same with cargo xbuild results in

size target/thumbv7em-none-eabihf/debug/factbird-rs                                                                                                         
   text	   data	    bss	    dec	    hex	filename
      0	      0	      0	      0	      0	target/thumbv7em-none-eabihf/debug/factbird-rs

I have also tried using RUSTFLAGS="--sysroot=/home/mathias/git/blackbird/other/factbird-rs/target/sysroot" cargo build

Which also results in the same wrongly linked file.

My problem is, that i need the sysroot alloc and compiler_builtins for my project.

I have attached an cargo xbuild --verbose after a cargo clean here, but there is no errors.. :

+ "rustc" "--print" "sysroot"
+ "rustc" "--print" "target-list"
+ "/home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/tmp/xargo.5R25mEvRl1u9/Cargo.toml" "--target" "thumbv7em-none-eabihf" "-v" "--" "-Z" "force-unstable-if-unmarked"
    Updating crates.io index
   Compiling core v0.0.0 (/home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore)
   Compiling compiler_builtins v0.1.10
     Running `rustc --crate-name core /home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C debuginfo=2 -C metadata=689e0a6b9a65f770 -C extra-filename=-689e0a6b9a65f770 --out-dir /tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps --target thumbv7em-none-eabihf -L dependency=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps -L dependency=/tmp/xargo.5R25mEvRl1u9/target/release/deps -C linker=arm-none-eabi-gcc -C link-arg=-Wl,-Tlink.x -C link-arg=-nostartfiles`
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.10/build.rs --color always --crate-type bin --emit=dep-info,link -C opt-level=3 -C debuginfo=2 --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="mem"' -C metadata=774b5f2c2454c202 -C extra-filename=-774b5f2c2454c202 --out-dir /tmp/xargo.5R25mEvRl1u9/target/release/build/compiler_builtins-774b5f2c2454c202 -L dependency=/tmp/xargo.5R25mEvRl1u9/target/release/deps --cap-lints allow`
     Running `/tmp/xargo.5R25mEvRl1u9/target/release/build/compiler_builtins-774b5f2c2454c202/build-script-build`
   Compiling rustc-std-workspace-core v1.0.0 (/home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/tools/rustc-std-workspace-core)
     Running `rustc --edition=2018 --crate-name rustc_std_workspace_core /home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/tools/rustc-std-workspace-core/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C debuginfo=2 -C metadata=61dda5bb21022ff9 -C extra-filename=-61dda5bb21022ff9 --out-dir /tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps --target thumbv7em-none-eabihf -L dependency=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps -L dependency=/tmp/xargo.5R25mEvRl1u9/target/release/deps --extern core=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps/libcore-689e0a6b9a65f770.rlib -C linker=arm-none-eabi-gcc -C link-arg=-Wl,-Tlink.x -C link-arg=-nostartfiles`
     Running `rustc --crate-name compiler_builtins /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.10/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C debuginfo=2 --cfg 'feature="compiler-builtins"' --cfg 'feature="core"' --cfg 'feature="default"' --cfg 'feature="mem"' -C metadata=700c8fe620c273a5 -C extra-filename=-700c8fe620c273a5 --out-dir /tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps --target thumbv7em-none-eabihf -L dependency=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps -L dependency=/tmp/xargo.5R25mEvRl1u9/target/release/deps --extern core=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps/librustc_std_workspace_core-61dda5bb21022ff9.rlib --cap-lints allow -C linker=arm-none-eabi-gcc -C link-arg=-Wl,-Tlink.x -C link-arg=-nostartfiles --cfg thumb`
   Compiling alloc v0.0.0 (/tmp/xargo.5R25mEvRl1u9)
     Running `rustc --edition=2018 --crate-name alloc /home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/lib.rs --color always --crate-type lib --emit=dep-info,link -C opt-level=3 -C debuginfo=2 -Z force-unstable-if-unmarked -C metadata=175bf83a25490432 -C extra-filename=-175bf83a25490432 --out-dir /tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps --target thumbv7em-none-eabihf -L dependency=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps -L dependency=/tmp/xargo.5R25mEvRl1u9/target/release/deps --extern compiler_builtins=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps/libcompiler_builtins-700c8fe620c273a5.rlib --extern core=/tmp/xargo.5R25mEvRl1u9/target/thumbv7em-none-eabihf/release/deps/libcore-689e0a6b9a65f770.rlib -C linker=arm-none-eabi-gcc -C link-arg=-Wl,-Tlink.x -C link-arg=-nostartfiles`
    Finished release [optimized + debuginfo] target(s) in 20.33s
+ RUSTFLAGS="--sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot"
+ "/home/mathias/.rustup/toolchains/nightly-2019-02-19-x86_64-unknown-linux-gnu/bin/cargo" "build" "--verbose"
   Compiling semver-parser v0.7.0
   Compiling proc-macro2 v0.4.27
   Compiling unicode-xid v0.1.0
   Compiling typenum v1.10.0
   Compiling rand_core v0.4.0
   Compiling syn v0.15.30
   Compiling cortex-m v0.5.8
   Compiling vcell v0.1.0
     Running `rustc --crate-name semver_parser /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-parser-0.7.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=a5013c4a48997760 -C extra-filename=-a5013c4a48997760 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.4.27/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=664c2cb41db3018b -C extra-filename=-664c2cb41db3018b --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/proc-macro2-664c2cb41db3018b -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name unicode_xid /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-xid-0.1.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="default"' -C metadata=9d54fe9bc00fa368 -C extra-filename=-9d54fe9bc00fa368 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name build_script_main /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/typenum-1.10.0/build/main.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=5806034ac73363ff -C extra-filename=-5806034ac73363ff --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/typenum-5806034ac73363ff -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name rand_core /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_core-0.4.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=6a6744a4fd9cb569 -C extra-filename=-6a6744a4fd9cb569 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-0.15.30/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="extra-traits"' --cfg 'feature="full"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="proc-macro2"' --cfg 'feature="quote"' -C metadata=644f9d62d598c31c -C extra-filename=-644f9d62d598c31c --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/syn-644f9d62d598c31c -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.5.8/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=a058de06953ee555 -C extra-filename=-a058de06953ee555 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-a058de06953ee555 -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name vcell /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/vcell-0.1.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=ec393dc222a689bb -C extra-filename=-ec393dc222a689bb --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling cortex-m-rt v0.6.8
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.6.8/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="device"' -C metadata=c21932aaeb68e831 -C extra-filename=-c21932aaeb68e831 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-rt-c21932aaeb68e831 -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
   Compiling stable_deref_trait v1.1.1
     Running `rustc --crate-name stable_deref_trait /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/stable_deref_trait-1.1.1/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=a169e2b80cd9406a -C extra-filename=-a169e2b80cd9406a --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling cortex-m v0.6.0
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.6.0/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=25022b70a34fb207 -C extra-filename=-25022b70a34fb207 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-25022b70a34fb207 -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
   Compiling r0 v0.2.2
     Running `rustc --crate-name r0 /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/r0-0.2.2/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=7235a16c01140ce4 -C extra-filename=-7235a16c01140ce4 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling cortex-m-semihosting v0.3.2
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-semihosting-0.3.2/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=72090633d9b51425 -C extra-filename=-72090633d9b51425 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-semihosting-72090633d9b51425 -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
   Compiling stm32l4 v0.6.0
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32l4-0.6.0/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="cortex-m-rt"' --cfg 'feature="default"' --cfg 'feature="rt"' --cfg 'feature="stm32l4x5"' -C metadata=63906e06fd79cd2b -C extra-filename=-63906e06fd79cd2b --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/stm32l4-63906e06fd79cd2b -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow`
   Compiling volatile-register v0.1.2
     Running `rustc --crate-name volatile_register /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/volatile-register-0.1.2/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=bafa39a5a29a6244 -C extra-filename=-bafa39a5a29a6244 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling aligned v0.2.0
   Compiling linked_list_allocator v0.6.4
     Running `rustc --crate-name aligned /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/aligned-0.2.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=41bf270fc6e54be6 -C extra-filename=-41bf270fc6e54be6 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
     Running `rustc --crate-name linked_list_allocator /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/linked_list_allocator-0.6.4/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=14db457c0cb6e97e -C extra-filename=-14db457c0cb6e97e --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling volatile-register v0.2.0
     Running `rustc --crate-name volatile_register /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/volatile-register-0.2.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=af4ad95bd95e18f4 -C extra-filename=-af4ad95bd95e18f4 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern vcell=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libvcell-ec393dc222a689bb.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling rand_core v0.3.1
     Running `rustc --crate-name rand_core /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/rand_core-0.3.1/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=20f3b3841c5e3d62 -C extra-filename=-20f3b3841c5e3d62 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern rand_core=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/librand_core-6a6744a4fd9cb569.rlib --cap-lints allow`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-a058de06953ee555/build-script-build`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-rt-c21932aaeb68e831/build-script-build`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/syn-644f9d62d598c31c/build-script-build`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/proc-macro2-664c2cb41db3018b/build-script-build`
   Compiling cortex-m v0.1.8
     Running `rustc --crate-name cortex_m /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.1.8/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=d596cb2a215a5d27 -C extra-filename=-d596cb2a215a5d27 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern volatile_register=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libvolatile_register-bafa39a5a29a6244.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-25022b70a34fb207/build-script-build`
   Compiling rand v0.5.6
     Running `rustc --crate-name rand /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/rand-0.5.6/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=0ead1e2840848d75 -C extra-filename=-0ead1e2840848d75 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern rand_core=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/librand_core-20f3b3841c5e3d62.rlib --cap-lints allow`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/cortex-m-semihosting-72090633d9b51425/build-script-build`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/typenum-5806034ac73363ff/build-script-main`
     Running `rustc --crate-name proc_macro2 /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-0.4.27/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=569c775ba7e48c3e -C extra-filename=-569c775ba7e48c3e --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern unicode_xid=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libunicode_xid-9d54fe9bc00fa368.rlib --cap-lints allow --cfg u128 --cfg use_proc_macro --cfg wrap_proc_macro --cfg nightly`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/stm32l4-63906e06fd79cd2b/build-script-build`
     Running `rustc --crate-name typenum /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/typenum-1.10.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=ae5097b29b3df08a -C extra-filename=-ae5097b29b3df08a --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling semver v0.9.0
     Running `rustc --crate-name semver /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.9.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="default"' -C metadata=97631abd75a04f66 -C extra-filename=-97631abd75a04f66 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern semver_parser=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libsemver_parser-a5013c4a48997760.rlib --cap-lints allow`
   Compiling alloc-cortex-m v0.3.5
     Running `rustc --crate-name alloc_cortex_m /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/alloc-cortex-m-0.3.5/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=743fff4f20ccd058 -C extra-filename=-743fff4f20ccd058 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern cortex_m=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m-d596cb2a215a5d27.rlib --extern linked_list_allocator=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/liblinked_list_allocator-14db457c0cb6e97e.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling rustc_version v0.2.3
     Running `rustc --crate-name rustc_version /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc_version-0.2.3/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=57e8ff2e2c437f30 -C extra-filename=-57e8ff2e2c437f30 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern semver=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libsemver-97631abd75a04f66.rlib --cap-lints allow`
   Compiling generic-array v0.12.0
     Running `rustc --crate-name generic_array /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/generic-array-0.12.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=bd098c6f883efdb3 -C extra-filename=-bd098c6f883efdb3 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern typenum=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libtypenum-ae5097b29b3df08a.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling bare-metal v0.2.4
     Running `rustc --crate-name build_script_build /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/bare-metal-0.2.4/build.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=30b2f25266ef58bb -C extra-filename=-30b2f25266ef58bb --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/build/bare-metal-30b2f25266ef58bb -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern rustc_version=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/librustc_version-57e8ff2e2c437f30.rlib --cap-lints allow`
   Compiling as-slice v0.1.0
     Running `rustc --crate-name as_slice /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/as-slice-0.1.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=2176a59937717e9f -C extra-filename=-2176a59937717e9f --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern generic_array=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libgeneric_array-bd098c6f883efdb3.rlib --extern stable_deref_trait=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libstable_deref_trait-a169e2b80cd9406a.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
   Compiling quote v0.6.12
     Running `rustc --crate-name quote /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-0.6.12/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="proc-macro"' --cfg 'feature="proc-macro2"' -C metadata=6b4a844fc4c32a32 -C extra-filename=-6b4a844fc4c32a32 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern proc_macro2=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libproc_macro2-569c775ba7e48c3e.rlib --cap-lints allow`
     Running `/home/mathias/git/blackbird/other/factbird-rs/target/debug/build/bare-metal-30b2f25266ef58bb/build-script-build`
     Running `rustc --crate-name bare_metal /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/bare-metal-0.2.4/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=c8d2a0cf662a2d5c -C extra-filename=-c8d2a0cf662a2d5c --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
     Running `rustc --crate-name cortex_m /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.5.8/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=1e5848c4ac0bfe37 -C extra-filename=-1e5848c4ac0bfe37 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern aligned=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libaligned-41bf270fc6e54be6.rlib --extern bare_metal=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libbare_metal-c8d2a0cf662a2d5c.rlib --extern volatile_register=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libvolatile_register-af4ad95bd95e18f4.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-dddb4941397b99f6/out --cfg cortex_m --cfg armv7m --cfg has_fpu -l static=cortex-m`
     Running `rustc --crate-name syn /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-0.15.30/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="extra-traits"' --cfg 'feature="full"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="proc-macro2"' --cfg 'feature="quote"' -C metadata=4455476e02eee424 -C extra-filename=-4455476e02eee424 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern proc_macro2=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libproc_macro2-569c775ba7e48c3e.rlib --extern quote=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libquote-6b4a844fc4c32a32.rlib --extern unicode_xid=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libunicode_xid-9d54fe9bc00fa368.rlib --cap-lints allow --cfg syn_can_use_thread_id --cfg syn_can_call_macro_by_path`
     Running `rustc --crate-name cortex_m_semihosting /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-semihosting-0.3.2/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=d6e290ce4d11922f -C extra-filename=-d6e290ce4d11922f --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern cortex_m=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m-1e5848c4ac0bfe37.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-semihosting-0ae8219cf00c055d/out --cfg thumb -l static=cortex-m-semihosting -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-dddb4941397b99f6/out`
   Compiling aligned v0.3.1
     Running `rustc --edition=2018 --crate-name aligned /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/aligned-0.3.1/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=4d8a2d956c8cf5ee -C extra-filename=-4d8a2d956c8cf5ee --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern as_slice=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libas_slice-2176a59937717e9f.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot`
     Running `rustc --crate-name cortex_m /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.6.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=8bb7745d28efa6d6 -C extra-filename=-8bb7745d28efa6d6 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern aligned=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libaligned-4d8a2d956c8cf5ee.rlib --extern bare_metal=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libbare_metal-c8d2a0cf662a2d5c.rlib --extern volatile_register=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libvolatile_register-af4ad95bd95e18f4.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-159a20753a1a73df/out --cfg cortex_m --cfg armv7m --cfg has_fpu -l static=cortex-m`
   Compiling cortex-m-rt-macros v0.1.5
     Running `rustc --crate-name cortex_m_rt_macros /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-macros-0.1.5/src/lib.rs --color always --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C codegen-units=1 -C debuginfo=2 -C metadata=d23eb9131f6bb606 -C extra-filename=-d23eb9131f6bb606 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern proc_macro2=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libproc_macro2-569c775ba7e48c3e.rlib --extern quote=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libquote-6b4a844fc4c32a32.rlib --extern rand=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/librand-0ead1e2840848d75.rlib --extern syn=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libsyn-4455476e02eee424.rlib --cap-lints allow`
     Running `rustc --crate-name cortex_m_rt /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.6.8/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="device"' -C metadata=6aad3ef91dfb67ce -C extra-filename=-6aad3ef91dfb67ce --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern cortex_m_rt_macros=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps/libcortex_m_rt_macros-d23eb9131f6bb606.so --extern r0=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libr0-7235a16c01140ce4.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-rt-039d964bde87625c/out --cfg has_fpu --cfg cortex_m --cfg armv7m -l static=cortex-m-rt`
     Running `rustc --crate-name stm32l4 /home/mathias/.cargo/registry/src/github.com-1ecc6299db9ec823/stm32l4-0.6.0/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 --cfg 'feature="cortex-m-rt"' --cfg 'feature="default"' --cfg 'feature="rt"' --cfg 'feature="stm32l4x5"' -C metadata=64f7cbb9965ef9a2 -C extra-filename=-64f7cbb9965ef9a2 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern bare_metal=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libbare_metal-c8d2a0cf662a2d5c.rlib --extern cortex_m=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m-1e5848c4ac0bfe37.rlib --extern cortex_m_rt=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m_rt-6aad3ef91dfb67ce.rlib --extern vcell=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libvcell-ec393dc222a689bb.rlib --cap-lints allow --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/stm32l4-7ec013fd750bca39/out -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-dddb4941397b99f6/out -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-rt-039d964bde87625c/out`
   Compiling factbird-rs v0.1.0 (/home/mathias/git/blackbird/other/factbird-rs)
     Running `rustc --crate-name factbird_rs src/main.rs --color always --crate-type bin --emit=dep-info,link -C codegen-units=1 -C debuginfo=2 -C metadata=f0c403b14b0cc245 -C extra-filename=-f0c403b14b0cc245 --out-dir /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -C incremental=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/incremental -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/mathias/git/blackbird/other/factbird-rs/target/debug/deps --extern alloc_cortex_m=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/liballoc_cortex_m-743fff4f20ccd058.rlib --extern cortex_m=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m-8bb7745d28efa6d6.rlib --extern cortex_m_rt=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m_rt-6aad3ef91dfb67ce.rlib --extern cortex_m_semihosting=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libcortex_m_semihosting-d6e290ce4d11922f.rlib --extern stm32l4=/home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/deps/libstm32l4-64f7cbb9965ef9a2.rlib --sysroot /home/mathias/git/blackbird/other/factbird-rs/target/sysroot -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-159a20753a1a73df/out -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-rt-039d964bde87625c/out -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-semihosting-0ae8219cf00c055d/out -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/cortex-m-dddb4941397b99f6/out -L /home/mathias/git/blackbird/other/factbird-rs/target/thumbv7em-none-eabihf/debug/build/stm32l4-7ec013fd750bca39/out`
    Finished dev [unoptimized + debuginfo] target(s) in 38.95s

My .cargo/config is:

[target.thumbv7m-none-eabi]
# uncomment this to make `cargo run` execute programs on QEMU
# runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel"

[target.'cfg(all(target_arch = "arm", target_os = "none"))']
# uncomment ONE of these three option to make `cargo run` start a GDB session
# which option to pick depends on your system
runner = "arm-none-eabi-gdb -q -x openocd.gdb"
# runner = "gdb-multiarch -q -x openocd.gdb"
# runner = "gdb -q -x openocd.gdb"

rustflags = [
  # LLD (shipped with the Rust toolchain) is used as the default linker
  "-C", "link-arg=-Tlink.x",

  # if you run into problems with LLD switch to the GNU linker by commenting out
  # this line
  "-C", "linker=arm-none-eabi-ld",

  # if you need to link to pre-compiled C libraries provided by a C toolchain
  # use GCC as the linker by commenting out both lines above and then
  # uncommenting the three lines below
  # "-C", "linker=arm-none-eabi-gcc",
  # "-C", "link-arg=-Wl,-Tlink.x",
  # "-C", "link-arg=-nostartfiles",
]

[build]
# Pick ONE of these compilation targets
# target = "thumbv6m-none-eabi"    # Cortex-M0 and Cortex-M0+
# target = "thumbv7m-none-eabi"    # Cortex-M3
# target = "thumbv7em-none-eabi"   # Cortex-M4 and Cortex-M7 (no FPU)
target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU)
➜  factbird-rs git:(master) rustc -V       
rustc 1.34.0-nightly (146aa60f3 2019-02-18)
➜  factbird-rs git:(master) cargo --version
cargo 1.34.0-nightly (865cb7010 2019-02-10)
➜  factbird-rs git:(master) cargo xbuild -v       
cargo-xbuild 0.5.7

A copy of my repo can be found here: https://github.com/smilykoch/factbird_rs

I am not really sure how to continue on this, so any help is welcomed!

mem flag not honored

I am cross-compiling a Rust library for aarch64-unknown-none-softfloat and it does not look like 'memcpy = false' in Cargo.toml is honored anymore. I have a libc that I'm using for my platform. Now when I'm linking things together my build script throws 'multiple definition of `memcpy'' etc.

This was working a few months ago (probably March or April) but now I came back to it, it does not work anymore.

I have updated my toolchain to the latest nightly as follows:

rustup 1.22.1 (2020-07-08)
rustc 1.47.0-nightly (2020-07-26)
cargo 1.47.0-nightly (2020-07-23)

Unfortunately, I don't have a log of which versions I was using when it was working.

I have tried different versions of cargo-xbuild, v0.5.20, v0.5.35, v0.6.0, etc.

v0.6.0 fails for a different reason (#88), but other versions all seem to include memcpy, etc.

I don't know if this is an issue with cargo-xbuild or compiler-builtins as it looks like compiler-builtins v0.1.32 is used now, which is probably a different version from what I was using before (though I don't know which version I was using when it was working for me).

Any help on this would be much appreciated.

Intermittend IO error with local toolchains

Hey

In sysroot::update() you call util::cp_r() to copy the lib and bin directories of lib/rustlib/ to the local sysroot. However, if these directories are empty, they might not exist at all, in which case the xbuild script errors out with:

error: intermittent IO error while iterating directory `/.../rust-lang/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin`
caused by: IO error for operation on /.../rust-lang/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/bin: No such file or directory (os error 2)
caused by: No such file or directory (os error 2)

In particular, if you compile rustc locally and use rustup toolchain link <name> <path> to link to the stage2 binaries, this error occurs. A simple workaround is to simply mkdir the respective directories. In my scenario, the bin directory is non-existant, so I just created it and everything runs smoothly.

I assume when you install your toolchains into a target directory, the installer automatically creates these directories, and as such the error does not occur. I didn't test this, though.

Anyway, would be nice to check whether the directory exists, rather than erroring out.

Thanks!
David

Recompile only on demand

Hi Phil,

thanks for taking on the annoying RUST_TARGET_PATH issue. I just tested it locally and it seems that, unless I'm doing something wrong, core, compiler_builtins, etc, are rebuilt every time from scratch.

Would it make sense to not recompile if a previous, up-to-date built of the components is already in target? Is it technically feasible?

Thanks,
Andre

codegen-backends deleted on Windows.

On Windows, xbuild seems to be deleting codegen-backends and other presumably important files before erroring out.

C:\Users\me\source\repos\CustomSdkRustInterop\lib_hello>cargo xbuild --target aarch64-custom-elf.json
    Updating crates.io index
   Compiling core v0.0.0 (C:\Users\me\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libcore)
   Compiling compiler_builtins v0.1.19
   Compiling rustc-std-workspace-core v1.99.0 (C:\Users\me\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\tools\rustc-std-workspace-core)
   Compiling alloc v0.0.0 (C:\Users\me\AppData\Local\Temp\xargo.P3VleUWvqWpF)
    Finished release [optimized] target(s) in 27.84s
error: process didn't exit successfully: `rustc -vV` (exit code: 1)
--- stdout
rustc 1.40.0-nightly (fa0f7d008 2019-10-17)
binary: rustc
commit-hash: fa0f7d0080d8e7e9eb20aa9cbf8013f96c81287f
commit-date: 2019-10-17
host: x86_64-pc-windows-msvc
release: 1.40.0-nightly

--- stderr
error: failed to find a `codegen-backends` folder in the sysroot candidates:
* C:\Users\me\.rustup\toolchains\nightly-x86_64-pc-windows-msvc
* \\?\C:\Users\me\.rustup\toolchains\nightly-x86_64-pc-windows-msvc```

Can "memcpy = false" be passed on the command line?

We have an entire class of binaries that are compiled as staticlibs to be linked against existing intrinsics defintions (in a no_std environment). Do we have to define this in every TOML or can we update our cargo flags on the command line?

Thanks!

Targets fail

(I assume there is a project called xbuild_project and the shell is in it and the target is called "target.json")

cd ..
mv xbuild_project xbuild_project_2
cd xbuild_project_2
# Fails
cargo xbuild --target target.json
cp target.json target2.json
# OK
cargo xbuild --target target2.json

After renaming the target ID seems to be different

cargo build with rust-1.37 has warnings: trait objects without an explicit `dyn` are deprecated

for the moment it's only a warning, but it might be turned into an error in the future.

here's the full build log:

cargo build
  Downloaded error-chain v0.7.2
  Downloaded toml v0.2.1
  Downloaded rustc_version v0.1.7
  Downloaded cargo_metadata v0.5.8
  Downloaded semver v0.1.20
  Downloaded walkdir v1.0.7
  Downloaded same-file v0.1.3
   Compiling proc-macro2 v1.0.3
   Compiling unicode-xid v0.2.0
   Compiling syn v1.0.5
   Compiling libc v0.2.62
   Compiling ryu v1.0.0
   Compiling serde v1.0.100
   Compiling itoa v0.4.4
   Compiling semver-parser v0.7.0
   Compiling remove_dir_all v0.5.2
   Compiling cargo-xbuild v0.5.16 (/tmp/cargo-xbuild)
   Compiling error-chain v0.11.0
   Compiling semver v0.1.20
   Compiling same-file v0.1.3
   Compiling rustc-serialize v0.3.24
   Compiling error-chain v0.7.2
   Compiling walkdir v1.0.7
   Compiling rustc_version v0.1.7
   Compiling quote v1.0.2
   Compiling rand v0.4.6
   Compiling fs2 v0.4.3
   Compiling toml v0.2.1
   Compiling tempdir v0.3.7
   Compiling serde_derive v1.0.100
   Compiling serde_json v1.0.40
   Compiling semver v0.9.0
   Compiling cargo_metadata v0.5.8
warning: trait objects without an explicit `dyn` are deprecated
   --> src/flock.rs:139:11
    |
139 |     try: &Fn() -> io::Result<()>,
    |           ^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Fn() -> io::Result<()>`

warning: trait objects without an explicit `dyn` are deprecated
   --> src/flock.rs:140:13
    |
140 |     block: &Fn() -> io::Result<()>,
    |             ^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Fn() -> io::Result<()>`

    Finished dev [unoptimized + debuginfo] target(s) in 25.92s
´´´

Rustflag --emit

The --emit rustflag doesn't seem to work with xbuild.

emit=link doesn't work at all

echo "$RUSTFLAGS"
--cfg device="qemu-virt" --emit=link=qernel
cargo xbuild --target=aarch64-unknown-none --release
error: output of --print=file-names has changed in the compiler, cannot parse
error: `"cargo" "rustc" "-p" "core" "--release" "--manifest-path" "/tmp/xargo.DrlTynDeIhIV/Cargo.toml" "--target" "aarch64-unknown-none" "--" "--sysroot" "/home/rust/projects/rustos/target/sysroot" "-Z" "force-unstable-if-unmarked"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace

and other options like asm and obj work only by giving a total path or just the file name (placing it next to Cargo.toml)

emit=asm=kernel.s works
emit=asm=/path/to/project/kernel.s works

emit=asm=build/kernel.s doesn't work (yes the folder exist)
emit=asm=/path/to/project/build/kernel.s works (absolute path)

mkdir -p build/aarch64
echo "$RUSTFLAGS"
--cfg device="qemu-virt" --emit=obj=build/qernel
cargo xbuild --target=aarch64-unknown-none --release
   Compiling core v0.0.0 (file:///home/rust/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore)
error: could not copy "/tmp/xargo.fMN1l2xHK0sg/target/aarch64-unknown-none/release/deps/core-f7ee5e0daad9021a.core0.rcgu.o" to "build/qernel": No such file or directory (os error 2)

error: aborting due to previous error

It works with xargo. Any ideas?

Installing xbuild version 0.6.1 on windows is broken

When running the command cargo install cargo-xbuild it will fail to install due to compilation error in flock.rs

error[E0433]: failed to resolve: maybe a missing crate `winapi`?
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:259:9
    |
259 |     use winapi::shared::minwindef::DWORD;
    |         ^^^^^^ maybe a missing crate `winapi`?

error[E0433]: failed to resolve: maybe a missing crate `winapi`?
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:260:9
    |
260 |     use winapi::shared::winerror::{ERROR_INVALID_FUNCTION, ERROR_LOCK_VIOLATION};
    |         ^^^^^^ maybe a missing crate `winapi`?

error[E0433]: failed to resolve: maybe a missing crate `winapi`?
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:261:9
    |
261 |     use winapi::um::fileapi::{LockFileEx, UnlockFile};
    |         ^^^^^^ maybe a missing crate `winapi`?

error[E0433]: failed to resolve: maybe a missing crate `winapi`?
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:262:9
    |
262 |     use winapi::um::minwinbase::{LOCKFILE_EXCLUSIVE_LOCK, LOCKFILE_FAIL_IMMEDIATELY};
    |         ^^^^^^ maybe a missing crate `winapi`?

error[E0425]: cannot find value `LOCKFILE_EXCLUSIVE_LOCK` in this scope
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:269:25
    |
269 |         lock_file(file, LOCKFILE_EXCLUSIVE_LOCK)
    |                         ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `LOCKFILE_FAIL_IMMEDIATELY` in this scope
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:273:25
    |
273 |         lock_file(file, LOCKFILE_FAIL_IMMEDIATELY)
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `LOCKFILE_EXCLUSIVE_LOCK` in this scope
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:277:25
    |
277 |         lock_file(file, LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY)
    |                         ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `LOCKFILE_FAIL_IMMEDIATELY` in this scope
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:277:51
    |
277 |         lock_file(file, LOCKFILE_EXCLUSIVE_LOCK | LOCKFILE_FAIL_IMMEDIATELY)
    |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `ERROR_LOCK_VIOLATION` in this scope
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:282:37
    |
282 |             .map_or(false, |x| x == ERROR_LOCK_VIOLATION as i32)
    |                                     ^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find value `ERROR_INVALID_FUNCTION` in this scope
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:287:37
    |
287 |             .map_or(false, |x| x == ERROR_INVALID_FUNCTION as i32)
    |                                     ^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function, tuple struct or tuple variant `UnlockFile` in this scope
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:292:23
    |
292 |             let ret = UnlockFile(file.as_raw_handle(), 0, 0, !0, !0);
    |                       ^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `DWORD` in this scope
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:301:38
    |
301 |     fn lock_file(file: &File, flags: DWORD) -> Result<()> {
    |                                      ^^^^^ not found in this scope
    |
help: consider importing one of these items
    |
254 |     use flock::io::sys::c::DWORD;
    |
254 |     use flock::io::sys::net::sys_common::backtrace::backtrace_rs::windows::DWORD;
    |

error[E0425]: cannot find function, tuple struct or tuple variant `LockFileEx` in this scope
   --> C:\.cargo\registry\src\github.com-1ecc6299db9ec823\cargo-xbuild-0.6.1\src\flock.rs:304:23
    |
304 |             let ret = LockFileEx(file.as_raw_handle(), flags, 0, !0, !0, &mut overlapped);
    |                       ^^^^^^^^^^ not found in this scope

Version 0.6.0 does install and compile properly

Package metadata only used for first workspace member

I'm trying to specify the sysroot_path to use because I'd like several crates in a workspace to use the same sysroot. cargo-xbuild reads the metadata for the first crate mentioned in the workspace's members, rather than the actual crate being compiled. This can lead to the wrong sysroot_path being used if the first crate has a different sysroot_path from the crate being compiled.

I'm pretty sure https://github.com/rust-osdev/cargo-xbuild/blob/master/src/config.rs#L19 is the offending line, although I'm not familiar with how the appropriate information is passed to cargo subcommands, if at all.

Cargo xbuild failed when linking to high address

I'm trying to build and link my kernel to higher address but cargo xuild emits alots of errors.

rust-lld: error: core.dn6za2s3-cgu.4:(function core::fmt::num::imp::_$LT$impl$u20$core..fmt..Display$u20$for$u20$usize$GT$::fmt::h5a6ad2655a4131f3: .text._ZN4core3fmt3num3imp54_$LT$impl$u20$core..fmt..Display$u20$for$u20$usize$GT$3fmt17h5a6ad2655a4131f3E+0xFB): relocation R_X86_64_32 out of range: 18446603336221277272 is not in [0, 4294967295]
          rust-lld: error: core.dn6za2s3-cgu.4:(function core::fmt::num::imp::_$LT$impl$u20$core..fmt..Display$u20$for$u20$u32$GT$::fmt::hb74b0354b9128009: .text._ZN4core3fmt3num3imp52_$LT$impl$u20$core..fmt..Display$u20$for$u20$u32$GT$3fmt17hb74b0354b9128009E+0xFB): relocation R_X86_64_32 out of range: 18446603336221277272 is not in [0, 4294967295]

Xbuild ignoring the linker config flag

I wrote the following .cargo/config file for an arm-none-eabi target

[target.arm-none-eabi]
linker = "arm-none-eabi-gcc"
rustflags = [
  "-C", "target-cpu=cortex-a8",
]

When i run cargo xbuild --target=arm-none-eabi.json it fails because it tries to link everything together with the cc linker. However when i insert "-C", "linker=arm-none-eabi-gcc" as follows

[target.arm-none-eabi]
rustflags = [
  "-C", "target-cpu=cortex-a8",
  "-C", "linker=arm-none-eabi-gcc"
]

It does use the arm-none-eabi-gcc linker correctly. Is xbuild actually just ignoring the linker flag (on purpose or without?) or am I supposed to do define the linker in a different way. If this actually turns out to be a bug with xbuild I'd happily try to add a fix so it picks up the linker flag.

extern crate alloc required?

I am currently getting the following error:

error[E0432]: unresolved import `alloc`
 --> src/rust2c.rs:5:5
  |
5 | use alloc::format;
  |     ^^^^^ did you mean `cstr_core::alloc`?

error: cannot determine resolution for the macro `format`
  --> src/rust2c.rs:11:28
   |
11 |     let msg = CString::new(format!("HELLO! {}", x)).unwrap();
   |                            ^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `krust`.

If I add extern crate alloc, then everything compiles just fine. Is this intentional?

Still need `extern crate` when using Rust 2018

I recently ported some of our OS code to Rust 2018 and then a binary crate depending on a library crate does not compile if I remove the extern crate statement from it's main. The same example works when not cross-compiling (with a normal cargo build) so I guess it is something with the way cargo-xbuild works.

The error I get is this

  |                                                                                                                                                                                                                                                                                                                                    
7 | use salmiak::gpu;                                                                                                                                                                                                                                                                                                                  
  |     ^^^^^^^ Maybe a missing `extern crate salmiak;`?

How to use a custom std

xbuild currently compiles core and alloc and puts in the custom sysroot. Is it possible to put a custom std in that location and compile it?

The idea is that we can provide a minimal custom std so that crates that need std can be compiled without changing their code.

How to build *compiler_builtins* in optimized mode

Hi,

When we run cargo xbuild --release ... --target x86_64-kernel.json, the memcpy being compiled is just a simple un-optimized for-loop. Looking at the source code, I think xargo builds sysroot crates in release mode by default.

I think there's something else in our settings that prevents xargo from building an optimized compiler_builtins but I am not sure what am I missing. We borrowed some of the setups, including the target.json, from Writing an OS in Rust.

TARGET in build.rs is invalid

When using a full path to json file as cargo-xbuild --target argument, the resulting TARGET is not a triple but instead a full file path. I believe it should be a triple.

According to cargo book:

TARGET - the target triple that is being compiled for. Native code should be compiled for this triple.

What I'm getting:

λ cargo xbuild --target=targets/aarch64-vesper-metta.json
   Compiling vesper v1.0.0 (/path/to/vesper)
error: failed to run custom build command for `vesper v1.0.0 (/path/to/vesper)`
process didn't exit successfully: `/path/to/vesper/target/debug/build/vesper-6432e1d623b2c988/build-script-build` (exit code: 101)
--- stderr
Target /path/to/vesper/targets/aarch64-vesper-metta.json
thread 'main' panicked at 'TARGET env variable is not set to one of supported values', build.rs:43:9

The line Target /path/to/vesper/targets/aarch64-vesper-metta.json is output by build.rs from the TARGET env var.

Build script using std can't compile

I'm trying to use a build.rs file with the cc crate to compile C code as part of a library I'm using in my OS. This doesn't seem to work when used with cargo-xbuild as the std crate doesn't exist in the sysroot:

$ env RUST_TARGET_PATH="/home/user/code/rust/0x52a1/polymorphos/splatform/splatform_i686/" cargo xbuild --target=i686-unknown-polymorphos-elf

   Compiling libc v0.2.42
   Compiling dmm v0.1.0 (file:///home/user/code/rust/0x52a1/polymorphos/dmm)
error[E0463]: can't find crate for `std`=====================>         ] 32/38: libc, dmm                                                                                                                                                                                              
  |
  = note: the `i686-unknown-polymorphos-elf` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: Could not compile `libc`.
warning: build failed, waiting for other jobs to finish...
error: build failed

Is there a way to make the build script compilation use the host's target and default sysroot (so that the build script can actually do it's job), and then use the target passed to cargo-xbuild and the newly built sysroot for the compilation of the crate itself?

Building core with the feature panic_immediate_abort

Hi,

I'd like to know if it is possible to compile the core library with the feature panic_immediate_abort. If I am not mistaken, this feature is not activated by default when the library is compiled. What I need is for the code not to call the panic hook but directly generate an abort that lowers to an illegal instruction or trap.

I tried to use the RUSTFLAGS tag:

export RUSTFLAGS=--cfg features="panic_immediate_abort"

but it has not worked, as it is apparently not used when compiling sysroot, but only when generating the final library.

I don't know if I'm doing anything wrong. Thanks in advance!

xbuild ignores .cargo/config for sysroot crates.

Hi,

for the following description please refer to an example uploaded to https://github.com/rust-embedded/rust-raspi3-tutorial/tree/no_float/float_reg_emission

This example should be buildable with a recent nightly rust and just executing make.

The project uses the aarch64-unknown-none target, and has additional rustflags in .cargo/config. However, it seems that xbuild is ignoring the contents of .cargo/config when it builds the sysroot crates.

In the example uploaded, it is set that no hard-float code should be emitted (-fp-armv8). This is honored for the actual crate being compiled, but not for the sysroot.

Here's a dissasembly of the emitted code where you can see that with xbuild, an ARM floating point register (q0) is being emitted:

core::panicking::panic_fmt::h7472082024a4b065:
   80218:       20 00 c0 3d     ldr     q0, [x1]
   8021c:       28 08 40 f9     ldr     x8, [x1, #0x10]
   80220:       09 00 00 b0     adrp    x9, #0x1000
   80224:       0a 00 00 b0     adrp    x10, #0x1000
   80228:       29 a1 15 91     add     x9, x9, #0x568
   8022c:       4a a1 15 91     add     x10, x10, #0x568
   80230:       e9 2b bd a9     stp     x9, x10, [sp, #-0x30]!
   80234:       e0 0b 00 f9     str     x0, [sp, #0x10]
   80238:       e0 03 00 91     mov     x0, sp
   8023c:       e0 83 81 3c     stur    q0, [sp, #0x18]
   80240:       e8 17 00 f9     str     x8, [sp, #0x28]
   80244:       58 00 00 94     bl      #0x160 <rust_begin_unwind>
   80248:       20 00 20 d4     brk     #0x1

Using xargo within the same example, this doesn't happen:

xargo build --target=aarch64-unknown-none --release
cp target/aarch64-unknown-none/release/kernel8 .
make objdump

No float regs here:

core::panicking::panic_fmt::h4f28b4483e5ece01:
   80224:       08 00 00 b0     adrp    x8, #0x1000
   80228:       08 21 16 91     add     x8, x8, #0x588
   8022c:       e8 0f 1d f8     str     x8, [sp, #-0x30]!
   80230:       0a 00 00 b0     adrp    x10, #0x1000
   80234:       4a 21 16 91     add     x10, x10, #0x588
   80238:       28 24 40 a9     ldp     x8, x9, [x1]
   8023c:       ea 83 00 a9     stp     x10, x0, [sp, #0x8]
   80240:       e0 03 00 91     mov     x0, sp
   80244:       2a 2c 42 29     ldp     w10, w11, [x1, #0x10]
   80248:       e8 a7 01 a9     stp     x8, x9, [sp, #0x18]
   8024c:       ea 2f 05 29     stp     w10, w11, [sp, #0x28]
   80250:       59 00 00 94     bl      #0x164 <rust_begin_unwind>
   80254:       20 00 20 d4     brk     #0x1

v0.6.0 error: `rust-src` component not found

I have updated from v0.5.35 to v0.6.0, and 'cargo xbuild' is now throwing 'error: rust_src component not found.'

My --target is aarch64-unknown-none-softfloat.

v0.5.35 does not throw that error for me.

Here's some relevant info that might be useful.

rustup 1.22.1
rustc 1.47.0-nightly (2020-07-26)
cargo 1.47.0-nightly (2020-07-23)

the package `alloc` depends on `compiler_builtins`, with features: `rustc-std-workspace-core` but `compiler_builtins` does not have these features.

error: failed to select a version for `compiler_builtins`.
    ... required by package `alloc v0.0.0 (/tmp/xargo.en5SPpyhVIGT)`
versions that meet the requirements `^0.1.0` are: 0.1.23, 0.1.22, 0.1.21, 0.1.20, 0.1.19, 0.1.18, 0.1.17, 0.1.16, 0.1.15, 0.1.14, 0.1.13, 0.1.12, 0.1.11, 0.1.10, 0.1.9, 0.1.8, 0.1.7, 0.1.6, 0.1.5, 0.1.4, 0.1.3, 0.1.2, 0.1.1, 0.1.0

the package `alloc` depends on `compiler_builtins`, with features: `rustc-std-workspace-core` but `compiler_builtins` does not have these features.


failed to select a version for `compiler_builtins` which could resolve this conflict
error: `"/home/schrodinger/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo" "/home/schrodinger/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/tmp/xargo.en5SPpyhVIGT/Cargo.toml" "--target" "/home/schrodinger/CLionProject/toylibc/target.json" "--" "-Z" "force-unstable-if-unmarked"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace

xbuild on Windows with git bash using gnu linker when msvc linker unavailable

Recently, I accidentally uninstalled MSVC tooling on my windows machine unknowingly. This removed the MSVC linker, which (I believe) xbuild normally tries to use. Because I am using git bash, there is an included linker in the shell, which was used instead, and made builds fail.
Untitled-1.txt
This massive error message is what resulted. It was extremely hard to find out what was wrong, and I ended up having to reinstall xbuild, rust, all my toolchains, etc. Would it be possible to add some sort of check to ensure that the user knows the issue? This massive linker error dump is not useful at all.

Builds with same target specification are not equivalent

The problem manifests when specifying the target in two different, but equivalent ways; which are then treated as non-equivalent by tooling:

Case 1

cargo xbuild --target=/path/to/vesper/targets/aarch64-vesper-metta.json

Case 2

set -x RUST_TARGET_PATH /path/to/vesper/targets/
cargo xbuild --target=aarch64-vesper-metta

The target points at the same file in the end, however, when building with the first command line and then switching to a second one, the tooling fails with:

   Compiling vesper v1.0.0 (/path/to/vesper)
error[E0461]: couldn't find crate `core` with expected target triple aarch64-vesper-metta
  |
  = note: the following crate versions were found:
          crate `core`, target triple aarch64-vesper-metta-16905780947483449836: /path/to/vesper/target/sysroot/lib/rustlib/aarch64-vesper-metta/lib/libcore-c3c957affa35580f.rlib

error: aborting due to previous error

After cargo clean the rebuild succeeds.

It seems that fingerprints are calculated entirely differently, while they should be the same.

`cargo install cargo-xbuild` fails with noexec /tmp mount

There are many systems out there with a noexec /tmp mount. The current cargo install cargo-xbuild will fail to work on all of them.

$ mount | fgrep /tmp
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec,noatime)

$ cargo install cargo-xbuild
    Updating crates.io index
  Downloaded cargo-xbuild v0.6.0
  Downloaded 1 crate (32.6 KB) in 1.50s
  Installing cargo-xbuild v0.6.0
  Downloaded tempfile v3.1.0
  Downloaded toml v0.5.6
  Downloaded version_check v0.9.2
  Downloaded error-chain v0.12.4
  Downloaded fs2 v0.4.3
  Downloaded remove_dir_all v0.5.3
  Downloaded ppv-lite86 v0.2.9
  Downloaded getrandom v0.1.14
  Downloaded rand_chacha v0.2.2
  Downloaded rand v0.7.3
  Downloaded rand_core v0.5.1
  Downloaded syn v1.0.39
  Downloaded cargo_metadata v0.9.1
  Downloaded 13 crates (575.6 KB) in 1.21s
   Compiling libc v0.2.76
   Compiling serde v1.0.115
   Compiling proc-macro2 v1.0.19
   Compiling getrandom v0.1.14
   Compiling unicode-xid v0.2.1
   Compiling cfg-if v0.1.10
   Compiling syn v1.0.39
   Compiling ryu v1.0.5
   Compiling serde_json v1.0.57
   Compiling serde_derive v1.0.115
   Compiling ppv-lite86 v0.2.9
   Compiling version_check v0.9.2
   Compiling semver-parser v0.7.0
   Compiling itoa v0.4.6
   Compiling cargo-xbuild v0.6.0
   Compiling same-file v1.0.6
   Compiling remove_dir_all v0.5.3
error: failed to run custom build command for `getrandom v0.1.14`

Caused by:
  could not execute process `/tmp/cargo-install0JhqDB/release/build/getrandom-ac71bc84a3ffb541/build-script-build` (never executed)

Caused by:
  Permission denied (os error 13)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-xbuild v0.6.0`, intermediate artifacts can be found at `/tmp/cargo-install0JhqDB`

Caused by:
  build failed

Cargo xbuild fails to compile alloc on 1.33.0-nightly

I tried to use cargo-xbuild today, and am finding that it can't do the minimum case.
If I create a new binary (just cargo new one) and then cargo xbuild for my native target, it fails while trying to compile alloc.

Version:

$ rustc --version
rustc 1.33.0-nightly (ceb251214 2019-01-16)
$ cargo --version
cargo 1.33.0-nightly (2b4a5f1f0 2019-01-12)
Massive error log…
$ cargo xbuild
    Updating crates.io index
   Compiling compiler_builtins v0.1.5
   Compiling core v0.0.0 (/Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/libcore)
   Compiling rustc-std-workspace-core v1.0.0 (/Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/tools/rustc-std-workspace-core)
   Compiling alloc v0.0.0 (/var/folders/6f/l9rcfr1d2s55xy9vd6rtnvv00000gn/T/xargo.5t16SLxIxhfA)
error[E0432]: unresolved import `sync`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/task.rs:14:9
   |
14 |     use sync::Arc;
   |         ^^^^ did you mean `crate::sync`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `str`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/boxed.rs:78:5
   |
78 | use str::from_boxed_utf8_unchecked;
   |     ^^^ did you mean `crate::str`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `alloc`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/btree/node.rs:39:5
   |
39 | use alloc::{Global, Alloc, Layout};
   |     ^^^^^ did you mean `crate::alloc`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `boxed`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/btree/node.rs:40:5
   |
40 | use boxed::Box;
   |     ^^^^^ did you mean `crate::boxed`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `borrow`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/prelude.rs:15:57
   |
15 | #[unstable(feature = "alloc", issue = "27783")] pub use borrow::ToOwned;
   |                                                         ^^^^^^ did you mean `crate::borrow`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `boxed`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/prelude.rs:16:57
   |
16 | #[unstable(feature = "alloc", issue = "27783")] pub use boxed::Box;
   |                                                         ^^^^^ did you mean `crate::boxed`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `slice`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/prelude.rs:17:57
   |
17 | #[unstable(feature = "alloc", issue = "27783")] pub use slice::SliceConcatExt;
   |                                                         ^^^^^ did you mean `crate::slice`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `string`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/prelude.rs:18:57
   |
18 | #[unstable(feature = "alloc", issue = "27783")] pub use string::{String, ToString};
   |                                                         ^^^^^^ did you mean `crate::string`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `vec`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/prelude.rs:19:57
   |
19 | #[unstable(feature = "alloc", issue = "27783")] pub use vec::Vec;
   |                                                         ^^^ did you mean `crate::vec`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `string`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/fmt.rs:530:5
    |
530 | use string;
    |     ^^^^^^ no `string` external crate

error[E0432]: unresolved import `boxed`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/slice.rs:140:9
    |
140 |     use boxed::Box;
    |         ^^^^^ did you mean `crate::boxed`?
    |
    = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `vec`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/slice.rs:145:9
    |
145 |     use vec::Vec;
    |         ^^^ did you mean `crate::vec`?
    |
    = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `borrow`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/str.rs:40:5
   |
40 | use borrow::{Borrow, ToOwned};
   |     ^^^^^^ did you mean `crate::borrow`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `boxed`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/str.rs:41:5
   |
41 | use boxed::Box;
   |     ^^^^^ did you mean `crate::boxed`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `slice`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/str.rs:42:5
   |
42 | use slice::{SliceConcatExt, SliceIndex};
   |     ^^^^^ did you mean `crate::slice`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `string`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/str.rs:43:5
   |
43 | use string::String;
   |     ^^^^^^ did you mean `crate::string`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `vec`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/str.rs:44:5
   |
44 | use vec::Vec;
   |     ^^^ did you mean `crate::vec`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `str`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/string.rs:62:5
   |
62 | use str::{self, from_boxed_utf8_unchecked, FromStr, Utf8Error, Chars};
   |     ^^^ did you mean `crate::str`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `borrow`
 --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/btree/search.rs:3:5
  |
3 | use borrow::Borrow;
  |     ^^^^^^ did you mean `crate::borrow`?
  |
  = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `slice`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:154:5
    |
154 | use slice;
    |     ^^^^^ no `slice` external crate

error[E0432]: unresolved import `vec`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:155:11
    |
155 | use vec::{self, Vec};
    |           ^^^^ no `vec` external crate

error[E0432]: unresolved import `borrow`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/btree/map.rs:11:5
   |
11 | use borrow::Borrow;
   |     ^^^^^^ did you mean `crate::borrow`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `borrow`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/btree/set.rs:11:5
   |
11 | use borrow::Borrow;
   |     ^^^^^^ did you mean `crate::borrow`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0433]: failed to resolve: use of undeclared type or module `collections`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/btree/set.rs:12:5
   |
12 | use collections::btree_map::{self, BTreeMap, Keys};
   |     ^^^^^^^^^^^ use of undeclared type or module `collections`

error[E0432]: unresolved import `collections`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/btree/set.rs:12:5
   |
12 | use collections::btree_map::{self, BTreeMap, Keys};
   |     ^^^^^^^^^^^ did you mean `crate::collections`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `boxed`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/linked_list.rs:23:5
   |
23 | use boxed::Box;
   |     ^^^^^ did you mean `crate::boxed`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `collections`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/vec_deque.rs:23:5
   |
23 | use collections::CollectionAllocErr;
   |     ^^^^^^^^^^^ did you mean `crate::collections`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `raw_vec`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/vec_deque.rs:24:5
   |
24 | use raw_vec::RawVec;
   |     ^^^^^^^ did you mean `crate::raw_vec`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `vec`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/vec_deque.rs:25:5
   |
25 | use vec::Vec;
   |     ^^^ did you mean `crate::vec`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `alloc`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/mod.rs:44:5
   |
44 | use alloc::{AllocErr, LayoutErr};
   |     ^^^^^ did you mean `crate::alloc`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `alloc`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/sync.rs:26:5
   |
26 | use alloc::{Global, Alloc, Layout, box_free, handle_alloc_error};
   |     ^^^^^ did you mean `crate::alloc`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `boxed`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/sync.rs:27:5
   |
27 | use boxed::Box;
   |     ^^^^^ did you mean `crate::boxed`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `rc`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/sync.rs:28:5
   |
28 | use rc::is_dangling;
   |     ^^ did you mean `crate::rc`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `string`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/sync.rs:29:5
   |
29 | use string::String;
   |     ^^^^^^ did you mean `crate::string`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `vec`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/sync.rs:30:5
   |
30 | use vec::Vec;
   |     ^^^ did you mean `crate::vec`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `boxed`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/rc.rs:232:5
    |
232 | use boxed::Box;
    |     ^^^^^ did you mean `crate::boxed`?
    |
    = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `alloc`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/rc.rs:253:5
    |
253 | use alloc::{Global, Alloc, Layout, box_free, handle_alloc_error};
    |     ^^^^^ did you mean `crate::alloc`?
    |
    = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `string`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/rc.rs:254:5
    |
254 | use string::String;
    |     ^^^^^^ did you mean `crate::string`?
    |
    = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0433]: failed to resolve: use of undeclared type or module `collections`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:12:5
   |
12 | use collections::CollectionAllocErr::*;
   |     ^^^^^^^^^^^ use of undeclared type or module `collections`

error[E0432]: unresolved import `vec`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/rc.rs:255:5
    |
255 | use vec::Vec;
    |     ^^^ did you mean `crate::vec`?
    |
    = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `fmt`
 --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/borrow.rs:9:5
  |
9 | use fmt;
  |     ^^^ no `fmt` external crate

error[E0432]: unresolved import `string`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/borrow.rs:10:5
   |
10 | use string::String;
   |     ^^^^^^ did you mean `crate::string`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `borrow`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/slice.rs:96:5
   |
96 | use borrow::{Borrow, BorrowMut, ToOwned};
   |     ^^^^^^ did you mean `crate::borrow`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `boxed`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/slice.rs:97:5
   |
97 | use boxed::Box;
   |     ^^^^^ did you mean `crate::boxed`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `vec`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/slice.rs:98:5
   |
98 | use vec::Vec;
   |     ^^^ did you mean `crate::vec`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `collections`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/string.rs:59:5
   |
59 | use collections::CollectionAllocErr;
   |     ^^^^^^^^^^^ did you mean `crate::collections`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `borrow`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/string.rs:60:5
   |
60 | use borrow::{Cow, ToOwned};
   |     ^^^^^^ did you mean `crate::borrow`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `boxed`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/string.rs:61:5
   |
61 | use boxed::Box;
   |     ^^^^^ did you mean `crate::boxed`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `vec`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/string.rs:63:5
   |
63 | use vec::Vec;
   |     ^^^ did you mean `crate::vec`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `collections`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/vec.rs:73:5
   |
73 | use collections::CollectionAllocErr;
   |     ^^^^^^^^^^^ did you mean `crate::collections`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `borrow`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/vec.rs:74:5
   |
74 | use borrow::ToOwned;
   |     ^^^^^^ did you mean `crate::borrow`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `borrow`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/vec.rs:75:5
   |
75 | use borrow::Cow;
   |     ^^^^^^ did you mean `crate::borrow`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `boxed`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/vec.rs:76:5
   |
76 | use boxed::Box;
   |     ^^^^^ did you mean `crate::boxed`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `raw_vec`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/vec.rs:77:5
   |
77 | use raw_vec::RawVec;
   |     ^^^^^^^ did you mean `crate::raw_vec`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `vec`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/boxed.rs:76:5
   |
76 | use vec::Vec;
   |     ^^^ did you mean `crate::vec`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0432]: unresolved import `raw_vec`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/boxed.rs:77:5
   |
77 | use raw_vec::RawVec;
   |     ^^^^^^^ did you mean `crate::raw_vec`?
   |
   = note: `use` statements changed in Rust 2018; read more at <https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html>

error[E0433]: failed to resolve: use of undeclared type or module `Vec`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:332:28
    |
332 |         BinaryHeap { data: Vec::with_capacity(capacity) }
    |                            ^^^ use of undeclared type or module `Vec`

error[E0433]: failed to resolve: use of undeclared type or module `BTreeMap`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/btree/set.rs:218:25
    |
218 |         BTreeSet { map: BTreeMap::new() }
    |                         ^^^^^^^^ use of undeclared type or module `BTreeMap`

error[E0433]: failed to resolve: use of undeclared type or module `Layout`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:92:30
   |
92 |                 let layout = Layout::from_size_align(alloc_size, align).unwrap();
   |                              ^^^^^^ use of undeclared type or module `Layout`

error[E0433]: failed to resolve: use of undeclared type or module `Layout`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:232:22
    |
232 |                 Some(Layout::from_size_align_unchecked(size, align))
    |                      ^^^^^^ use of undeclared type or module `Layout`

error[E0433]: failed to resolve: use of undeclared type or module `Layout`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:316:29
    |
316 |                             Layout::from_size_align_unchecked(new_size, cur.align())
    |                             ^^^^^^ use of undeclared type or module `Layout`

error[E0433]: failed to resolve: use of undeclared type or module `Layout`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:326:54
    |
326 |                         Err(_) => handle_alloc_error(Layout::array::<T>(new_cap).unwrap()),
    |                                                      ^^^^^^ use of undeclared type or module `Layout`

error[E0433]: failed to resolve: use of undeclared type or module `Layout`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:540:30
    |
540 |             let new_layout = Layout::new::<T>().repeat(new_cap).unwrap().0;
    |                              ^^^^^^ use of undeclared type or module `Layout`

error[E0433]: failed to resolve: use of undeclared type or module `Layout`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:604:34
    |
604 |                 let old_layout = Layout::from_size_align_unchecked(old_size, align);
    |                                  ^^^^^^ use of undeclared type or module `Layout`

error[E0433]: failed to resolve: use of undeclared type or module `Layout`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:610:25
    |
610 |                         Layout::from_size_align_unchecked(new_size, align)
    |                         ^^^^^^ use of undeclared type or module `Layout`

error[E0433]: failed to resolve: use of undeclared type or module `Layout`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:660:30
    |
660 |             let new_layout = Layout::array::<T>(new_cap).map_err(|_| CapacityOverflow)?;
    |                              ^^^^^^ use of undeclared type or module `Layout`

error[E0433]: failed to resolve: use of undeclared type or module `Box`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:698:32
    |
698 |         let output: Box<[T]> = Box::from_raw(slice);
    |                                ^^^ use of undeclared type or module `Box`

error[E0412]: cannot find type `Vec` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:212:11
    |
212 |     data: Vec<T>,
    |           ^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
148 | use crate::vec::Vec;
    |

error[E0412]: cannot find type `Vec` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:594:30
    |
594 |     pub fn into_vec(self) -> Vec<T> {
    |                              ^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
148 | use crate::vec::Vec;
    |

error[E0412]: cannot find type `Vec` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:616:41
    |
616 |     pub fn into_sorted_vec(mut self) -> Vec<T> {
    |                                         ^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
148 | use crate::vec::Vec;
    |

error[E0412]: cannot find type `Vec` in this scope
    --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:1086:19
     |
1086 | impl<T: Ord> From<Vec<T>> for BinaryHeap<T> {
     |                   ^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
     |
148  | use crate::vec::Vec;
     |

error[E0412]: cannot find type `Vec` in this scope
    --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:1087:18
     |
1087 |     fn from(vec: Vec<T>) -> BinaryHeap<T> {
     |                  ^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
     |
148  | use crate::vec::Vec;
     |

error[E0412]: cannot find type `Vec` in this scope
    --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:1095:33
     |
1095 | impl<T> From<BinaryHeap<T>> for Vec<T> {
     |                                 ^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
     |
148  | use crate::vec::Vec;
     |

error[E0412]: cannot find type `Vec` in this scope
    --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:1096:37
     |
1096 |     fn from(heap: BinaryHeap<T>) -> Vec<T> {
     |                                     ^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
     |
148  | use crate::vec::Vec;
     |

error[E0412]: cannot find type `Vec` in this scope
    --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:1104:53
     |
1104 |         BinaryHeap::from(iter.into_iter().collect::<Vec<_>>())
     |                                                     ^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
     |
148  | use crate::vec::Vec;
     |

error[E0412]: cannot find type `BTreeMap` in this scope
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/btree/set.rs:63:10
   |
63 |     map: BTreeMap<T, ()>,
   |          ^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
   |
4  | use crate::collections::btree::map::BTreeMap;
   |

error[E0412]: cannot find type `Keys` in this scope
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/btree/set.rs:75:11
   |
75 |     iter: Keys<'a, T, ()>,
   |           ^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
   |
4  | use crate::collections::btree::map::Keys;
   |

error[E0405]: cannot find trait `Alloc` in this scope
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:43:25
   |
43 | pub struct RawVec<T, A: Alloc = Global> {
   |                         ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
   |
4  | use core::alloc::Alloc;
   |
4  | use core::alloc::Alloc;
   |

error[E0412]: cannot find type `Global` in this scope
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:43:33
   |
43 | pub struct RawVec<T, A: Alloc = Global> {
   |                                 ^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
   |
4  | use crate::alloc::Global;
   |

error[E0405]: cannot find trait `Alloc` in this scope
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:49:12
   |
49 | impl<T, A: Alloc> RawVec<T, A> {
   |            ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
   |
4  | use core::alloc::Alloc;
   |
4  | use core::alloc::Alloc;
   |

error[E0425]: cannot find function `handle_alloc_error` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:100:31
    |
100 |                     Err(_) => handle_alloc_error(layout),
    |                               ^^^^^^^^^^^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::alloc::handle_alloc_error;
    |

error[E0412]: cannot find type `Global` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:113:19
    |
113 | impl<T> RawVec<T, Global> {
    |                   ^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::alloc::Global;
    |

error[E0425]: cannot find value `Global` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:120:22
    |
120 |         Self::new_in(Global)
    |                      ^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::alloc::Global;
    |

error[E0425]: cannot find value `Global` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:140:41
    |
140 |         RawVec::allocate_in(cap, false, Global)
    |                                         ^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::alloc::Global;
    |

error[E0425]: cannot find value `Global` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:146:40
    |
146 |         RawVec::allocate_in(cap, true, Global)
    |                                        ^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::alloc::Global;
    |

error[E0405]: cannot find trait `Alloc` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:150:12
    |
150 | impl<T, A: Alloc> RawVec<T, A> {
    |            ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
    |
4   | use core::alloc::Alloc;
    |
4   | use core::alloc::Alloc;
    |

error[E0412]: cannot find type `Global` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:167:19
    |
167 | impl<T> RawVec<T, Global> {
    |                   ^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::alloc::Global;
    |

error[E0425]: cannot find value `Global` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:179:16
    |
179 |             a: Global,
    |                ^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::alloc::Global;
    |

error[E0412]: cannot find type `Box` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:184:32
    |
184 |     pub fn from_box(mut slice: Box<[T]>) -> Self {
    |                                ^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::boxed::Box;
    |

error[E0405]: cannot find trait `Alloc` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:193:12
    |
193 | impl<T, A: Alloc> RawVec<T, A> {
    |            ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
    |
4   | use core::alloc::Alloc;
    |
4   | use core::alloc::Alloc;
    |

error[E0412]: cannot find type `Layout` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:223:40
    |
223 |     fn current_layout(&self) -> Option<Layout> {
    |                                        ^^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
    |
4   | use core::alloc::Layout;
    |
4   | use core::alloc::Layout;
    |

error[E0425]: cannot find function `handle_alloc_error` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:315:35
    |
315 |                         Err(_) => handle_alloc_error(
    |                                   ^^^^^^^^^^^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::alloc::handle_alloc_error;
    |

error[E0425]: cannot find function `handle_alloc_error` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:326:35
    |
326 |                         Err(_) => handle_alloc_error(Layout::array::<T>(new_cap).unwrap()),
    |                                   ^^^^^^^^^^^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::alloc::handle_alloc_error;
    |

error[E0412]: cannot find type `CollectionAllocErr` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:386:26
    |
386 |            -> Result<(), CollectionAllocErr> {
    |                          ^^^^^^^^^^^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::collections::CollectionAllocErr;
    |

error[E0412]: cannot find type `CollectionAllocErr` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:423:26
    |
423 |         -> Result<usize, CollectionAllocErr> {
    |                          ^^^^^^^^^^^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::collections::CollectionAllocErr;
    |

error[E0425]: cannot find value `CapacityOverflow` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:426:73
    |
426 |         let required_cap = used_cap.checked_add(needed_extra_cap).ok_or(CapacityOverflow)?;
    |                                                                         ^^^^^^^^^^^^^^^^
help: a function with a similar name exists
    |
426 |         let required_cap = used_cap.checked_add(needed_extra_cap).ok_or(capacity_overflow)?;
    |                                                                         ^^^^^^^^^^^^^^^^^
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::collections::CollectionAllocErr::CapacityOverflow;
    |

error[E0412]: cannot find type `CollectionAllocErr` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:435:23
    |
435 |         -> Result<(), CollectionAllocErr> {
    |                       ^^^^^^^^^^^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::collections::CollectionAllocErr;
    |

error[E0425]: cannot find function `handle_alloc_error` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:609:31
    |
609 |                     Err(_) => handle_alloc_error(
    |                               ^^^^^^^^^^^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::alloc::handle_alloc_error;
    |

error[E0405]: cannot find trait `Alloc` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:633:12
    |
633 | impl<T, A: Alloc> RawVec<T, A> {
    |            ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
    |
4   | use core::alloc::Alloc;
    |
4   | use core::alloc::Alloc;
    |

error[E0412]: cannot find type `CollectionAllocErr` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:640:21
    |
640 |     ) -> Result<(), CollectionAllocErr> {
    |                     ^^^^^^^^^^^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::collections::CollectionAllocErr;
    |

error[E0425]: cannot find value `CapacityOverflow` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:657:71
    |
657 |                 Exact => used_cap.checked_add(needed_extra_cap).ok_or(CapacityOverflow)?,
    |                                                                       ^^^^^^^^^^^^^^^^
help: a function with a similar name exists
    |
657 |                 Exact => used_cap.checked_add(needed_extra_cap).ok_or(capacity_overflow)?,
    |                                                                       ^^^^^^^^^^^^^^^^^
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::collections::CollectionAllocErr::CapacityOverflow;
    |

error[E0425]: cannot find value `CapacityOverflow` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:660:70
    |
660 |             let new_layout = Layout::array::<T>(new_cap).map_err(|_| CapacityOverflow)?;
    |                                                                      ^^^^^^^^^^^^^^^^
help: a function with a similar name exists
    |
660 |             let new_layout = Layout::array::<T>(new_cap).map_err(|_| capacity_overflow)?;
    |                                                                      ^^^^^^^^^^^^^^^^^
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::collections::CollectionAllocErr::CapacityOverflow;
    |

error[E0425]: cannot find function `handle_alloc_error` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:673:48
    |
673 |                 (Err(AllocErr), Infallible) => handle_alloc_error(new_layout),
    |                                                ^^^^^^^^^^^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::alloc::handle_alloc_error;
    |

error[E0412]: cannot find type `Global` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:686:19
    |
686 | impl<T> RawVec<T, Global> {
    |                   ^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::alloc::Global;
    |

error[E0412]: cannot find type `Box` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:695:37
    |
695 |     pub unsafe fn into_box(self) -> Box<[T]> {
    |                                     ^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::boxed::Box;
    |

error[E0412]: cannot find type `Box` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:698:21
    |
698 |         let output: Box<[T]> = Box::from_raw(slice);
    |                     ^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::boxed::Box;
    |

error[E0405]: cannot find trait `Alloc` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:704:12
    |
704 | impl<T, A: Alloc> RawVec<T, A> {
    |            ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
    |
4   | use core::alloc::Alloc;
    |
4   | use core::alloc::Alloc;
    |

error[E0405]: cannot find trait `Alloc` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:716:33
    |
716 | unsafe impl<#[may_dangle] T, A: Alloc> Drop for RawVec<T, A> {
    |                                 ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
    |
4   | use core::alloc::Alloc;
    |
4   | use core::alloc::Alloc;
    |

error[E0412]: cannot find type `CollectionAllocErr` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:735:49
    |
735 | fn alloc_guard(alloc_size: usize) -> Result<(), CollectionAllocErr> {
    |                                                 ^^^^^^^^^^^^^^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::collections::CollectionAllocErr;
    |

error[E0425]: cannot find value `CapacityOverflow` in this scope
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:737:13
    |
737 |         Err(CapacityOverflow)
    |             ^^^^^^^^^^^^^^^^
help: a function with a similar name exists
    |
737 |         Err(capacity_overflow)
    |             ^^^^^^^^^^^^^^^^^
help: possible candidate is found in another module, you can import it into scope
    |
4   | use crate::collections::CollectionAllocErr::CapacityOverflow;
    |

error[E0659]: `vec` is ambiguous (`macro_rules` vs non-`macro_rules` from other module)
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:313:28
    |
313 |         BinaryHeap { data: vec![] }
    |                            ^^^ ambiguous name
    |
note: `vec` could refer to the macro defined here
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/macros.rs:38:1
    |
38  | / macro_rules! vec {
39  | |     ($elem:expr; $n:expr) => (
40  | |         $crate::vec::from_elem($elem, $n)
41  | |     );
...   |
45  | |     ($($x:expr,)*) => (vec![$($x),*])
46  | | }
    | |_^
note: `vec` could also refer to the unresolved item imported here
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:155:11
    |
155 | use vec::{self, Vec};
    |           ^^^^
    = help: use `self::vec` to refer to this unresolved item unambiguously

warning: unused import: `Vec`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/binary_heap.rs:155:17
    |
155 | use vec::{self, Vec};
    |                 ^^^
    |
    = note: #[warn(unused_imports)] on by default

warning: unused import: `Alloc`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/btree/node.rs:39:21
   |
39 | use alloc::{Global, Alloc, Layout};
   |                     ^^^^^

warning: unused imports: `BTreeMap`, `Keys`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/collections/btree/set.rs:12:36
   |
12 | use collections::btree_map::{self, BTreeMap, Keys};
   |                                    ^^^^^^^^  ^^^^

warning: unused import: `Alloc`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/sync.rs:26:21
   |
26 | use alloc::{Global, Alloc, Layout, box_free, handle_alloc_error};
   |                     ^^^^^

warning: unused import: `Alloc`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/rc.rs:253:21
    |
253 | use alloc::{Global, Alloc, Layout, box_free, handle_alloc_error};
    |                     ^^^^^

warning: unused imports: `Alloc`, `Global`, `Layout`, `handle_alloc_error`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:10:13
   |
10 | use alloc::{Alloc, Layout, Global, handle_alloc_error};
   |             ^^^^^  ^^^^^^  ^^^^^^  ^^^^^^^^^^^^^^^^^^

warning: unused import: `collections::CollectionAllocErr`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:11:5
   |
11 | use collections::CollectionAllocErr;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `collections::CollectionAllocErr::*`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:12:5
   |
12 | use collections::CollectionAllocErr::*;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `boxed::Box`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:13:5
   |
13 | use boxed::Box;
   |     ^^^^^^^^^^

warning: unused import: `alloc::AllocErr`
   --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/raw_vec.rs:642:17
    |
642 |             use alloc::AllocErr;
    |                 ^^^^^^^^^^^^^^^

warning: unused import: `ToOwned`
  --> /Users/c/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/src/rust/src/liballoc/string.rs:60:19
   |
60 | use borrow::{Cow, ToOwned};
   |                   ^^^^^^^

error: aborting due to 111 previous errors

Some errors occurred: E0405, E0412, E0425, E0432, E0433, E0659.
For more information about an error, try `rustc --explain E0405`.
error: Could not compile `alloc`.

To learn more, run the command again with --verbose.
error: `"cargo" "rustc" "-p" "alloc" "--release" "--manifest-path" "/var/folders/6f/l9rcfr1d2s55xy9vd6rtnvv00000gn/T/xargo.5t16SLxIxhfA/Cargo.toml" "--target" "x86_64-apple-darwin" "--" "-Z" "force-unstable-if-unmarked"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace

".got" linker section emitted in debug mode despite disabling dynamic linking/PIE

I'm getting this error " = note: rust-lld: error: no memory region specified for section '.got'" which is unexpected because my target does not support the .got section at all. It is allowed in the linker script just to trigger a compiler error. This was working as of the .29 release, but is now broken with .33. With .29 I had the error with LTO code when using release mode, but with .33 that error went away. This .got error only occurs with debug builds.

The target file I'm using:

{
  "arch": "x86",
  "cpu": "i486",
  "data-layout": "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128",
  "dynamic-linking": false,
  "executables": true,
  "has-elf-tls": false,
  "has-rpath": false,
  "is-builtin": false,
  "linker": "rust-lld",
  "linker-flavor": "ld.lld",
  "linker-is-gnu": false,
  "llvm-target": "i486-unknown-none",
  "max-atomic-width": 64,
  "os": "neutron",
  "position-independent-executables": false,
  "target-c-int-width": "32",
  "target-endian": "little",
  "target-family": "unix",
  "target-pointer-width": "32",
  "vendor": "qtum",
  "features": "-mmx,-sse,+soft-float",
  "panic-strategy": "abort"
}

The linker script:

ENTRY(__start)

EXTERN(__sheap)
EXTERN(__start)

MEMORY
{
    CODEMEM : ORIGIN = 0x10000, LENGTH = 63K
    CODEMEMAUX1 : ORIGIN = 0x20000, LENGTH = 63K
    CODEMEMAUX2 : ORIGIN = 0x30000, LENGTH = 63K
    CODEMEMAUX3 : ORIGIN = 0x40000, LENGTH = 63K
    CODEMEMAUX4 : ORIGIN = 0x50000, LENGTH = 63K
    CODEMEMAUX5 : ORIGIN = 0x60000, LENGTH = 63K
    CODEMEMAUX6 : ORIGIN = 0x70000, LENGTH = 63K
    CODEMEMAUX7 : ORIGIN = 0x80000, LENGTH = 63K
    DATAMEM : ORIGIN = 0x80020000, LENGTH = 63K
}
/* # Sections */
SECTIONS
{
  /* ### .text */
  .text :
  {
    *(__start_text);
    *(.text .text.*);
    *(.rodata .rodata.*);
  } > CODEMEM
  /* # aux code sections */
  .textaux1 :
  {
    *(.textaux1 .textaux1.*);
  } > CODEMEMAUX1
  .textaux2 :
  {
    *(.textaux2 .textaux2.*);
  } > CODEMEMAUX2
  .textaux3 :
  {
    *(.textaux3 .textaux3.*);
  } > CODEMEMAUX3
  .textaux4 :
  {
    *(.textaux4 .textaux4.*);
  } > CODEMEMAUX4
  .textaux5 :
  {
    *(.textaux5 .textaux5.*);
  } > CODEMEMAUX5
  .textaux6 :
  {
    *(.textaux6 .textaux6.*);
  } > CODEMEMAUX6
  .textaux7 :
  {
    *(.textaux7 .textaux7.*);
  } > CODEMEMAUX7


  /* ## Sections in RAM */
  /* ### .data */
  .data : ALIGN(4)
  {
    . = ALIGN(4);
    __sdata = .;
    *(.data .data.*);
    . = ALIGN(4); /* 4-byte align the end (VMA) of this section */
    __edata = .;
  } > DATAMEM AT > CODEMEM

  /* LMA of .data */
  __sidata = LOADADDR(.data);

  /* ### .bss */
  .bss : ALIGN(4)
  {
    . = ALIGN(4);
    __sbss = .;
    *(.bss .bss.*);
    . = ALIGN(4); /* 4-byte align the end (VMA) of this section */
    __ebss = .;
  } > DATAMEM

  /* ### .uninit */
  .uninit (NOLOAD) : ALIGN(4)
  {
    . = ALIGN(4);
    *(.uninit .uninit.*);
    . = ALIGN(4);
  } > DATAMEM

  /* Place the heap right after `.uninit` */
  . = ALIGN(4);
  __sheap = .;

  /* ## .got */
  /* Dynamic relocations are unsupported. This section is only used to detect relocatable code in
     the input files and raise an error if relocatable code is found */
  .got  :
  {
    KEEP(*(.got .got.*));
  }

  /* ## Discarded sections */
  /DISCARD/ :
  {
    /* Unused exception related info that only wastes space */
    *(.ARM.exidx);
    *(.ARM.exidx.*);
    *(.ARM.extab.*);
    *(.debug*);
    *(.comment*);
    *(.eh_frame*);
    
  }
}
/*
ASSERT(SIZEOF(.got) == 0, "
ERROR(cortex-m-rt): .got section detected in the input object files
Dynamic relocations are not supported. If you are linking to C code compiled using
the 'cc' crate then modify your build script to compile the C code _without_
the -fPIC flag. See the documentation of the `cc::Build.pic` method for details.");
*/

And the .cargo/config file:

[target.i686-neutron]
rustflags = [
  "-C", "link-arg=-Tlink.x",
  "-C", "relocation-model=static"
]
[target.i486-neutron]
rustflags = [
  "-C", "link-arg=-Tlink.x",
  "-C", "relocation-model=static"
]
runner = "neutron-testbench"

[build]
target = "i486-neutron"

I'm building it using cargo xbuild --target i486-neutron.json --verbose

I have a few other targeted crates that I'm using, as well as some common ones like serde, alloc, etc

LTO causes sysroot to be unlinkable by non-LLVM toolchains

I'm using cargo xbuild to compile Rust binaries for the ESP32 via https://github.com/MabezDev/rust-xtensa, and then linking them via the Espressif xtensa-esp32-elf-ld, which is a GNU crosstool-NG linker that doesn't understand LLVM bitcode / LTO output

Is it possible to disable LTO by default for the sysroot, or make it a flag that can be passed in?

Reverting to 0.5.29 resolves the issue, so I imagine this is caused by the fix for #69 ?

Compiler builtins should now be downloaded from crates.io

Now that rust-lang/rust#56092 has landed, and that the nightlies are fixed, cargo-xbuild fails because it cannot find the compiler builtins source in rust-src. This is normal: it is not a submodule anymore, and must now be downloaded from crates.io. To quote @alexcrichton in that PR...

As a proof of concept, this commit removes the dlmalloc,
libcompiler_builtins, and libc submodules from this repository. Long
thorns in our side these are now gone for good and we can directly
depend on crates.io! It's hoped that in the long term we can bring in
other crates as necessary, but for now this is largely intended to
simply make it easier to manage these crates and remove submodules.

This should be a transparent non-breaking change for all users, but one
possible stickler is that this almost for sure breaks out-of-tree
std-building tools like xargo and cargo-xbuild. I think it should
be relatively easy to get them working, however, as all that's needed is
an entry in the [patch] section used to build the standard library.
Hopefully we can work with these tools to solve this problem!

The PR description contains more details about what exactly has changed, and how cargo-xbuild should be modified to account for this change.

cargo xbuild not building core?

Hey there! This is kind of a weird bug report; Everything works on CI:

but not locally.

I just got a new computer. I'm trying to build intermezzos. It appears that cargo-xbuild isn't trying to build libcore, and I'm not sure why.

Log:

> cargo xbuild --target .\intermezzos.json --verbose
+ "rustc" "--print" "sysroot"
+ "rustc" "--print" "target-list"
+ RUSTFLAGS="--sysroot C:\\Users\\Steve%20Klabnik\\src\\intermezzos\\kernel\\target/sysroot"
+ "cargo" "build" "--target" ".\\intermezzos.json" "--verbose"
       Fresh unicode-width v0.1.5
   Compiling zero v0.1.2
   Compiling ux v0.1.2
   Compiling usize_conversions v0.2.0
   Compiling os_bootinfo v0.2.1
   Compiling bitflags v1.0.4
   Compiling bit_field v0.9.0
     Running `rustc --crate-name zero "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\zero-0.1.2\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 -C metadata=ba0b6236150e3006 -C extra-filename=-ba0b6236150e3006 --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot C:\Users\Steve%20Klabnik\src\intermezzos\kernel\target/sysroot`
     Running `rustc --crate-name ux "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\ux-0.1.2\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 -C metadata=09d8d1073892a348 -C extra-filename=-09d8d1073892a348 --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot C:\Users\Steve%20Klabnik\src\intermezzos\kernel\target/sysroot`
     Running `rustc --crate-name usize_conversions "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\usize_conversions-0.2.0\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 -C metadata=784cfbd532dc9233 -C extra-filename=-784cfbd532dc9233 --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot C:\Users\Steve%20Klabnik\src\intermezzos\kernel\target/sysroot`
     Running `rustc --crate-name os_bootinfo "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\os_bootinfo-0.2.1\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 -C metadata=bcccaaae8157f32d -C extra-filename=-bcccaaae8157f32d --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot C:\Users\Steve%20Klabnik\src\intermezzos\kernel\target/sysroot`
     Running `rustc --crate-name bitflags "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\bitflags-1.0.4\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 --cfg "feature=\"default\"" -C metadata=416d1ccdb23746f4 -C extra-filename=-416d1ccdb23746f4 --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot C:\Users\Steve%20Klabnik\src\intermezzos\kernel\target/sysroot`
error[E0463]: can't find crate for `core`
  |
  = note: the `intermezzos-11677179942914453679` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `core`
  |
  = note: the `intermezzos-11677179942914453679` target may not be installed

error: Could not compile `zero`.

Caused by:
  process didn't exit successfully: `rustc --crate-name zero "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\zero-0.1.2\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 -C metadata=ba0b6236150e3006 -C extra-filename=-ba0b6236150e3006 --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot C:\Users\Steve%20Klabnik\src\intermezzos\kernel\target/sysroot` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error[E0463]: can't find crate for `core`
  |
  = note: the `intermezzos-11677179942914453679` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: Could not compile `usize_conversions`.

Caused by:
  process didn't exit successfully: `rustc --crate-name usize_conversions "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\usize_conversions-0.2.0\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 -C metadata=784cfbd532dc9233 -C extra-filename=-784cfbd532dc9233 --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot C:\Users\Steve%20Klabnik\src\intermezzos\kernel\target/sysroot` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `core`
  |
  = note: the `intermezzos-11677179942914453679` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
     Running `rustc --crate-name bit_field "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\bit_field-0.9.0\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 -C metadata=b0a184e3c9e20697 -C extra-filename=-b0a184e3c9e20697 --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot C:\Users\Steve%20Klabnik\src\intermezzos\kernel\target/sysroot`
error: Could not compile `ux`.

Caused by:
  process didn't exit successfully: `rustc --crate-name ux "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\ux-0.1.2\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 -C metadata=09d8d1073892a348 -C extra-filename=-09d8d1073892a348 --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot C:\Users\Steve%20Klabnik\src\intermezzos\kernel\target/sysroot` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: Could not compile `os_bootinfo`.

Caused by:
  process didn't exit successfully: `rustc --crate-name os_bootinfo "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\os_bootinfo-0.2.1\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 -C metadata=bcccaaae8157f32d -C extra-filename=-bcccaaae8157f32d --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot C:\Users\Steve%20Klabnik\src\intermezzos\kernel\target/sysroot` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `core`
  |
  = note: the `intermezzos-11677179942914453679` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: Could not compile `bitflags`.

Caused by:
  process didn't exit successfully: `rustc --crate-name bitflags "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\bitflags-1.0.4\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 --cfg "feature=\"default\"" -C metadata=416d1ccdb23746f4 -C extra-filename=-416d1ccdb23746f4 --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot C:\Users\Steve%20Klabnik\src\intermezzos\kernel\target/sysroot` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error[E0463]: can't find crate for `core`
  |
  = note: the `intermezzos-11677179942914453679` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: Could not compile `bit_field`.

Caused by:
  process didn't exit successfully: `rustc --crate-name bit_field "C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\bit_field-0.9.0\src\lib.rs" --color always --crate-type lib --emit=dep-info,link -C panic=abort -C debuginfo=2 -C metadata=b0a184e3c9e20697 -C extra-filename=-b0a184e3c9e20697 --out-dir "C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" --target "\\?\C:\Users\Steve Klabnik\src\intermezzos\kernel\intermezzos.json" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\intermezzos\debug\deps" -L "dependency=C:\Users\Steve Klabnik\src\intermezzos\kernel\target\debug\deps" --cap-lints allow --sysroot C:\Users\Steve%20Klabnik\src\intermezzos\kernel\target/sysroot` (exit code: 1)

It fails to find libcore, but it doesn't even try to build it...

Any ideas?

relocation R_X86_64_32S out of range

When I build a Kernel Os with some crates ,it happend.
Then I tried to give RUSTFLAGS and rebuilded those crates, also failed.
But when I used .cargo/config.toml ,set build-std and env RUSTFLAGS then it did well
Is cargo-xbuild question or have another resolution I don`t find?

More x*?

At least xrun and xdoc would be nice. Maybe an xdo $command to run arbitrary cargo-* with the appropriate environment configured. Is there any reason why xbuild doesn't act like xargo and cover all bases?

Document XBUILD_SYSROOT_PATH in README.md

The README currently only describes that the sysroot path can be modified in the Cargo.toml. Unfortunately, this approach doesn't work if a workspace is used, because this results in many packages in the metadata and cargo-xbuild always searches for its options in the first package.

It just took me several hours to figure out that this is the problem and that there actually is an alternative: the XBUILD_SYSROOT_PATH environment variable. Please document that in the README ;)

Can't lock the sysroot as read-write

The Error

Using cargo xbuild in any rust project gives the error error: couldn't lock x86_64-pc-windows-msvc's sysroot as read-write.

Full stacktrace

> D:\Desktop\cargo-xbuild\target\debug\cargo-xbuild.exe xbuild
error: couldn't lock x86_64-pc-windows-msvc's sysroot as read-write
caused by: La sintassi del nome del file, della directory o del volume non è corretta. (os error 123)
stack backtrace:
   0:     0x7ff6bba5c1c5 - backtrace::backtrace::trace<closure>
                        at C:\Users\Axel Montini\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.0\src\backtrace\mod.rs:42
   1:     0x7ff6bba59ab4 - backtrace::capture::Backtrace::new
                        at D:\Desktop\cargo-xbuild\target\debug\build\backtrace-0788abd2d2f3e83e\out\capture.rs:79
   2:     0x7ff6bb9aa6ec - error_chain::make_backtrace
                        at C:\Users\Axel Montini\.cargo\registry\src\github.com-1ecc6299db9ec823\error-chain-0.7.2\src\lib.rs:411
   3:     0x7ff6bb8e0649 - core::ops::function::FnOnce::call_once<fn() -> core::option::Option<alloc::arc::Arc<backtrace::capture::Backtrace>>,()>
                        at C:\projects\rust\src\libcore\ops\function.rs:223
   4:     0x7ff6bb90a8c4 - core::option::Option<alloc::arc::Arc<backtrace::capture::Backtrace>>::or_else<alloc::arc::Arc<backtrace::capture::Backtrace>,fn() -> core::option::Option<alloc::arc::Arc<backtrace::capture::Backtrace>>>
                        at C:\projects\rust\src\libcore\option.rs:714
   5:     0x7ff6bb8db867 - error_chain::State::new<cargo_xbuild::errors::Error>
                        at C:\Users\Axel Montini\.cargo\registry\src\github.com-1ecc6299db9ec823\error-chain-0.7.2\src\lib.rs:476
   6:     0x7ff6bb8db654 - cargo_xbuild::errors::{{impl}}::chain_err::{{closure}}<cargo_xbuild::flock::FileLock,std::io::error::Error,closure,alloc::string::String>
                        at D:\Desktop\cargo-xbuild\<error_chain_processed macros>:122
   7:     0x7ff6bb8d546b - core::result::Result<cargo_xbuild::flock::FileLock, std::io::error::Error>::map_err<cargo_xbuild::flock::FileLock,std::io::error::Error,cargo_xbuild::errors::Error,closure>
                        at C:\projects\rust\src\libcore\result.rs:500
   8:     0x7ff6bb8d9385 - cargo_xbuild::errors::{{impl}}::chain_err<cargo_xbuild::flock::FileLock,std::io::error::Error,closure,alloc::string::String>
                        at D:\Desktop\cargo-xbuild\<error_chain_processed macros>:123
   9:     0x7ff6bb8e4c66 - cargo_xbuild::xargo::Home::lock_rw
                        at D:\Desktop\cargo-xbuild\src\xargo.rs:67
  10:     0x7ff6bb8edd12 - cargo_xbuild::sysroot::old_hash
                        at D:\Desktop\cargo-xbuild\src\sysroot.rs:242
  11:     0x7ff6bb8ee990 - cargo_xbuild::sysroot::update
                        at D:\Desktop\cargo-xbuild\src\sysroot.rs:301
  12:     0x7ff6bb8f81c9 - cargo_xbuild::build
                        at D:\Desktop\cargo-xbuild\src\main.rs:199
  13:     0x7ff6bb8f5e7b - cargo_xbuild::run
                        at D:\Desktop\cargo-xbuild\src\main.rs:125
  14:     0x7ff6bb8f550c - cargo_xbuild::main
                        at D:\Desktop\cargo-xbuild\src\main.rs:93
  15:     0x7ff6bb8f89a0 - std::rt::lang_start::{{closure}}<()>
                        at C:\projects\rust\src\libstd\rt.rs:74
  16:     0x7ff6bba75397 - std::panicking::try::do_call<closure,i32>
                        at C:\projects\rust\src\libstd\panicking.rs:310
  17:     0x7ff6bba8fbb2 - panic_unwind::__rust_maybe_catch_panic
                        at C:\projects\rust\src\libpanic_unwind\lib.rs:105
  18:     0x7ff6bba85db3 - std::rt::lang_start_internal
                        at C:\projects\rust\src\libstd\rt.rs:58
  19:     0x7ff6bb8f8978 - std::rt::lang_start<()>
                        at C:\projects\rust\src\libstd\rt.rs:74
  20:     0x7ff6bb8f8923 - main
  21:     0x7ff6bba9f7d9 - __scrt_common_main_seh
                        at f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:253
  22:     0x7fff89053034 - BaseThreadInitThunk

EDITED because of mistakes on my side

xc, xb, xr, xt

Cargo has four built-in command aliases1: c for check, b for build, r for run, and t for test. It would be consistent and useful during development for cargo-xbuild to provide x-prefixed versions of these (xc for xcheck, xb for xbuild, xr for xrun, and xt for xtest). I propose staying in sync with Cargo and only adding short aliases that exist there (e.g. not adding xdxdoc).

I know I can do this locally, but I'd like to have it provided by cargo-xbuild. I'd be happy to help out with the implementation work.

1See the bottom of the Cargo configuration key reference (yes, it's a bit of an odd place for this documentation to reside, but oh well).

ensure copied Cargo.lock is writable

If the path pointed to by XARGO_RUST_SRC contains read-only Cargo lockfiles, then xbuild fails because the copies it makes and attempts to modify are also read-only·
The patch below fixes this bug.

diff --git a/src/sysroot.rs b/src/sysroot.rs
index 1f3c8d1..422d3d0 100644
--- a/src/sysroot.rs
+++ b/src/sysroot.rs
@@ -85,10 +85,20 @@ fn build_crate(
     }
 
     util::write(&td.join("Cargo.toml"), &stoml)?;
-    fs::copy(lockfile, &td.join("Cargo.lock")).chain_err(||
+    let dst_file = td.join("Cargo.lock");
+    fs::copy(lockfile, &dst_file).chain_err(||
         format!("failed to copy Cargo.lock from `{}` to `{}`",
-            lockfile.display(), &td.join("Cargo.lock").display())
+            lockfile.display(), &dst_file.display())
     )?;
+    let mut perms = fs::metadata(&dst_file).chain_err(||
+        format!("failed to retrieve permissions for `{}`",
+            dst_file.display())
+    )?.permissions();
+    perms.set_readonly(false);
+    fs::set_permissions(&dst_file, perms).chain_err(||
+        format!("failed to update permissions for `{}`",
+            dst_file.display())
+    );
     util::mkdir(&td.join("src"))?;
     util::write(&td.join("src/lib.rs"), "")?;

Using as a library

It would be really useful for me to be able to use this as a library, since it would avoid requiring the user to install cargo_xbuild as a separate step. I'm just playing with it now, and it seems I can just make a few bits public to get what I want: master...ascjones:pub-build-fn.

Let me know whether this is a sensible idea and I can continue down this path and create a PR with these changes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.