Commit Graph

73 Commits

Author SHA1 Message Date
Matthias Krüger ec50a2086a avoid converting types into themselves (clippy::useless_conversion) 2021-02-17 20:37:09 +01:00
Pietro Albini 5034b504b4
bootstrap: fix wrong docs installation path 2021-02-10 18:46:40 +01:00
Pietro Albini 2caf9bcb33
bootstrap: fix x.py install not working with relative prefix 2021-01-07 20:40:42 +01:00
Pietro Albini 8e0ab0fb5e
bootstrap: use the correct paths during ./x.py install 2020-12-31 11:38:32 +01:00
Yuxuan Shui fbc9d50d75
make sure installer only creates directories in DESTDIR
Fixes #80238

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-12-20 17:16:02 +00:00
Mark Rousskov 4de836e214 Install std for non-host targets 2020-09-24 09:37:23 -04:00
mark 2c31b45ae8 mv std libs to library/ 2020-07-27 19:51:13 -05:00
bors 2c21a6f3a8 Auto merge of #74495 - shepmaster:bootstrap-dist-target-files, r=Mark-Simulacrum
Teach bootstrap install and dist commands about TargetSelection

With this, we can now use a target JSON file to build a
cross-compiler:

```
x.py install --host ../aarch64-apple-darwin.json --target aarch64-apple-darwin
```

r? @Mark-Simulacrum
2020-07-19 22:50:46 +00:00
Jake Goulding 57614da715 Teach bootstrap install and dist commands about TargetSelection
With this, we can now use a target JSON file to build a
cross-compiler:

```
x.py install --host ../aarch64-apple-darwin.json --target aarch64-apple-darwin
```
2020-07-19 13:04:33 -04:00
Manish Goregaokar 5f76240354
Rollup merge of #74457 - Keruspe:install, r=Mark-Simulacrum
rustbuild: drop tool::should_install

Always install when the build succeeds

Fixes #74431
2020-07-17 18:13:53 -07:00
Marc-Antoine Perennou 4adb13c3a4 rustbuild: drop tool::should_install
Always install when the build succeeds

Fixes #74431

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2020-07-17 22:11:06 +02:00
Jake Goulding e2b337dc57 Teach bootstrap about target files vs target triples
`rustc` allows passing in predefined target triples as well as JSON
target specification files. This change allows bootstrap to have the
first inkling about those differences. This allows building a
cross-compiler for an out-of-tree architecture (even though that
compiler won't work for other reasons).

Even if no one ever uses this functionality, I think the newtype
around the `Interned<String>` improves the readability of the code.
2020-07-17 10:08:04 -04:00
Aleksey Kladov 058c1b60a5 Add rust-analyzer submodule
The current plan is that submodule tracks the `release` branch of
rust-analyzer, which is updated once a week.

rust-analyzer is a workspace (with a virtual manifest), the actual
binary is provide by `crates/rust-analyzer` package.

Note that we intentionally don't add rust-analyzer to `Kind::Test`,
for two reasons.

*First*, at the moment rust-analyzer's test suite does a couple of
things which might not work in the context of rust repository. For
example, it shells out directly to `rustup` and `rustfmt`. So, making
this work requires non-trivial efforts.

*Second*, it seems unlikely that running tests in rust-lang/rust repo
would provide any additional guarantees. rust-analyzer builds with
stable and does not depend on the specifics of the compiler, so
changes to compiler can't break ra, unless they break stability
guarantee. Additionally, rust-analyzer itself is gated on bors, so we
are pretty confident that test suite passes.
2020-07-03 16:55:35 +02:00
NODA, Kai 8e7606f204 bootstrap/install.rs: support a nonexistent `prefix` in `x.py install`
PR #49778 introduced fs::canonicalize() which fails for a nonexistent path.
This is a surprise for someone used to GNU Autotools' configure which can create any necessary intermediate directories in prefix.

This change makes it run fs::create_dir_all() before canonicalize().
2020-06-16 00:12:47 +08:00
Oliver Scherer a1824505d8 Gate on clippy on CI 2020-05-02 09:46:42 +02:00
Matthias Krüger 5f979e9afa bootstrap: fix clippy warnings 2020-02-03 20:26:36 +01:00
Ximin Luo a9dca3b243 rustbuild: fix cross-compile install
although, not sure why this works - it wasn't needed before
2019-12-01 00:53:25 +00:00
Mark Rousskov 2fc32b9e72 Locate rustc binary similarly to codegen backend loading
This ensures that the failure cases for finding the codegen backend and
for finding the rustc binary are essentially the same, and since we
almost always will load the codegen backend, this is essentially meaning
that the rustc change is not a regression.
2019-09-10 16:57:14 -04:00
Tyler Mandry 4f3cd3ca07 Fix x.py install
Make sure we look for save analysis in the right place. Fixes #61703.
2019-06-11 14:27:37 -07:00
Alex Crichton 7b362bb841 Fixup style 2019-05-28 11:56:05 -07:00
Alex Crichton 59291dc788 rustbuild: Assert extended builds don't dist too much
This extends a test in the previous commit to assert that we don't build
extra rustc compilers even when the "extended" option is set to true.
This involved some internal refactoring to have more judicious usage of
`compiler_for`, added in the previous commit, as well.

Various `dist::*` targets were refactored to be parameterized with a
`Compiler` instead of a `stage`/`host`, and then the various parameters
within the `Extended` target were tweaked to ensure that we don't ever
accidentally ask for a stage2 build compiler when we're distributing
something.
2019-05-28 11:50:05 -07:00
Andy Russell b2f71fb540
remove unneeded `extern crate`s from build tools 2019-05-09 12:03:13 -04:00
Taiki Endo 6343d6bc0d bootstrap: deny(rust_2018_idioms) 2019-02-25 19:30:32 +09:00
Oliver Scherer f8033a2923 fixup 2019-01-08 15:21:06 +01:00
Oliver Scherer 83530120ea Prepare everything for distributing miri via rustup 2019-01-08 15:21:06 +01:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
ljedrz a5a3da541b bootstrap: fix edition 2018-12-10 13:59:28 +01:00
ljedrz fe588d894f Replace a few expect+format combos with unwrap_or_else+panic 2018-07-23 14:47:13 +02:00
Oliver Schneider 8f55152f84 Did you mean to block nightlies on clippy? 2018-07-01 01:35:39 +02:00
Mark Simulacrum be1e7893d5 Remove uses of Build across Builder steps 2018-04-17 19:50:50 -06:00
Tamir Duberstein 94879023ad
rustbuild: canonicalize prefix `install_sh`
Testing:
```
  $ git diff
  diff --git a/config.toml.example b/config.toml.example
  index 9dd3002506..b47bc490cd 100644
  --- a/config.toml.example
  +++ b/config.toml.example
  @@ -196,7 +196,7 @@
   [install]

   # Instead of installing to /usr/local, install to this path instead.
  -#prefix = "/usr/local"
  +prefix = "install-prefix"

   # Where to install system configuration files
   # If this is a relative path, it will get installed in `prefix` above
  $ mkdir install-prefix
  $ ./x.py install -i --stage 0 --config config.toml.example
  ...
  $ ls install-prefix/
  bin	lib	share
```

Closes #36989.
2018-04-08 18:57:59 -04:00
Mark Simulacrum 545b92f46d Avoid printing output when in dry run mode 2018-04-03 11:43:14 -06:00
bors 222b0eb583 Auto merge of #48295 - Keruspe:master, r=alexcrichton
rustbuild: pass datadir to rust-installer

This fixes zsh completion install when $datadir != $prefix/share
2018-03-12 08:11:19 +00:00
Mark Simulacrum 1c8f3b011c Remove ONLY_BUILD.
All uses are replaced with not accessing run.target/run.host, and
instead directly using run.builder.build.build.
2018-03-08 20:30:00 -07:00
Mark Simulacrum 1191510881 Remove ONLY_BUILD_TARGETS.
All cases where it is used can be replaced by substituing run.host for
run.builder.build.build; that is its only effect. As such, it is
removable.
2018-03-08 20:30:00 -07:00
Marc-Antoine Perennou d14f07e089 bootstrap: pass datadir to rust-installer
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2018-03-08 07:47:21 +01:00
O01eg 78a0b7fd46
Refactor checks on list of extended tools. 2018-02-07 20:57:02 +03:00
O01eg 7be8e2fbb3
Add build.tools option to manage installation of extended rust tools. 2018-02-05 20:10:05 +03:00
Marc-Antoine Perennou 1930ee8b94 rustbuild: Install rustfmt as part of extended build
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-11-16 10:47:26 +01:00
kennytm 843dc4bd76
Rollup merge of #45588 - Keruspe:master, r=alexcrichton
rustbuild: don't try to install rls if ToolState is not Testing

We already do that for the Dist Step so we would end up trying to install something that we didn't dist.
2017-11-07 22:40:11 +08:00
Ximin Luo 32cf6e64c1 Ensure dist::Std for every libstd target. (Closes: #42320)
This fixes cross-compile installation. Half of the logic is actually in there
already in install.rs:install_std but it fails with an error like:

sh: 0: Can't open /<<BUILDDIR>>/rustc-1.21.0+dfsg1/build/tmp/dist/rust-std-1.21.0-powerpc64le-unknown-linux-gnu/install.sh

because the target-arch dist tarball wasn't built as well.
2017-11-06 11:38:27 +01:00
Marc-Antoine Perennou 784528b8da rustbuild: don't try to install rls if ToolState is not Testing
The Dist Step is not ran in that case so we would end up trying to
install something that we didn't dist.

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-11-04 15:49:18 +01:00
Josh Stone 110efe25fa Include rustc in the default `./x.py install`
The default install used to include rustc, rust-std, and rust-docs, but
the refactoring in commit 6b3413d825 make rustc only default in
extended builds.  This commit makes rustc installed by default again.
2017-09-05 14:19:22 -07:00
Mark Simulacrum 44ffb61623 Unify flags into config.
This introduces a slight change in behavior, where we unilaterally
respect the --host and --target parameters passed for all sanity
checking and runtime configuration.
2017-08-13 05:15:43 +05:00
Mark Simulacrum fef9b48252 Make dist equivalent to old build system. 2017-07-24 09:05:27 -06:00
Mark Simulacrum 6a67a050c6 Change make_run signature to taking a RunConfig struct for refactorability. 2017-07-20 17:51:07 -06:00
Mark Simulacrum b05af49086 Add an optional condition to constrain defaults.
Utilized primarily to not be a default rule unless some configuration is
given (e.g., compiler docs are enabled).
2017-07-20 17:24:11 -06:00
Mark Simulacrum e9c2242050 Remove step.rs comments 2017-07-20 16:41:26 -06:00
Mark Simulacrum 56128fb3ac Implement available paths list. 2017-07-20 11:24:37 -06:00
Mark Simulacrum 528646e127 Utilize interning to allow Copy/Clone steps 2017-07-20 11:24:32 -06:00