Commit Graph

106 Commits

Author SHA1 Message Date
Charles Lew 485e98aae2 Implement uncommon_codepoints lint. 2020-01-03 08:20:12 +08:00
Charles Lew 27e7a1baed Add unicode-normalization to whitelist. 2019-12-26 14:16:36 +08:00
Mark Rousskov a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Alex Crichton 7f23e6e8d7
rustc: Link LLVM directly into rustc again
This commit builds on #65501 continue to simplify the build system and
compiler now that we no longer have multiple LLVM backends to ship by
default. Here this switches the compiler back to what it once was long
long ago, which is linking LLVM directly to the compiler rather than
dynamically loading it at runtime. The `codegen-backends` directory of
the sysroot no longer exists and all relevant support in the build
system is removed. Note that `rustc` still supports a dynamically loaded
codegen backend as it did previously, it just no longer supports
dynamically loaded codegen backends in its own sysroot.

Additionally as part of this the `librustc_codegen_llvm` crate now once
again explicitly depends on all of its crates instead of implicitly
loading them through the sysroot. This involved filling out its
`Cargo.toml` and deleting all the now-unnecessary `extern crate`
annotations in the header of the crate. (this in turn required adding a
number of imports for names of macros too).

The end results of this change are:

* Rustbuild's build process for the compiler as all the "oh don't forget
  the codegen backend" checks can be easily removed.
* Building `rustc_codegen_llvm` is much simpler since it's simply
  another compiler crate.
* Managing the dependencies of `rustc_codegen_llvm` is much simpler since
  it's "just another `Cargo.toml` to edit"
* The build process should be a smidge faster because there's more
  parallelism in the main rustc build step rather than splitting
  `librustc_codegen_llvm` out to its own step.
* The compiler is expected to be slightly faster by default because the
  codegen backend does not need to be dynamically loaded.
* Disabling LLVM as part of rustbuild is still supported, supporting
  multiple codegen backends is still supported, and dynamic loading of a
  codegen backend is still supported.
2019-12-11 09:50:11 -05:00
Eric Huss 2b98532250 Update cargo, rls, books. 2019-11-25 08:14:07 -08:00
Eric Huss 32d1f47a06 Fix mdbook-linkcheck license checks. 2019-11-12 10:45:33 -08:00
Stefan Lankes 8a11c61a7a remove hermit-abi from the wrong list, add to the whitelist 2019-10-21 20:23:59 +02:00
Stefan Lankes 0a7ba6b9fc add hermit-abi to the whitelist 2019-10-21 19:43:24 +02:00
Josh Stone 98779ed097 add crossbeam-queue to the whitelist 2019-10-07 13:43:10 -07:00
Mazdak Farrokhzad 5b995397db
Rollup merge of #63676 - newpavlov:wasi, r=alexcrichton
Use wasi crate for Core API

Blocked by: CraneStation/rust-wasi#5

Blocks: rust-lang/libc#1461

cc @sunfishcode @alexcrichton
2019-09-06 09:36:36 +02:00
bors 19a38de68a Auto merge of #63402 - estebank:strip-margin, r=oli-obk
Strip code to the left and right in diagnostics for long lines

Fix #62999.
2019-08-30 06:49:15 +00:00
Artyom Pavlov 127311b75e
whitelist wasi crate 2019-08-29 18:08:13 +00:00
newpavlov 06acfb22e0 add wasi license to the licenses whitelist 2019-08-29 20:22:24 +03:00
Alex Crichton b47c9690d2 bootstrap: Merge the libtest build step with libstd
Since its inception rustbuild has always worked in three stages: one for
libstd, one for libtest, and one for rustc. These three stages were
architected around crates.io dependencies, where rustc wants to depend
on crates.io crates but said crates don't explicitly depend on libstd,
requiring a sysroot assembly step in the middle. This same logic was
applied for libtest where libtest wants to depend on crates.io crates
(`getopts`) but `getopts` didn't say that it depended on std, so it
needed `std` built ahead of time.

Lots of time has passed since the inception of rustbuild, however,
and we've since gotten to the point where even `std` itself is depending
on crates.io crates (albeit with some wonky configuration). This
commit applies the same logic to the two dependencies that the `test`
crate pulls in from crates.io, `getopts` and `unicode-width`. Over the
many years since rustbuild's inception `unicode-width` was the only
dependency picked up by the `test` crate, so the extra configuration
necessary to get crates building in this crate graph is unlikely to be
too much of a burden on developers.

After this patch it means that there are now only two build phasese of
rustbuild, one for libstd and one for rustc. The libtest/libproc_macro
build phase is all lumped into one now with `std`.

This was originally motivated by rust-lang/cargo#7216 where Cargo was
having to deal with synthesizing dependency edges but this commit makes
them explicit in this repository.
2019-08-23 16:46:11 -07:00
Esteban Küber f08b036cc7 Introduce `term-size` dependency and consider term width when trimming 2019-08-21 11:56:20 -07:00
gnzlbg e736345db4 Remove spin dependency 2019-08-01 17:01:33 +02:00
gnzlbg a3c8f63868 Update Cargo.lock 2019-08-01 17:01:33 +02:00
gnzlbg 74dc2b6f6f Remove mach dependency 2019-08-01 17:01:33 +02:00
André Luis Leal Cardoso Junior 9ca5dee0ad Add 'Apache-2.0 OR MIT' license variation to tidy/tools check 2019-07-06 11:05:22 -03:00
Laurențiu Nicola b888eb92c5 Bump some of the crates using rand 2019-06-12 19:39:14 +03:00
Philipp Hansch 3f727aeeb7
Add new diagnostic writer using annotate-snippet library
This adds a new diagnostic writer `AnnotateRsEmitterWriter` that uses
the [`annotate-snippet`][as] library to print out the human readable
diagnostics.

The goal is to eventually switch over to using the library instead of
maintaining our own diagnostics output.

This commit does *not* add all the required features to the new
diagnostics writer. It is only meant as a starting point so that other
people can contribute as well.

[as]: https://github.com/rust-lang/annotate-snippets-rs
2019-06-04 18:46:00 +02:00
Eduard-Mihai Burtescu 961fe5479f rustc: use indexmap instead of a plain vector for upvars. 2019-06-01 19:17:22 +03:00
Alex Crichton d1040fe329 std: Depend on `backtrace` crate from crates.io
This commit removes all in-tree support for generating backtraces in
favor of depending on the `backtrace` crate on crates.io. This resolves
a very longstanding piece of duplication where the standard library has
long contained the ability to generate a backtrace on panics, but the
code was later extracted and duplicated on crates.io with the
`backtrace` crate. Since that fork each implementation has seen various
improvements one way or another, but typically `backtrace`-the-crate has
lagged behind libstd in one way or another.

The goal here is to remove this duplication of a fairly critical piece
of code and ensure that there's only one source of truth for generating
backtraces between the standard library and the crate on crates.io.
Recently I've been working to bring the `backtrace` crate on crates.io
up to speed with the support in the standard library which includes:

* Support for `StackWalkEx` on MSVC to recover inline frames with
  debuginfo.
* Using `libbacktrace` by default on MinGW targets.
* Supporting `libbacktrace` on OSX as an option.
* Ensuring all the requisite support in `backtrace`-the-crate compiles
  with `#![no_std]`.
* Updating the `libbacktrace` implementation in `backtrace`-the-crate to
  initialize the global state with the correct filename where necessary.

After reviewing the code in libstd the `backtrace` crate should be at
exact feature parity with libstd today. The backtraces generated should
have the same symbols and same number of frames in general, and there's
not known divergence from libstd currently.

Note that one major difference between libstd's backtrace support and
the `backtrace` crate is that on OSX the crates.io crate enables the
`coresymbolication` feature by default. This feature, however, uses
private internal APIs that aren't published for OSX. While they provide
more accurate backtraces this isn't appropriate for libstd distributed
as a binary, so libstd's dependency on the `backtrace` crate explicitly
disables this feature and forces OSX to use `libbacktrace` as a
symbolication strategy.

The long-term goal of this refactoring is to eventually move us towards
a world where we can drop `libbacktrace` entirely and simply use Gimli
and the surrounding crates for backtrace support. That's still aways off
but hopefully will much more easily enabled by having the source of
truth for backtraces live in crates.io!

Procedurally if we go forward with this I'd like to transfer the
`backtrace-rs` crate to the rust-lang GitHub organization as well, but I
figured I'd hold off on that until we get closer to merging.
2019-05-25 17:09:45 -07:00
Mazdak Farrokhzad 835281fb04
Rollup merge of #61096 - ehuss:tidy-license-short-circuit, r=Centril
tidy: don't short-circuit on license error

If there is more than one license error, tidy would only print the first
error. This changes it so that all license errors are printed.
2019-05-25 04:55:30 +02:00
Eric Huss 46ffb6adba tidy: don't short-circuit on license error
If there is more than one license error, tidy would only print the first
error. This changes it so that all license errors are printed.
2019-05-23 13:33:08 -07:00
Eric Huss d5e03530f7 Update cargo 2019-05-23 13:27:49 -07:00
Andy Russell b2f71fb540
remove unneeded `extern crate`s from build tools 2019-05-09 12:03:13 -04:00
Alexey Shmalko 1937bf2626
Migrate tidy to rust 2018 edition 2019-05-03 22:19:24 +03:00
Wesley Wiser 56e434d84d Use measureme in self-profiler
Related to #58372
Related to #58967
2019-04-12 20:27:29 -04:00
John Kåre Alsaker b440041a19 Allow itertools 2019-03-20 16:34:30 +01:00
John Kåre Alsaker 97431a4090 Create a derive macro for HashStable 2019-03-05 00:36:20 +01:00
kennytm c835a0a94d
Rollup merge of #58842 - mati865:53005, r=alexcrichton
Forbid duplicating Cargo as a dependency

Fixes https://github.com/rust-lang/rust/issues/53005
2019-03-02 22:58:49 +08:00
Mateusz Mikuła c3aab14480 Forbid duplicating Cargo as a dependency 2019-03-01 15:11:32 +01:00
Mazdak Farrokhzad 3391f6ce80 tidy: deny(rust_2018_idioms) 2019-03-01 10:16:01 +01:00
flip1995 4f96a03ab3
Add constant_time_eq to license exception list of tidy tool 2019-02-18 10:32:00 +01:00
James Munns f8a9a28421 Add exception for new dependency in license checker 2019-01-30 09:25:12 -05:00
Alexander Regueiro 88336ea4c3 Cosmetic improvements 2019-01-13 19:47:02 +00:00
Eric Huss 5739364784 Update cargo, rls, miri 2018-12-28 17:23:01 -08:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Alex Crichton fcc8bb41e9 std: Use `rustc_demangle` from crates.io
No more need to duplicate the demangling routine between crates.io and
the standard library, we can use the exact same one!
2018-12-14 15:15:53 -08: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
Alex Crichton b4110900bd Update Cargo submodule and its dependencies
Hopefully just another routine update!

So far this starts to enable the `std::arch` in stage0 builds of rustc.
This means that we may need stage0/not(stage0) in stdsimd itself, but
more and more code is starting to use `std::arch` so I think it's time
to start shifting the balance of work here.
2018-12-10 13:45:22 -08: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
Eric Huss 8c20adddbc Update cargo 2018-12-03 06:04:48 -08:00
Eduard-Mihai Burtescu 7c166f54b2 Move Cargo.{toml,lock} to the repository root directory. 2018-11-22 12:10:04 +02:00
Alex Crichton 01127ca666 Update Cargo submodule
Brings in some fixes and stabilizations!
2018-11-17 00:53:31 -08:00
Alex Crichton 8ccf112be2 Update Cargo
This commit brings in a few Cargo updates

* Updates Cargo with experimental HTTP/2 support - a post on the forums
  will be made about testing this when available.
* Bumps Cargo's own version number
2018-09-21 10:23:12 -07:00
kennytm d2a0f98159
Rollup merge of #53895 - joshtriplett:tidy-tidy, r=nikomatsakis
tidy: Cleanups and clippy warning fixes

This eliminates various clippy warnings in the tidy tool, as well as
making some related cleanups. These changes should not introduce any
functional differences.
2018-09-07 15:26:51 +08:00
Mark Rousskov 9ec5ef541a Breaking change upgrades 2018-09-04 13:22:08 -06:00
Michael Woerister d5545751f9 Add memmap crate to tidy whitelist. 2018-09-03 13:26:24 +02:00