Skip to content

Interactive cross compilation hangs #142926

Closed
@Noratrieb

Description

@Noratrieb

Summary

When doing an interactive cross build, compilation hangs after building stage 1 std for the host.

pstree points at this command:

/root/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc --target i686-unknown-linux-musl --print=file-names --crate-type=proc-macro -

Which does certainly look like something that might hang, given that it reads from standard input and that the code doesn't seem to close stdin:

let error = rustc_cmd
.arg("--target")
.arg(target.rustc_target_arg())
.arg("--print=file-names")
.arg("--crate-type=proc-macro")
.arg("-")
.run_capture(self)
.stderr();

Command used

NOTE: Commands were run manually, not via docker build

FROM debian:12

WORKDIR /root

RUN apt update && apt install build-essential git python3 cmake curl ninja-build -y

RUN curl -LO https://musl.cc/i686-linux-musl-cross.tgz
RUN tar -xf i686-linux-musl-cross.tgz
RUN git clone https://github.com/rust-lang/rust.git

WORKDIR /root/rust

RUN git checkout beta

RUN ./configure --musl-root-i686=../i686-linux-musl-cross/i686-linux-musl --disable-docs --set target.i686-unknown-linux-musl.crt-static=false --enable-extended

ENV CC_i686_unknown_linux_musl=/root/i686-linux-musl-cross/bin/i686-linux-musl-gcc
ENV CXX_i686_unknown_linux_musl=/root/i686-linux-musl-cross/bin/i686-linux-musl-g++

RUN ./x dist --host='i686-unknown-linux-musl' --target i686-unknown-linux-musl
./x dist --host i686-unknown-linux-musl --target i686-unknown-linux-musl

Expected behaviour

it works

Actual behaviour

it hangs

Bootstrap configuration (bootstrap.toml)

./configure --musl-root-i686=../i686-linux-musl-cross/i686-linux-musl --disable-docs

Operating system

Linux

HEAD

Latest beta but the code seems to also be wrong on master.

Additional context

Build Log

<log>

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions