Commit Graph

50 Commits

Author SHA1 Message Date
Andy Russell 2f6226518b
use top level `fs` functions where appropriate
This commit replaces many usages of `File::open` and reading or writing
with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code
complexity, and will improve performance for most reads, since the
functions allocate the buffer to be the size of the file.

I believe that this commit will not impact behavior in any way, so some
matches will check the error kind in case the file was not valid UTF-8.
Some of these cases may not actually care about the error.
2018-12-07 12:54:11 -05:00
Alex Crichton 61e89446ef Remove all jemalloc-related content
This commit removes all jemalloc related submodules, configuration, etc,
from the bootstrap, from the standard library, and from the compiler.
This will be followed up with a change to use jemalloc specifically as
part of rustc on blessed platforms.
2018-11-02 06:52:56 -07:00
Matthias Krüger 54edf32143 bootstrap: clean up a few clippy findings
remove useless format!()s
remove redundant field names in a few struct initializations
pass slice instead of a vector to a function
use is_empty() instead of comparisons to .len()

No functional change intended.
2018-10-26 16:25:55 +02:00
Tom Tromey ac33b2e578 Run debuginfo tests against rust-enabled lldb, when possible
If the rust-enabled lldb was built, then use it when running the
debuginfo tests.  Updating the lldb submodule was necessary as this
needed a way to differentiate the rust-enabled lldb, so I added a line
to the --version output.

This adds compiletest commands to differentiate between the
rust-enabled and non-rust-enabled lldb, as is already done for gdb.  A
new "rust-lldb" header directive is also added, but not used in this
patch; I plan to use it in #54004.

This updates all the tests.
2018-10-08 11:04:24 -06:00
Eduard-Mihai Burtescu 14aed81d9a Use the new Entry::or_default method where possible. 2018-08-18 20:19:45 +03:00
John Kåre Alsaker 52e1c84732 Don't look for cc/cxx when testing with bogus targets 2018-04-17 01:59:00 +02:00
Jorge Aparicio 862c839fb9 extend no-std-ness check to all *-none-* targets 2018-04-03 08:29:09 +02:00
Jorge Aparicio 68b54a5f43 add a dist-thumb builder to build rust-std for the THUMB targets
the rust-std component only contains the core and compiler-builtins (+c +mem) crates

cc #49382
2018-04-01 18:50:21 +02:00
Marco A L Barbosa 68db72d8cd Do not assume dynamic linking for musl/mips[el] targets
All musl targets except mips[el] assume static linking by default. This
can be confusing
https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084

When the musl/mips[el] targets was
[added](https://github.com/rust-lang/rust/pull/31298), dynamic linking
was chosen because of binary size concerns, and probably also because
libunwind
[didn't](https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084/8)
supported mips.

Now that we have `crt-static` target-feature (the user can choose
dynamic link for musl targets), and libunwind
[6.0](https://github.com/llvm-mirror/libunwind/commits/release_60) add
support to mips, we do not need to assume dynamic linking.
2018-01-22 16:14:51 -02:00
Alex Crichton 0e795a2106 rustbuild: Don't allow stable bootstrap from dev
I forgot to update the bootstrap compiler for the 1.23.0 release so let's make
sure it doesn't happen again!
2018-01-04 13:14:15 -08:00
Martin Lindhe ece9a57d1b fix some typos 2017-11-21 15:33:45 +01:00
James Tucker a3aef1aa95 Fix fuchsia toolchain prebuild setup
* Adjust bootstrap to provide useful output on failure
 * Add missing package dependencies in the build environment
 * Fix permission bits on prebuilt toolchain files
2017-09-24 21:32:27 -07:00
Alex Crichton e13f02eb2e rustbuild: Automatically enable Ninja on MSVC
Discovered in #43767 it turns out the default MSBuild generator in CMake for
whatever reason isn't supporting many of the configuration options we give to
LLVM. To improve the contributor experience automatically enable Ninja if we
find it to ensure that "flavorful" configurations of LLVM work by default in
more situations.

Closes #43767
2017-08-25 10:12:02 -07:00
Samuel Holland 8606782bc1 Infer a default musl_root for native builds 2017-08-22 16:24:29 -05: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 528646e127 Utilize interning to allow Copy/Clone steps 2017-07-20 11:24:32 -06:00
Mark Simulacrum 1654a2f5ac Use build.build instead of build.config.build 2017-07-04 07:39:47 -06:00
Mark Simulacrum 5809a7d0b7 Move targets, hosts, and build triple into Build. 2017-07-04 07:31:56 -06:00
Mark Simulacrum 712bd0d841 Remove src_is_git, instead call method on rust_info directly. 2017-07-04 07:31:56 -06:00
Mark Simulacrum 6766abbfa9 Clippy lints 2017-07-04 07:31:55 -06:00
Mark Simulacrum 7ed4ee272e Clean up and restructure sanity checking. 2017-07-04 07:31:55 -06:00
Ian Douglas Scott f98ffb5bc3
Make Build.cxx() return a Result instead of panicking 2017-06-22 11:51:32 -07:00
Stepan Koltsov f441e07feb Pass path to python from bootstrap.py to bootstrap.rs
When bootstrap is executed with python not in `$PATH`, (e. g.
`c:\Python27\python.exe x.py test`) bootstrap cannot find python
and crashes.

This commit passes path to python in `BOOTSTRAP_PYTHON` env var.
2017-06-21 19:01:24 +03:00
Josh Stone 1ed07ba4f1 rustbuild: Sanity-check cmake for sanitizers too
It's possible to build the sanitizers when using an external LLVM, but
we still need cmake for this.  Extend the sanity check to look for cmake
whenever sanitizers are enabled too.
2017-05-02 10:58:47 -07:00
Josh Stone 3fb1a849dd Add a common Build::src_is_git flag 2017-04-03 13:46:50 -07:00
Corey Farwell 97a1b6a055 Update usages of 'OSX' (and other old names) to 'macOS'.
As of last year with version 'Sierra', the Mac operating system is now
called 'macOS'.
2017-03-12 14:59:04 -04:00
Alex Crichton 500076e141 travis: Split Android into dist/test images
PRs can't land againt beta right now because the android bot is filling up on
disk space. I don't really know what's going on but the android bot is the
longest one to run anyway so it'll benefit from being split up regardless.
2017-02-27 21:20:23 -08:00
Alex Crichton e8f9d2d43a travis: Get an emscripten builder online
This commit adds a new entry to the Travis matrix which will execute emscripten
test suites. Along the way it updates a few bits of the test suite to continue
passing on emscripten, such as:

* Ignoring i128/u128 tests as they're presumably just not working (didn't
  investigate as to why)
* Disabling a few process tests (not working on emscripten)
* Ignore some num tests in libstd (#39119)
* Fix some warnings when compiling
2017-01-19 13:54:19 -08:00
Robin Kruppe d44bcbf9ee Accept ninja-build binary in place of ninja 2016-12-27 16:36:53 +01:00
Seo Sanghyeon 73877a0bc8 Find FileCheck using llvm-config 2016-12-20 19:48:14 +09:00
Alex Crichton 96a5fc76dc rustbuild: Add sccache support
This commit adds support for sccache, a ccache-like compiler which works on MSVC
and stores results into an S3 bucket. This also switches over all Travis and
AppVeyor automation to using sccache to ensure a shared and unified cache over
time which can be shared across builders.

The support for sccache manifests as a new `--enable-sccache` option which
instructs us to configure LLVM differently to use a 'sccache' binary instead of
a 'ccache' binary. All docker images for Travis builds are updated to download
Mozilla's tooltool builds of sccache onto various containers and systems.
Additionally a new `rust-lang-ci-sccache` bucket is configured to hold all of
our ccache goodies.
2016-12-14 15:40:18 -08:00
Alex Crichton 0e272de69f mk: Switch rustbuild to the default build system
This commit switches the default build system for Rust from the makefiles to
rustbuild. The rustbuild build system has been in development for almost a year
now and has become quite mature over time. This commit is an implementation of
the proposal on [internals] which slates deletion of the makefiles on
2016-01-02.

[internals]: https://internals.rust-lang.org/t/proposal-for-promoting-rustbuild-to-official-status/4368

This commit also updates various documentation in `README.md`,
`CONTRIBUTING.md`, `src/bootstrap/README.md`, and throughout the source code of
rustbuild itself.

Closes #37858
2016-12-07 00:30:23 -08:00
Alex Crichton 5f626138a0 rustbuild: Allow configuration of python interpreter
Add a configuration key to `config.toml`, read it from `./configure`, and add
auto-detection if none of those were specified.

Closes #35760
2016-11-14 08:07:02 -08:00
Mark-Simulacrum c524c50edf compiletest: detect nodejs binary, allow override
Allow passing a custom nodejs directory in configure.
2016-11-10 18:37:41 -07:00
Tim Neumann dce460028e detect gdb version & rust support in compiletest 2016-10-31 21:12:59 +01:00
Nick Stevens 7937f6ccde rustbuild: Fix panic message when musl-root not set
The previous panic message delivered when a musl target was specified
but musl-root was not specified incorrectly instructed the user to add
the musl-root key to the "build" section of config.toml. The key
actually needs to be added to the "rust" section.
2016-10-04 20:22:51 -05:00
Brian Anderson afa72b5dd6 Don't build any native compiler-builtin components for emscripten 2016-09-30 14:04:09 -07:00
Brian Anderson 4f5e73be1b Build a dummy alloc_jemalloc crate on platforms that don't support it
This is a hack to support building targets that don't support jemalloc
alongside hosts that do. The jemalloc build is controlled by a feature
of the std crate, and if that feature changes between targets, it
invalidates the fingerprint of std's build script (this is a cargo
bug); so we must ensure that the feature set used by std is the same
across all targets, which means we have to build the alloc_jemalloc
crate for targets like emscripten, even if we don't use it.
2016-09-30 14:03:00 -07:00
Brian Anderson 27588dd7a1 Move nodejs detection into bootstrap
This avoids issues with mingw path conversions.
2016-09-28 09:05:19 -07:00
bors 1284081d33 Auto merge of #36256 - rjgoldsborough:make-configure-detect-nodejs-36207, r=alexcrichton
adding a check to bootstrap script

and a check to the rust config script

refs #36207

first crack at making configure detect nodejs
2016-09-09 14:04:31 -07:00
Jake Goldsborough 89bc13c37d tweaking the nodejs cmd sanity check 2016-09-08 17:51:06 -07:00
Jake Goldsborough 7e46f2ceaa moving nodejs detection logic to configure and adding
a nodejs cmd sanity check
2016-09-07 13:13:37 -07:00
Jorge Aparicio 8cfc69ecea add utility musl_root method, update config.toml.example 2016-09-06 21:49:02 -05:00
Jake Goldsborough 79644ac3c4 adding a check to sanity to look for the nodejs command 2016-09-06 07:41:20 -07:00
Jorge Aparicio 8df4a768a7 rustbuild: per target musl-root
config.toml now accepts a target.$TARGET.musl-root key that lets you
override the "build" musl-root value, which is set via the --musl-root
flag or via the build.musl-root key.

With this change, it's now possible to compile std for several musl
targets at once. Here's are the sample commands to do such thing:

```
$ configure \
    --enable-rustbuild \
    --target=x86_64-unknown-linux-musl,arm-unknown-linux-musleabi \
    --musl-root=/musl/x86_64-unknown-linux-musl/

$ edit config.toml && tail config.toml
[target.arm-unknown-linux-musleabi]
musl-root = "/x-tools/arm-unknown-linux-musleabi/arm-unknown-linux-musleabi/sysroot/usr"

$ make
```
2016-09-06 01:04:41 -05:00
Jorge Aparicio c70d633e94 rustbuild: skip filecheck check if codegen tests are disabled
to match the behavior of the old Makefile-based build system

closes #35752
2016-08-27 17:13:13 -05:00
Jan-Erik Rediger 5dac93d59c [emscripten] Disable jemalloc for emscripten 2016-08-10 16:38:23 +02:00
Timon Van Overveldt f7247d1071 Add ARM MUSL targets.
The targets are:
- `arm-unknown-linux-musleabi`
- `arm-unknown-linux-musleabihf`
- `armv7-unknown-linux-musleabihf`

These mirror the existing `gnueabi` targets.

All of these targets produce fully static binaries, similar to the
x86 MUSL targets.

For now these targets can only be used with `--rustbuild` builds, as
https://github.com/rust-lang/compiler-rt/pull/22 only made the
necessary compiler-rt changes in the CMake configs, not the plain
GNU Make configs.

I've tested these targets GCC 5.3.0 compiled again musl-1.1.12
(downloaded from http://musl.codu.org/). An example `./configure`
invocation is:

```
./configure \
    --enable-rustbuild
    --target=arm-unknown-linux-musleabi \
    --musl-root="$MUSL_ROOT"
```

where `MUSL_ROOT` points to the `arm-linux-musleabi` prefix.
Usually that path will be of the form
`/foobar/arm-linux-musleabi/arm-linux-musleabi`.

Usually the cross-compile toolchain will live under
`/foobar/arm-linux-musleabi/bin`. That path should either by added
to your `PATH` variable, or you should add a section to your
`config.toml` as follows:

```
[target.arm-unknown-linux-musleabi]
cc = "/foobar/arm-linux-musleabi/bin/arm-linux-musleabi-gcc"
cxx = "/foobar/arm-linux-musleabi/bin/arm-linux-musleabi-g++"
```

As a prerequisite you'll also have to put a cross-compiled static
`libunwind.a` library in `$MUSL_ROOT/lib`. This is similar to [how
the x86_64 MUSL targets are built]
(https://doc.rust-lang.org/book/advanced-linking.html).
2016-07-30 15:39:13 -05:00
Aravind Gollakota 4ffbb5dd63 rustbuild: Ensure PATH does not contain invalid character `"` 2016-07-27 21:19:51 -07:00
Alex Crichton 48a07bfb95 rustbuild: Remove the `build` directory
The organization in rustbuild was a little odd at the moment where the `lib.rs`
was quite small but the binary `main.rs` was much larger. Unfortunately as well
there was a `build/` directory with the implementation of the build system, but
this directory was ignored by GitHub on the file-search prompt which was a
little annoying.

This commit reorganizes rustbuild slightly where all the library files (the
build system) is located directly inside of `src/bootstrap` and all the binaries
now live in `src/bootstrap/bin` (they're small). Hopefully this should allow
GitHub to index and allow navigating all the files while maintaining a
relatively similar layout to the other libraries in `src/`.
2016-07-05 21:58:20 -07:00