Migrate `emit-to-stdout` `run-make` test to rmake
Part of #121876 and the associated Google Summer of Code project.
Another test which will fail CI. Most of everything here works, with the only exception being the cases where the test redirects stdout to a tty: 1>/dev/ptmx.
run_make_support doesn't support this yet, so I am posting this PR to open a discussion.
r? @jieyouxu
rustbot has assigned @jieyouxu. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
------
> importing cache manifest from ghcr.io/rust-lang/rust-ci-cache:3aacb9c90579defe09351ac5e8ee504359f8054da6326ff19038f1b7c90e3cb2aafe33685c6d9b76ee8d2ccbd187ca80c46ab5380485abdd8c0ce7d69cd8d8fd:
------
##[endgroup]
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-17]
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-17', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-17/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
Downloaded boml v0.3.1
Compiling boml v0.3.1
Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
Finished `release` profile [optimized] target(s) in 3.84s
Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-system-gcc --use-backend gcc --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --mini-tests --std-tests`
Using system GCC
[BUILD] example
[AOT] mini_core_hello_world
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc/mini_core_hello_world
abc
---
---- [run-make] tests/run-make/emit-to-stdout stdout ----
error: rmake recipe failed to complete
status: exit status: 101
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/emit-to-stdout/rmake_out" && env -u RUSTFLAGS AR="ar" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" HOST_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/usr/lib/llvm-17/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen codegentypes core coroutines coverage debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerparallel dwp engine executionengine extensions filecheck frontendhlsl frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcjit orcshared orctargetprocess passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser textapi transformutils ve veasmparser vecodegen vectorize vedesc vedisassembler veinfo webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/usr/lib/llvm-17/bin/FileCheck" NODE="/usr/bin/node" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="x86_64-unknown-linux-gnu" TARGET_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" TARGET_RPATH_ENV="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/emit-to-stdout/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/emit-to-stdout/rmake"
--- stderr -------------------------------
command unexpectedly succeeded at line 58
command unexpectedly succeeded at line 58
Command { cmd: LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/emit-to-stdout/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/emit-to-stdout/rmake_out" "--emit=llvm-bc=-" "test.rs", stdin: None, drop_bomb: DropBomb { command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc", defused: true, armed_location: Location { file: "/checkout/tests/run-make/emit-to-stdout/rmake.rs", line: 55, col: 23 } } }
output status: `exit status: 0`
thread 'main' panicked at src/tools/run-make-support/src/command.rs:170:55:
stdout is not valid UTF-8: FromUtf8Error { bytes: [66, 67, 192, 222, 53, 20, 0, 0, 5, 0, 0, 0, 98, 12, 48, 36, 74, 89, 190, 102, 189, 251, 180, 111, 11, 81, 128, 76, 1, 0, 0, 0, 33, 12, 0, 0, 137, 1, 0, 0, 11, 2, 33, 0, 2, 0, 0, 0, 22, 0, 0, 0, 7, 129, 35, 145, 65, 200, 4, 73, 6, 16, 50, 57, 146, 1, 132, 12, 37, 5, 8, 25, 30, 4, 139, 98, 128, 8, 69, 2, 66, 146, 11, 66, 68, 16, 50, 20, 56, 8, 24, 75, 10, 50, 34, 136, 72, 112, 196, 33, 35, 68, 18, 135, 140, 16, 65, 146, 2, 100, 200, 8, 177, 20, 32, 67, 70, 136, 32, 201, 1, 50, 34, 132, 24, 42, 40, 42, 144, 49, 124, 176, 92, 145, 32, 194, 200, 0, 0, 0, 137, 32, 0, 0, 9, 0, 0, 0, 34, 102, 4, 16, 178, 66, 130, 137, 16, 82, 66, 130, 137, 144, 113, 194, 80, 72, 10, 9, 38, 66, 198, 5, 66, 34, 38, 8, 132, 129, 128, 57, 2, 48, 0, 0, 19, 48, 124, 192, 3, 59, 248, 5, 59, 160, 131, 54, 168, 7, 119, 88, 7, 119, 120, 135, 123, 112, 135, 54, 96, 135, 116, 112, 135, 122, 192, 135, 54, 56, 7, 119, 168, 135, 13, 166, 80, 14, 109, 208, 14, 122, 80, 14, 109, 0, 15, 114, 112, 7, 112, 160, 7, 115, 32, 7, 122, 48, 7, 114, 208, 6, 240, 32, 7, 119, 16, 7, 122, 48, 7, 114, 160, 7, 115, 32, 7, 109, 0, 15, 114, 112, 7, 114, 160, 7, 118, 64, 7, 122, 96, 7, 116, 208, 6, 233, 96, 7, 116, 160, 7, 118, 64, 7, 109, 96, 14, 120, 0, 7, 122, 16, 7, 114, 128, 7, 109, 224, 14, 120, 160, 7, 113, 96, 7, 122, 48, 7, 114, 160, 7, 118, 64, 7, 109, 48, 11, 113, 32, 7, 120, 160, 17, 194, 228, 112, 163, 151, 231, 116, 23, 249, 38, 198, 201, 202, 100, 152, 77, 102, 38, 151, 97, 50, 91, 107, 124, 174, 187, 96, 18, 27, 4, 138, 34, 6, 0, 0, 100, 129, 0, 0, 0, 0, 6, 0, 0, 0, 50, 30, 152, 8, 25, 17, 76, 144, 140, 9, 38, 71, 198, 4, 67, 170, 32, 138, 160, 4, 0, 0, 0, 0, 177, 24, 0, 0, 185, 0, 0, 0, 51, 8, 128, 28, 196, 225, 28, 102, 20, 1, 61, 136, 67, 56, 132, 195, 140, 66, 128, 7, 121, 120, 7, 115, 152, 113, 12, 230, 0, 15, 237, 16, 14, 244, 128, 14, 51, 12, 66, 30, 194, 193, 29, 206, 161, 28, 102, 48, 5, 61, 136, 67, 56, 132, 131, 27, 204, 3, 61, 200, 67, 61, 140, 3, 61, 204, 120, 140, 116, 112, 7, 123, 8, 7, 121, 72, 135, 112, 112, 7, 122, 112, 3, 118, 120, 135, 112, 32, 135, 25, 204, 17, 14, 236, 144, 14, 225, 48, 15, 110, 48, 15, 227, 240, 14, 240, 80, 14, 51, 16, 196, 29, 222, 33, 28, 216, 33, 29, 194, 97, 30, 102, 48, 137, 59, 188, 131, 59, 208, 67, 57, 180, 3, 60, 188, 131, 60, 132, 3, 59, 204, 240, 20, 118, 96, 7, 123, 104, 7, 55, 104, 135, 114, 104, 7, 55, 128, 135, 112, 144, 135, 112, 96, 7, 118, 40, 7, 118, 248, 5, 118, 120, 135, 119, 128, 135, 95, 8, 135, 113, 24, 135, 114, 152, 135, 121, 152, 129, 44, 238, 240, 14, 238, 224, 14, 245, 192, 14, 236, 48, 3, 98, 200, 161, 28, 228, 161, 28, 204, 161, 28, 228, 161, 28, 220, 97, 28, 202, 33, 28, 196, 129, 29, 202, 97, 6, 214, 144, 67, 57, 200, 67, 57, 152, 67, 57, 200, 67, 57, 184, 195, 56, 148, 67, 56, 136, 3, 59, 148, 195, 47, 188, 131, 60, 252, 130, 59, 212, 3, 59, 176, 195, 12, 199, 105, 135, 112, 88, 135, 114, 112, 131, 116, 104, 7, 120, 96, 135, 116, 24, 135, 116, 160, 135, 25, 206, 83, 15, 238, 0, 15, 242, 80, 14, 228, 144, 14, 227, 64, 15, 225, 32, 14, 236, 80, 14, 51, 32, 40, 29, 220, 193, 30, 194, 65, 30, 210, 33, 28, 220, 129, 30, 220, 224, 28, 228, 225, 29, 234, 1, 30, 102, 24, 81, 56, 176, 67, 58, 156, 131, 59, 204, 80, 36, 118, 96, 7, 123, 104, 7, 55, 96, 135, 119, 120, 7, 120, 152, 81, 76, 244, 144, 15, 240, 80, 14, 51, 30, 106, 30, 202, 97, 28, 232, 33, 29, 222, 193, 29, 126, 1, 30, 228, 161, 28, 204, 33, 29, 240, 97, 6, 84, 133, 131, 56, 204, 195, 59, 176, 67, 61, 208, 67, 57, 252, 194, 60, 228, 67, 59, 136, 195, 59, 176, 195, 140, 197, 10, 135, 121, 152, 135, 119, 24, 135, 116, 8, 7, 122, 40, 7, 114, 152, 129, 92, 227, 16, 14, 236, 192, 14, 229, 80, 14, 243, 48, 35, 193, 210, 65, 30, 228, 225, 23, 216, 225, 29, 222, 1, 30, 102, 72, 25, 59, 176, 131, 61, 180, 131, 27, 132, 195, 56, 140, 67, 57, 204, 195, 60, 184, 193, 57, 200, 195, 59, 212, 3, 60, 204, 72, 180, 113, 8, 7, 118, 96, 7, 113, 8, 135, 113, 88, 135, 25, 219, 198, 14, 236, 96, 15, 237, 224, 6, 240, 32, 15, 229, 48, 15, 229, 32, 15, 246, 80, 14, 110, 16, 14, 227, 48, 14, 229, 48, 15, 243, 224, 6, 233, 224, 14, 228, 80, 14, 248, 48, 35, 226, 236, 97, 28, 194, 129, 29, 216, 225, 23, 236, 33, 29, 230, 33, 29, 196, 33, 29, 216, 33, 29, 232, 33, 31, 102, 32, 157, 59, 188, 67, 61, 184, 3, 57, 148, 131, 57, 204, 88, 188, 112, 112, 7, 119, 120, 7, 122, 8, 7, 122, 72, 135, 119, 112, 135, 25, 203, 231, 14, 239, 48, 15, 225, 224, 14, 233, 64, 15, 233, 160, 15, 229, 48, 195, 1, 3, 115, 168, 7, 119, 24, 135, 95, 152, 135, 112, 112, 135, 116, 160, 135, 116, 208, 135, 114, 152, 129, 132, 65, 57, 224, 195, 56, 176, 67, 61, 144, 67, 57, 204, 64, 196, 160, 29, 202, 161, 29, 224, 65, 30, 222, 193, 28, 102, 36, 99, 48, 14, 225, 192, 14, 236, 48, 15, 233, 64, 15, 229, 48, 67, 33, 131, 117, 24, 7, 115, 72, 135, 95, 160, 135, 124, 128, 135, 114, 152, 177, 148, 1, 60, 140, 195, 60, 148, 195, 56, 208, 67, 58, 188, 131, 59, 204, 195, 140, 197, 12, 72, 33, 21, 66, 97, 30, 230, 33, 29, 206, 193, 29, 82, 129, 20, 0, 121, 32, 0, 0, 44, 0, 0, 0, 114, 30, 72, 32, 67, 136, 12, 25, 9, 114, 50, 72, 32, 35, 129, 140, 145, 145, 209, 68, 160, 16, 40, 100, 60, 49, 50, 66, 142, 144, 33, 163, 56, 16, 171, 0, 201, 50, 7, 0, 80, 73, 67, 32, 76, 101, 118, 101, 108, 82, 116, 76, 105, 98, 85, 115, 101, 71, 79, 84, 114, 117, 115, 116, 99, 32, 118, 101, 114, 115, 105, 111, 110, 32, 49, 46, 56, 50, 46, 48, 45, 110, 105, 103, 104, 116, 108, 121, 32, 40, 97, 99, 98, 98, 48, 56, 99, 48, 101, 32, 50, 48, 50, 52, 45, 48, 55, 45, 51, 49, 41, 0, 35, 8, 1, 48, 130, 16, 4, 35, 8, 129, 48, 195, 64, 4, 197, 12, 67, 33, 24, 51, 4, 131, 140, 4, 38, 40, 35, 54, 54, 187, 54, 151, 182, 55, 178, 58, 182, 50, 23, 51, 182, 176, 179, 185, 81, 4, 227, 72, 133, 141, 205, 174, 205, 37, 141, 172, 204, 141, 110, 148, 0, 1, 0, 0, 169, 24, 0, 0, 45, 0, 0, 0, 11, 10, 114, 40, 135, 119, 128, 7, 122, 88, 112, 152, 67, 61, 184, 195, 56, 176, 67, 57, 208, 195, 130, 230, 28, 198, 161, 13, 232, 65, 30, 194, 193, 29, 230, 33, 29, 232, 33, 29, 222, 193, 29, 22, 52, 227, 96, 14, 231, 80, 15, 225, 32, 15, 228, 64, 15, 225, 32, 15, 231, 80, 14, 244, 176, 128, 129, 7, 121, 40, 135, 112, 96, 7, 118, 120, 135, 113, 8, 7, 122, 40, 7, 114, 88, 112, 156, 195, 56, 180, 1, 59, 164, 131, 61, 148, 195, 2, 107, 28, 216, 33, 28, 220, 225, 28, 220, 32, 28, 228, 97, 28, 220, 32, 28, 232, 129, 30, 194, 97, 28, 208, 161, 28, 200, 97, 28, 194, 129, 29, 216, 97, 193, 1, 15, 244, 32, 15, 225, 80, 15, 244, 128, 14, 11, 136, 117, 24, 7, 115, 72, 135, 5, 207, 56, 188, 131, 59, 216, 67, 57, 200, 195, 57, 148, 131, 59, 140, 67, 57, 140, 3, 61, 200, 3, 59, 0, 0, 0, 0, 209, 16, 0, 0, 6, 0, 0, 0, 7, 204, 60, 164, 131, 59, 156, 3, 59, 148, 3, 61, 160, 131, 60, 148, 67, 56, 144, 195, 1, 0, 0, 0, 161, 32, 0, 0, 2, 0, 0, 0, 163, 4, 201, 80, 1, 0, 0, 0, 113, 32, 0, 0, 2, 0, 0, 0, 50, 14, 16, 34, 4, 0, 0, 0, 139, 138, 246, 70, 217, 218, 12, 254, 112, 237, 125, 172, 108, 231, 94, 255, 3, 189, 221, 235, 20, 31, 122, 255, 14, 249, 88, 0, 101, 12, 0, 0, 25, 0, 0, 0, 18, 3, 148, 184, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 76, 0, 0, 0, 1, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 24, 0, 0, 0, 30, 0, 0, 0, 27, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, 12, 0, 0, 18, 0, 0, 0, 18, 3, 148, 121, 0, 0, 0, 0, 49, 55, 46, 48, 46, 50, 120, 56, 54, 95, 54, 52, 45, 117, 110, 107, 110, 111, 119, 110, 45, 108, 105, 110, 117, 120, 45, 103, 110, 117, 116, 101, 115, 116, 46, 100, 55, 98, 56, 50, 101, 100, 48, 54, 50, 102, 100, 101, 48, 50, 54, 45, 99, 103, 117, 46, 48, 0, 0, 0, 0, 0, 0, 0], error: Utf8Error { valid_up_to: 2, error_len: Some(1) } }
------------------------------------------
Note to self: look at the pseudoterminal stuff
Note that the test does not necessarily need /dev/ptmx specifically. It's just testing that printing an object to a terminal fails. The problem being that the test framework redirects stdout. Maybe there's another way to print to an actual terminal, even if we have to spawn one?
Btw, on windows this can be done via CommandExt::creation_flags with CREATE_NEW_CONSOLE (aka 0x10).
Progress update: none, since I haven't gotten to this one yet, lol
The job x86_64-gnu-llvm-17 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
------
> importing cache manifest from ghcr.io/rust-lang/rust-ci-cache:20d3b4d4a2629cbf7865cdbf92fe47512a7c96658c24253a045ff38e8075cd7fb37ca6fcadfa6e6d093333943ad24f6fc4f163ec5b74fd940de9d5bb03eb4d3b:
------
##[endgroup]
Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-17]
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure:
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-17', '--enable-llvm-link-shared', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'change-id=99999999', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-17/bin/llvm-config
configure: llvm.link-shared := True
configure: rust.thin-lto-import-instr-limit := 10
configure: change-id := 99999999
---
Downloaded boml v0.3.1
Compiling boml v0.3.1
Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
Finished `release` profile [optimized] target(s) in 3.72s
Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-system-gcc --use-backend gcc --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --mini-tests --std-tests`
Using system GCC
[BUILD] example
[AOT] mini_core_hello_world
/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc/mini_core_hello_world
abc
---
---- [run-make] tests/run-make/emit-to-stdout stdout ----
error: rmake recipe failed to complete
status: exit status: 101
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/emit-to-stdout/rmake_out" && env -u RUSTFLAGS AR="ar" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" HOST_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/usr/lib/llvm-17/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard codegen codegentypes core coroutines coverage debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerparallel dwp engine executionengine extensions filecheck frontendhlsl frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcjit orcshared orctargetprocess passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser textapi transformutils ve veasmparser vecodegen vectorize vedesc vedisassembler veinfo webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/usr/lib/llvm-17/bin/FileCheck" NODE="/usr/bin/node" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="x86_64-unknown-linux-gnu" TARGET_RPATH_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" TARGET_RPATH_ENV="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/emit-to-stdout/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/emit-to-stdout/rmake"
--- stderr -------------------------------
thread 'main' panicked at /checkout/tests/run-make/emit-to-stdout/rmake.rs:55:78:
test failed: `emit-llvm-bc.stderr` is different from `actual`
--- emit-llvm-bc.stderr
+++ actual
@@ -1,4 +0,0 @@
-error: option `-o` or `--emit` is used to write binary output type `llvm-bc` to stdout, but stdout is a tty
-error: aborting due to 1 previous error
-
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Review notes:
- Related issue: https://github.com/rust-lang/rust/issues/119658
- Related PR: https://github.com/rust-lang/rust/pull/119664
Here's my (very quick) implementation that might work on Linux. I've not tested it though. df8d4ba8b547ee700763754b877009b94f5c147c
It works on Windows but note the "fixme".
Closing this in favor of #131355 where we consolidated all of the efforts for emit-to-stdout.