How do I stream build script output with x.py? I've added a couple of commands to
src/libstd/build.rs which I need to debug but the output doesn't seem to appear if I run
./x.py build src/libstd -vv. Any ideas what I'm missing?
sorry... just noticed i should have posted this under t-compiler/help. Can't work out how to move it though :sweat:
This topic was moved here from #t-compiler > streaming build.rs output with x.py by simulacrum
hm is the build script being run?
(is it failing?)
The build script is being run yes. It's not failing but I believe it's calling the linker with subtly wrong flags. If I chuck a panic in there I can inspect the output. Unfortunately, because of some non-determinism in my build script things seem to be going wrong at stage-1 (stage-0 builds fine). It would be very helpful to stream its output though
Right now I'm doing some very shameful hacking with files to be able to abort the build at stage1 just to see what it's doing :)
hm I think cargo won't show non-failed build script output, but maybe try
-vvv? We definitely pass verbosity to cargo only at some higher level of x.py verbosity
Aha, I was missing a
v. Thanks @simulacrum , lifesaver!
You can also inspect build script output in the build directory after-the-fact. The path is something like
rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/build/std-1c20e82b0fffcf3b/output replacing the target, stage, and hash in the directory name depending on what you are building.
I did try using
find in the build directory to try and find remnants of the build script output to no avail, @Eric Huss is this also true when you compile without the verbose flags? (It's likely I was simply grepping for the wrong things)
The output is always saved. I forgot to mention that stderr is saved separately in a
Er, I should say it is always saved if the scripts succeeds. On failure the output is displayed on the console.