How do I test a patch for a new target without installing Rust?


I am looking to contribute a new target to rust for an embedded target. I've downloaded rust and following the lead of this commit set: I created a new .rs under spec, updated spec/ and modified src/tools/build-manifest/src/ I did not modify src/ci/docker/dist-various-1/Dockerfile because I am not sure how to test any change here. Right now I want to test the changes I have made. I have built rustc with ./ build. It built three different rustc versions where I assume it is ok to only focus on testing the stage 2 compiler. For testing I simply would like to build and try to run a "hello world" on my target mcu (I have not yet looked into how to test with docker and qemu). So my question is how do I run this new rustc that I built. My hello world needs to be compiled using cargo-xrustc because core needs to be rebuilt. I thought it was as simple as setting build.rustc to the stage 2 rustc binary location or by setting the envirornment variable RUSTC=/my/stage2/rust/location but neither technique is working. Doing the later I get an error:

error: The XARGO_RUST_SRC env variable must be set and point to the Rust source directory when working with the 'dev' channel

but setting the path to the source root directory gives a permission denied error.

Any suggestions?

BTW, I don't want to install my newly built rust with ./ install because I am not sure how I would revert this change, don't necessarily trust what I built, and don't want to ruin a rustc/cargo setup that is currently working (minus of course my new target that I want to contribute).


Hii, If you were able to resolve this error, can you please post the solution I'm trying to do the same thing and facing the same issue. Thanks