Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x.py install does nothing when target is set but host is not #76990

Closed
tmandry opened this issue Sep 21, 2020 · 11 comments · Fixed by #77133
Closed

x.py install does nothing when target is set but host is not #76990

tmandry opened this issue Sep 21, 2020 · 11 comments · Fixed by #77133
Assignees
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@tmandry
Copy link
Member

tmandry commented Sep 21, 2020

With a valid install prefix under install.prefix in config.toml, I see this:

./x.py install
Updating only changed submodules
Submodules updated in 0.04 seconds
    Finished dev [unoptimized + debuginfo] target(s) in 0.17s
Build completed successfully in 0:00:00

But nothing is installed. This is a recent regression. At first I thought it had to do with the default stages changing, but passing --stage doesn't seem to have an effect.

@tmandry tmandry added C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Sep 21, 2020
@tmandry
Copy link
Member Author

tmandry commented Sep 21, 2020

It looks like this regressed in #76415, cc @Mark-Simulacrum

@jyn514
Copy link
Member

jyn514 commented Sep 21, 2020

The default stage for install and dist is still stage 2.

@Mark-Simulacrum Mark-Simulacrum self-assigned this Sep 21, 2020
@Mark-Simulacrum
Copy link
Member

@tmandry Can you tell me what your config.toml contains? With an empty one I cannot seem to reproduce; I see x.py install go off to build a compiler at least (I did not wait for it to finish).

@jyn514 jyn514 added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Sep 23, 2020
@tmandry
Copy link
Member Author

tmandry commented Sep 23, 2020

Here's a config.toml:

[build]
target = ["x86_64-unknown-linux-gnu"] # happens to be the platform I'm building on
docs = false
extended = true
tools = ["cargo", "clippy", "src"]

[install]
prefix = "/absolute/path/to/some/existing/but/empty/dir"

Oddly if I remove target, docs, or tools it starts building std. Also oddly, extended seems to have no impact even though I think it should.

@tmandry tmandry removed the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Sep 23, 2020
@Mark-Simulacrum
Copy link
Member

Mark-Simulacrum commented Sep 23, 2020

Okay, I think I know what the problem is. That target config in build means that we're not building any host-only steps, of which I think everything except docs (edit: and analysis, which I think is save-analysis data, certainly not needed, but explains the tools thing) are currently in x.py install. Why everything is host-only, I'm not sure; I think at least std should not be.

What do you expect to install in that scenario? A full compiler toolchain?

@tmandry
Copy link
Member Author

tmandry commented Sep 23, 2020

Yes (edit: and libstd/libtest), or at least that's what happened in the past.

For what it's worth we normally specify more targets than just the one, but this was enough to show the issue. (It does the same thing when there are multiple targets)

@Mark-Simulacrum
Copy link
Member

Hm, okay. So the past behavior was almost certainly either a bug or at least unintentional. I think std should be installed for every target, but everything else I wouldn't expect to get installed without a configuring the platform as a host; if you want full toolchains you likely want target and host to be configured identically.

@tmandry
Copy link
Member Author

tmandry commented Sep 23, 2020

I only need one host, multiple targets. It's surprising to me that specifying a target appears to override the default host?

@tmandry
Copy link
Member Author

tmandry commented Sep 23, 2020

Maybe I'm confused about the role of host and target. Let's say I want the compiler to run only on linux x64, and be able to target linux-x64, fuchsia-x64, fuchsia-arm64. What should my configuration be?

@Mark-Simulacrum
Copy link
Member

host = x64 linux
target = x64 linux, fuchsia x64, fuchsia arm64

The behavior of implicitly setting host to empty if only target is specified is not necessarily desirable, it's just a historical artifact (used to be only on command line, the PR you cited earlier made it uniform between files and CLI). I think removing that behavior and requiring an explicitly empty host list probably makes sense, if you truly only want target artifacts.

@tmandry tmandry changed the title x.py install does nothing x.py install does nothing when target is set but host is not Sep 24, 2020
@tmandry
Copy link
Member Author

tmandry commented Sep 24, 2020

Okay, I'm working on a change to do that. Thanks for the explanation!

bors added a commit to rust-lang-ci/rust that referenced this issue Sep 30, 2020
…crum

bootstrap: Always build for host, even when target is given

This changes the behavior from *not* building for host whenever an
explicit target is specified. I find this much less confusing.

You can still disable host steps by passing an explicit empty list for
host.

Fixes rust-lang#76990.

r? `@Mark-Simulacrum`
@bors bors closed this as completed in e715c7f Sep 30, 2020
boklm pushed a commit to boklm/tor-browser-build that referenced this issue Jan 22, 2021
We pick up the latest (currently) Rust stable version, 1.48.0.

miri fails to compile (even though the build succeeds) which is
okay-ish.

See:

rust-lang/rust#79582 and
rust-lang/rust#74709

for more details.

It's not clear why exactly we need to specify the host as a target now,
too. But I guess previously things just worked by chance. The correct
thing to do is to specify `x86_64-unknown-linux` as target, too, given
that we are targetting it, e.g. with `cbindgen`.

Note: we could think about specifying `--host` here too, but it seems we
can avoid that extra configure argument, see:

rust-lang/rust#76990.
waybackarchiver pushed a commit to tor-actions/tor-browser-build that referenced this issue Apr 11, 2021
We pick up the latest (currently) Rust stable version, 1.48.0.

miri fails to compile (even though the build succeeds) which is
okay-ish.

See:

rust-lang/rust#79582 and
rust-lang/rust#74709

for more details.

It's not clear why exactly we need to specify the host as a target now,
too. But I guess previously things just worked by chance. The correct
thing to do is to specify `x86_64-unknown-linux` as target, too, given
that we are targetting it, e.g. with `cbindgen`.

Note: we could think about specifying `--host` here too, but it seems we
can avoid that extra configure argument, see:

rust-lang/rust#76990.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants