Commit Graph

221 Commits

Author SHA1 Message Date
Josh Stone df0466d0bb Rebase to the llvm-project monorepo
The new git submodule src/llvm-project is a monorepo replacing src/llvm
and src/tools/{clang,lld,lldb}.  This also serves as a rebase for these
projects to the new 8.x branch from trunk.

The src/llvm-emscripten fork is unchanged for now.
2019-01-25 15:39:54 -08:00
Nicolas Bigaouette bf9c0fb650 Fix typo: 'rust-gdbgui' instead of 'rust-gdbui' 2019-01-17 15:05:55 -05:00
Nicolas Bigaouette 351946f974 Install missing 'rust-gdbui''
See https://github.com/rust-lang/rust/pull/53774#issuecomment-419704939
2019-01-17 14:16:26 -05:00
Alex Crichton dd326f84fb Integrate miri into build-manifest
This fixes a mistake where miri was accidentally left out of the
build-manifest parsing, meaning that today's nightly generated a
manifest with invalid urls!
2019-01-10 07:53:19 -08: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
Alex Crichton 71fed3a8ab Don't package up libLLVM.so with libstd
It's only meant for rustc, so we should only install it once!
2019-01-02 13:07:26 -08:00
Alex Crichton ea7fef1ccf bootstrap: Link LLVM as a dylib with ThinLTO
When building a distributed compiler on Linux where we use ThinLTO to
create the LLVM shared object this commit switches the compiler to
dynamically linking that LLVM artifact instead of statically linking to
LLVM. The primary goal here is to reduce CI compile times, avoiding two+
ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll
reuse the one ThinLTO step done by LLVM's build itself.

Lots of discussion about this change can be found [here] and down. A
perf run will show whether this is worth it or not!

[here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334
2019-01-02 11:33:38 -08:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
kennytm 07f5dbc490
Revert "Rollup merge of #56944 - alexcrichton:less-thin2, r=michaelwoerister"
This reverts commit f1051b574c, reversing
changes made to 833e0b3b8a.
2018-12-25 13:25:57 +08:00
Alex Crichton 8d500572fa std: Use backtrace-sys from crates.io
This commit switches the standard library to using the `backtrace-sys`
crate from crates.io instead of duplicating the logic here in the Rust
repositor with the `backtrace-sys`'s crate's logic.

Eventually this will hopefully be a good step towards using the
`backtrace` crate directly from crates.io itself, but we're not quite
there yet! Hopefully this is a small incremental first step we can take.
2018-12-24 08:32:57 -08:00
Alex Crichton bd18a9295c bootstrap: Link LLVM as a dylib with ThinLTO
When building a distributed compiler on Linux where we use ThinLTO to
create the LLVM shared object this commit switches the compiler to
dynamically linking that LLVM artifact instead of statically linking to
LLVM. The primary goal here is to reduce CI compile times, avoiding two+
ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll
reuse the one ThinLTO step done by LLVM's build itself.

Lots of discussion about this change can be found [here] and down. A
perf run will show whether this is worth it or not!

[here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334
2018-12-17 21:13:32 -08:00
bors 748d354af3 Auto merge of #56600 - ljedrz:fix_edition, r=Mark-Simulacrum
bootstrap: fix edition

A byproduct of work on https://github.com/rust-lang/rust/pull/56595; done with `cargo fix --edition`.
2018-12-15 23:50:47 +00:00
Alex Crichton 4c21a3bc2a std: Depend directly on crates.io crates
Ever since we added a Cargo-based build system for the compiler the
standard library has always been a little special, it's never been able
to depend on crates.io crates for runtime dependencies. This has been a
result of various limitations, namely that Cargo doesn't understand that
crates from crates.io depend on libcore, so Cargo tries to build crates
before libcore is finished.

I had an idea this afternoon, however, which lifts the strategy
from #52919 to directly depend on crates.io crates from the standard
library. After all is said and done this removes a whopping three
submodules that we need to manage!

The basic idea here is that for any crate `std` depends on it adds an
*optional* dependency on an empty crate on crates.io, in this case named
`rustc-std-workspace-core`. This crate is overridden via `[patch]` in
this repository to point to a local crate we write, and *that* has a
`path` dependency on libcore.

Note that all `no_std` crates also depend on `compiler_builtins`, but if
we're not using submodules we can publish `compiler_builtins` to
crates.io and all crates can depend on it anyway! The basic strategy
then looks like:

* The standard library (or some transitive dep) decides to depend on a
  crate `foo`.
* The standard library adds

  ```toml
  [dependencies]
  foo = { version = "0.1", features = ['rustc-dep-of-std'] }
  ```
* The crate `foo` has an optional dependency on `rustc-std-workspace-core`
* The crate `foo` has an optional dependency on `compiler_builtins`
* The crate `foo` has a feature `rustc-dep-of-std` which activates these
  crates and any other necessary infrastructure in the crate.

A sample commit for `dlmalloc` [turns out to be quite simple][commit].
After that all `no_std` crates should largely build "as is" and still be
publishable on crates.io! Notably they should be able to continue to use
stable Rust if necessary, since the `rename-dependency` feature of Cargo
is soon stabilizing.

As a proof of concept, this commit removes the `dlmalloc`,
`libcompiler_builtins`, and `libc` submodules from this repository. Long
thorns in our side these are now gone for good and we can directly
depend on crates.io! It's hoped that in the long term we can bring in
other crates as necessary, but for now this is largely intended to
simply make it easier to manage these crates and remove submodules.

This should be a transparent non-breaking change for all users, but one
possible stickler is that this almost for sure breaks out-of-tree
`std`-building tools like `xargo` and `cargo-xbuild`. I think it should
be relatively easy to get them working, however, as all that's needed is
an entry in the `[patch]` section used to build the standard library.
Hopefully we can work with these tools to solve this problem!

[commit]: 28ee12db81
2018-12-11 21:08:22 -08:00
ljedrz a5a3da541b bootstrap: fix edition 2018-12-10 13:59:28 +01:00
bors 059e6a6f57 Auto merge of #56578 - alexreg:cosmetic-1, r=alexreg
Various minor/cosmetic improvements to code

r? @Centril 😄
2018-12-08 03:50:16 +00:00
Alexander Regueiro ee89c088b0 Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00
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
Jethro Beekman 4a3505682e Add x86_64-fortanix-unknown-sgx target to libstd and dependencies
The files src/libstd/sys/sgx/*.rs are mostly copied/adapted from
the wasm target.

This also updates the dlmalloc submodule to the very latest version.
2018-12-07 11:26:50 +05:30
Eduard-Mihai Burtescu 7c166f54b2 Move Cargo.{toml,lock} to the repository root directory. 2018-11-22 12:10:04 +02:00
Alex Crichton cc7590341a std: Delete the `alloc_system` crate
This commit deletes the `alloc_system` crate from the standard
distribution. This unstable crate is no longer needed in the modern
stable global allocator world, but rather its functionality is folded
directly into the standard library. The standard library was already the
only stable location to access this crate, and as a result this should
not affect any stable code.
2018-11-11 09:22:28 -08:00
bors b6e8f9dbdc Auto merge of #55238 - alexcrichton:rm-jemalloc, r=estebank
Remove the `alloc_jemalloc` crate

This commit removes the `alloc_jemalloc` crate from the standard library and all related configuration. We will no longer be shipping this unstable crate. Rationale for this is provided on https://github.com/rust-lang/rust/issues/36963 and the many linked issues, but I can inline rationale here if desired!

We currently rely on jemalloc for increased perf in the Rust compiler, however. [This perf run shows](https://perf.rust-lang.org/compare.html?start=74ff7dcb1388e60a613cd6050bcd372a3cc4998b&end=7e7928dc0340d79b404e93f0c79eb4b946c1d669&stat=wall-time) that if we switch to glibc 2.23's allocator that it's slower than jemalloc across many benchmarks. [This perf run, however](https://perf.rust-lang.org/compare.html?start=22cc2ae8057d14e980b7c784e1eb2eee26b59e7d&end=10c95ccfa7a7adc12f4e608621ca29f9b98eed29), shows that if we use `jemalloc-sys` from crates.io then rustc actually gets faster across all benchmarks! (presumably because it has a more recent version of jemalloc than our submodule).

As a result, it's expected that this doesn't regress any code (as it's just removing an unstable crate) and it should actually improve rustc performance because it updates jemalloc.

Closes #36963
2018-11-03 09:33:10 +00:00
bors 757d6cc91a Auto merge of #55363 - pietroalbini:update-cargo-vendor, r=Mark-Simulacrum
Bump cargo-vendor version

Currently we pin `cargo-vendor` to 0.1.4, which doesn't set the `User-Agent` HTTP header. crates.io is going to require that header in the near future, so this PR bumps the pinned version of the crate to the latest one (which correctly sets the header).

r? @Mark-Simulacrum
cc @sgrif
2018-11-03 06:50:19 +00: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
Pietro Albini 5b00095137
Rollup merge of #55280 - vlad20012:add-libproc_macro-to-src-disrt, r=Mark-Simulacrum
Add libproc_macro to rust-src distribution

Fixes #55279
2018-11-01 11:55:19 +01:00
Pietro Albini 4084eb032f
bootstrap: bump cargo-vendor version to 0.1.19 2018-10-31 15:55:26 +01:00
Shotaro Yamada 3878d24ef6 Remove redundant clone 2018-10-26 12:07:39 +09:00
vlad20012 ea3e9a3824 Add libproc_macro to rust-src distribution 2018-10-23 07:51:22 +03:00
Alex Crichton 4f661c016f Update Cargo, build curl/OpenSSL statically via features
In addition to to updating Cargo's submodule and Cargo's dependencies,
this also updates Cargo's build to build OpenSSL statically into Cargo
as well as libcurl unconditionally. This removes OpenSSL build logic
from the bootstrap code, and otherwise requests that even on OSX we
build curl statically.
2018-10-20 18:47:01 -07:00
Matthias Krüger 9c651b3b31 bootstrap: update clippy license locations which changed due to relicensing. 2018-10-13 20:38:49 +02:00
Christian Poveda 53254a888b Add enable-missing-tools option 2018-09-28 01:53:38 -05:00
Tom Tromey 8aae6ca44a Have rust-lldb look for the rust-enabled lldb
We're shipping a rust-enabled lldb, but the "lldb" executable is not
installed into the "bin" directory by rustup.  See the discussion in
https://github.com/rust-lang-nursery/rustup.rs/pull/1492 for
background on this decision.  There, we agreed to have rust-lldb
prefer the rust-enabled lldb if it is installed.

This patch changes dist.rs to put lldb into rustlib, following what
was done for the other LLVM tools in #53955, and then fixes rust-lldb
to prefer that lldb, if it exists.

See issue #48168
2018-09-07 09:13:47 -06:00
Alex Crichton bd1fb60133 Ship libLLVM.dylib on OSX
Previously we just weren't shipping this at all as we were only looking for the
Linux version!
2018-09-06 19:06:09 -07:00
Alex Crichton bce09b6e34 rustbuild: Tweak LLVM distribution layout
This commit tweaks the layout of a few components that we distribute to
hopefully fix across all platforms the recent issues with LLD being unable to
find the LLVM shared object. In #53245 we switched to building LLVM as a dynamic
library, which means that LLVM tools by default link to LLVM dynamically rather
than statically. This in turn means that the tools, at runtime, need to find the
LLVM shared library.

LLVM's shared library is currently distributed as part of the rustc component.
This library is located, however, at `$sysroot/lib`. The LLVM tools we ship are
in two locations:

* LLD is shipped at `$sysroot/lib/rustlib/$host/bin/rust-lld`
* Other LLVM tools are shipped at `$sysroot/bin`

Each LLVM tool has an embedded rpath directive indicating where it will search
for dynamic libraries. This currently points to `../lib` and is presumably
inserted by LLVM's build system. Unfortunately, though, this directive is only
correct for the LLVM tools at `$sysroot/bin`, not LLD!

This commit is targeted at fixing this situation by making two changes:

* LLVM tools other than LLD are moved in the distribution to
  `$sysroot/lib/rustlib/$host/bin`. This moves them next to LLD and should
  position them for...
* The LLVM shared object is moved to `$sysroot/lib/rustlib/$host/lib`

Together this means that all tools should natively be able to find the shared
object and the shared object should be installed all the time for the various
tools. Overall this should...

Closes #53813
2018-09-05 09:17:20 -07:00
Alex Crichton b7a604ab34 rustbuild: Distribute libLLVM.so with rustc
A recent change (#53245) started to build LLVM with ThinLTO enabled and to
ensure that compile times are kept down it builds LLVM dynamically by default to
ensure that all the various LLVM tools aren't redoing all that optimization
work. This means, however, that all LLVM tools depend on LLVM's dynamic library
by default.

While the LLVM tools and LLDB components were updated to include the shared
library we accidentally forgot about LLD, included with the main rustc
component. LLD also links dynamically to LLVM and ships a non-working binary
right now because of this!

This commit updates our distribution to ship the LLVM dynamic library with the
compiler libraries.  While not technically needed for rustc itself to operate
(right now) it may be needed for LLD, and otherwise it serves as a good basis
for the other LLVM tools components to work with as well.

This should...

Closes #53813
2018-08-30 09:43:15 -07:00
Michael Woerister 3cf6f0db1a bootstrap: Link LLVM tools dynamically in order to save time in ThinLTO builds. 2018-08-29 12:27:20 +02:00
Tom Tromey 6e3a4f4ddd Add lldb to the build
This optionally adds lldb (and clang, which it needs) to the build.

Because rust uses LLVM 7, and because clang 7 is not yet released, a
recent git master version of clang is used.

The lldb that is used includes the Rust plugin.

lldb is only built when asked for, or when doing a nightly build on
macOS.  Only macOS is done for now due to difficulties with the Python
dependency.
2018-08-14 18:59:23 -06:00
Simon Sapin d8b3c830fb Remove the unstable std_unicode crate, deprecated since 1.27
Its former contents are now in libcore.
2018-07-30 18:18:04 +02:00
ljedrz 421b2ba347 Don't format!() string literals 2018-07-28 17:58:52 +02:00
Sébastien Marie 7e7c21492f tidy: avoid long line 2018-07-15 09:58:58 +02:00
Sébastien Marie 3f7ef2d733 Disable LlvmTools packaging with external LLVM
Fixes: #52102
2018-07-15 09:23:36 +02:00
bors 4ba5ff4d30 Auto merge of #52172 - oli-obk:clippy_in_rls, r=nrc
Inject clippy into the rls again

Also makes sure we actually point to the local rustfmt

r? @nrc

cc @Manishearth
2018-07-11 21:54:44 +00:00
ljedrz 232e77e007 Change gcc warning file name, remove unnecessary reference 2018-07-09 21:25:16 +02:00
ljedrz 6b6a7a4691 Warn windows-gnu users that the bundled gcc can't compile 2018-07-09 15:28:12 +02:00
Oliver Schneider 7a8e085835 Also distribute cargo clippy 2018-07-09 10:15:30 +02:00
bors 2d5a295d51 Auto merge of #51917 - alexcrichton:update, r=Mark-Simulacrum
Update crates in `Cargo.lock`

This is a "hopefully routine" update of our crates.io-based crates in
`Cargo.lock`, and let's see how it fares on CI...
2018-07-05 20:25:00 +00:00
bors 6fc21e5576 Auto merge of #51936 - japaric:rust-lld, r=alexcrichton
rename rustc's lld to rust-lld

to not shadow the system installed LLD when linking with LLD.

Before:

- `-C linker=lld -Z linker-flavor=ld.lld` uses rustc's LLD
- It's not possible to use a system installed LLD that's named `lld`

With this commit:

- `-C linker=rust-lld -Z linker-flavor=ld.lld` uses rustc's LLD
- `-C linker=lld -Z linker-flavor=ld.lld` uses the system installed LLD

we don't offer guarantees about the availability of LLD in the rustc sysroot so we can rename the tool as long as we don't break the wasm32-unknown-unknown target which depends on it.

r? @alexcrichton we discussed this before
2018-07-05 06:44:16 +00:00
Jorge Aparicio 31ed5c7a01 in the second copy lld is already named rust-lld 2018-07-04 23:10:10 -05:00
Alex Crichton ef41cf0288 Compile stage0 tools with the raw bootstrap compiler
This commit updates the stage0 build of tools to use the libraries of the stage0
compiler instead of the compiled libraries by the stage0 compiler. This should
enable us to avoid any stage0 hacks (like missing SIMD).
2018-07-03 18:06:29 -07:00
bors 4faaf7e335 Auto merge of #51122 - oli-obk:clippy, r=Mark-Simulacrum
Did you mean to block nightlies on clippy?

Discussion: https://gitter.im/rust-lang/WG-clippy?at=5b073b6597a0361fb760cdc2

r? @alexcrichton

did I forget anything?

cc @nrc @Manishearth
2018-07-02 14:04:26 +00:00