-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Running x.py build
(after selecting 'c' to modify LLVM/codegen in setup) requires installing ninja, and it is not obvious how to do that
#89091
Comments
x.py build
requires installing ninja, which is not documentedx.py build
requires installing ninja, and then ninja fails to run when installed
Here's the backtrace:
|
Adding an
|
The next thing I tried was to uninstall
|
You can set |
I do want to potentially play with (especially, instrument) llvm. Removing the |
x.py build
requires installing ninja, and then ninja fails to run when installedx.py build
(after selecting 'c' to modify LLVM/codegen in setup) requires installing ninja, and then ninja fails to run when installed
Yes, this is what fixed it - I don't know what the cargo package you installed is, but the Debian package is the one rustbuild expects.
Hmm, I would rather have bootstrap tell you that directly when it gives an error that ninja isn't found, that seems more helpful (and easier to keep up to date). Are you interested in making a PR for that? :) |
The error checking for this lives in Line 1498 in 7a3d1a5
|
Yes I can make a PR for that. |
https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages describes how to install ninja packages on a variety of platforms, so I'll have the error message link to that. |
One thing I'm confused about is that adding
to |
x.py build
(after selecting 'c' to modify LLVM/codegen in setup) requires installing ninja, and then ninja fails to run when installedx.py build
(after selecting 'c' to modify LLVM/codegen in setup) requires installing ninja, and it is not obvious how to do that
I tried reproducing it. Without ninja installed there's a proper warning message. Editing config.toml then makes things build with gnu make as documented. # start with a vanilla system image
podman run --rm -it -v ~/.ssh/:/root/.ssh archlinux
# install build dependencies
pacman -Sy base-devel pkg-config python curl openssl git make cmake openssh
git clone https://github.com/rust-lang/rust.git
cd rust
./x.py setup
# choose c
./x.py test --stage 1 src/test/ui
# Couldn't find required command: ninja
# You should install ninja, or set `ninja=false` in config.toml in the `[llvm]` section.
# ... edit config.toml
./x.py test --stage 1 src/test/ui
# works! Imo the main thing that could use improvement is |
Yes, it's intentionally semi-required to encourage it's use, as it gives a much better experience (though these days most people are not building LLVM, I hope). |
I'm trying to build the compiler for the first time, following the instructions at https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html
Possible solutions
One of:
ninja
, orninja=false
in the[llvm]
section ofconfig.toml
, orninja
to be installed automatically by./x.py setup
, orninja=false
to be set automatically by default by./x.py setup
;and
Failed to open build.ninja
error.The text was updated successfully, but these errors were encountered: