Commit Graph

28 Commits

Author SHA1 Message Date
Tatsuyuki Ishi e098985939 Deny bare_trait_objects globally 2018-07-25 10:25:29 +09:00
Alex Crichton 2e5d925926 Don't build twice the sanitizers on Linux
This commit is an attempted fix at #50887. It was noticed that on that issue
we're building both x86_64 and i386 versions of libraries, but we only actually
need the x86_64 versions! This hopes that the build race condition exhibited
in #50887 is connected to building both architectures and/or building a lot of
libraries, so this should help us build precisely what we need and no more.
2018-07-18 07:44:11 -07:00
ljedrz 5058af7003 Deny bare trait objects in the rest of rust 2018-07-12 13:50:22 +02:00
Seiichi Uchida 23b880ade5 Run rustfmt on build_helper 2018-04-12 14:49:03 +09:00
Mark Simulacrum c115cc655c Move deny(warnings) into rustbuild
This permits easier iteration without having to worry about warnings
being denied.

Fixes #49517
2018-04-08 16:59:14 -06:00
Mark Simulacrum 86915ddf30 Remove filetime dep from build_helper 2018-04-01 04:49:21 -06:00
kennytm 2566fa25c7
Revert "Add a file to trivially disable tool building or testing"
This reverts commit ab018c76e1.

This also adds the `ToolBuild::is_ext_tool` field to replace the previous
`ToolBuild::expectation` field, to indicate whether a build-failure of
certain tool is essential.
2017-12-27 00:00:45 +08:00
Nikolay Merinov f2df1f5ec6 build_helper: destination file can't be up to date when not exists
Function "up_to_date" return incorrect result if mtime for all fetched
sources is set to epoch time. Add existence check to function.
2017-12-01 14:55:02 +05:00
Vadim Petrochenkov 9e0fc5ccd0 rustbuild: Support specifying archiver and linker explicitly 2017-10-15 22:10:07 +03:00
Oliver Schneider ab018c76e1
Add a file to trivially disable tool building or testing 2017-09-17 21:41:45 +02:00
Oliver Middleton 94c90e79e1 rustbuild: Replace create_dir_racy with create_dir_all
`create_dir_all` has since been fixed so no need for `create_dir_racy`.
2017-08-07 16:04:46 +01:00
Alex Crichton 7e6c9f3635 Switch to rust-lang-nursery/compiler-builtins
This commit migrates the in-tree `libcompiler_builtins` to the upstream version
at https://github.com/rust-lang-nursery/compiler-builtins. The upstream version
has a number of intrinsics written in Rust and serves as an in-progress rewrite
of compiler-rt into Rust. Additionally it also contains all the existing
intrinsics defined in `libcompiler_builtins` for 128-bit integers.

It's been the intention since the beginning to make this transition but
previously it just lacked the manpower to get done. As this PR likely shows it
wasn't a trivial integration! Some highlight changes are:

* The PR rust-lang-nursery/compiler-builtins#166 contains a number of fixes
  across platforms and also some refactorings to make the intrinsics easier to
  read. The additional testing added there also fixed a number of integration
  issues when pulling the repository into this tree.

* LTO with the compiler-builtins crate was fixed to link in the entire crate
  after the LTO process as these intrinsics are excluded from LTO.

* Treatment of hidden symbols was updated as previously the
  `#![compiler_builtins]` crate would mark all symbol *imports* as hidden
  whereas it was only intended to mark *exports* as hidden.
2017-07-05 07:08:36 -07:00
Josh Stone 617aea4c9b rustbuild: Add `./x.py test --no-fail-fast`
This option forwards to each `cargo test` invocation, and applies the
same logic across all test steps to keep going after failures.  At the
end, a brief summary line reports how many commands failed, if any.

Note that if a test program fails to even start at all, or if an
auxiliary build command related to testing fails, these are still left
to stop everything right away.

Fixes #40219.
2017-06-02 09:27:44 -07:00
kennytm 00dff0aa59
Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin.
ASan and TSan are supported on macOS, and this commit enables their
support.

The sanitizers are always built as *.dylib on Apple platforms, so they
cannot be statically linked into the corresponding `rustc_?san.rlib`. The
dylibs are directly copied to `lib/rustlib/x86_64-apple-darwin/lib/`
instead.

Note, although Xcode also ships with their own copies of ASan/TSan dylibs,
we cannot use them due to version mismatch.

There is a caveat: the sanitizer libraries are linked as @rpath, so the
user needs to additionally pass `-C rpath`:

    rustc -Z sanitizer=address -C rpath file.rs
                               ^~~~~~~~

Otherwise there will be a runtime error:

    dyld: Library not loaded: @rpath/libclang_rt.asan_osx_dynamic.dylib
      Referenced from: /path/to/executable
      Reason: image not found
    Abort trap: 6

The next commit includes a temporary change in compiler to force the linker
to emit a usable @rpath.
2017-04-25 10:31:01 +08:00
Alex Crichton e412af2a88 rustbuild: Assert directory creation succeeds
I've been seeing failures on the bots when building jemalloc and my assumption
is that it's because cwd isn't created. That may be possible if this
`create_dir_all` call change in this commit fails, in which case we ignore the
error.

This commit updates the location to call `create_dir_racy` which handles
concurrent invocations, as multiple build scripts may be trying to create the
`native` dir.
2017-03-07 15:24:36 -08:00
Vadim Petrochenkov 428f063fcd Automate timestamp creation and build skipping for native libraries
Add comments
2017-03-04 21:38:26 +03:00
Vadim Petrochenkov aeadc81ddc Build compiler-rt and sanitizers only once 2017-03-04 21:38:26 +03:00
Alex Crichton 44a01b8a54 rustbuild: Add support for compiling Cargo
This commit adds support to rustbuild for compiling Cargo as part of the release
process. Previously rustbuild would simply download a Cargo snapshot and
repackage it. With this change we should be able to turn off artifacts from the
rust-lang/cargo repository and purely rely on the artifacts Cargo produces here.

The infrastructure added here is intended to be extensible to other components,
such as the RLS. It won't exactly be a one-line addition, but the addition of
Cargo didn't require too much hooplah anyway.

The process for release Cargo will now look like:

* The rust-lang/rust repository has a Cargo submodule which is used to build a
  Cargo to pair with the rust-lang/rust release
* Periodically we'll update the cargo submodule as necessary on rust-lang/rust's
  master branch
* When branching beta we'll create a new branch of Cargo (as we do today), and
  the first commit to the beta branch will be to update the Cargo submodule to
  this exact revision.
* When branching stable, we'll ensure that the Cargo submodule is updated and
  then make a stable release.

Backports to Cargo will look like:

* Send a PR to cargo's master branch
* Send a PR to cargo's release branch (e.g. rust-1.16.0)
* Send a PR to rust-lang/rust's beta branch updating the submodule
* Eventually send a PR to rust-lang/rust's master branch updating the submodule

For reference, the process to add a new component to the rust-lang/rust release
would look like:

* Add `$foo` as a submodule in `src/tools`
* Add a `tool-$foo` step which compiles `$foo` with the specified compiler,
  likely mirroring what Cargo does.
* Add a `dist-$foo` step which uses `src/tools/$foo` and the `tool-$foo` output
  to create a rust-installer package for `$foo` likely mirroring what Cargo
  does.
* Update the `dist-extended` step with a new dependency on `dist-$foo`
* Update `src/tools/build-manifest` for the new component.
2017-03-03 07:29:31 -08:00
Vadim Petrochenkov a5b603b1bf Build libbacktrace/jemalloc only when their timestamps are older than sources 2017-02-02 22:40:42 +03:00
Vadim Petrochenkov 6c2ef5201a rustbuild: Build jemalloc and libbacktrace only once (take 2) 2017-02-02 22:40:42 +03:00
Sébastien Marie a7d9025e40 let BSD to use gmake for GNU-make
the diff extends build_helper to provide an function to return the
expected name of GNU-make on the host: "make" or "gmake".

Fixes #38429
2016-12-17 20:09:23 +01:00
Sébastien Marie dd0fc0a03a Disconnect ar from cc on OpenBSD
OpenBSD usually use an alternative compiler (`egcc') from ports. But the
`ar' is unprefixed as it comes from base.
2016-12-17 14:48:27 +01:00
Alex Crichton 03fb5ad7c2 rustbuild: Print out failing commands
Just ensure that we always print out the command line which should aid in
debugging.

Closes #38228
2016-12-07 17:27:58 -08:00
Srinivas Reddy Thatiparthy 54e320d4bc
run rustfmt on various folders 2016-10-16 15:41:01 +05:30
Peter Atashian e0992df35f
Fix issue where rustbuild expected msvc to have ar
Signed-off-by: Peter Atashian <retep998@gmail.com>
2016-06-16 08:38:06 -04:00
pierzchalski 0fe1359885 whoops 2016-04-04 21:14:15 +10:00
pierzchalski 1e9595e116 Change build_helper to modify suffix of cc
This should help avoid issues when using tools like ccache.
2016-04-04 19:44:38 +10:00
Alex Crichton 046e6874c4 Add a Cargo-based build system
This commit is the start of a series of commits which start to replace the
makefiles with a Cargo-based build system. The aim is not to remove the
makefiles entirely just yet but rather just replace the portions that invoke the
compiler to do the bootstrap. This commit specifically adds enough support to
perform the bootstrap (and all the cross compilation within) along with
generating documentation.

More commits will follow up in this series to actually wire up the makefiles to
call this build system, so stay tuned!
2016-02-11 10:42:28 -08:00