summaryrefslogtreecommitdiff
path: root/src/build_helper
Commit message (Collapse)AuthorAgeFilesLines
* Remove licensesMark Rousskov2018-12-251-10/+0
|
* std: Depend directly on crates.io cratesAlex Crichton2018-12-111-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]: https://github.com/alexcrichton/dlmalloc-rs/commit/28ee12db813a3b650a7c25d1c36d2c17dcb88ae3
* Prefer unwrap_or_else to unwrap_or in case of function calls/allocationsljedrz2018-10-191-1/+2
|
* A handful of random string-related improvementsljedrz2018-10-101-6/+6
|
* Rename sanitizer runtime libraries on OSXAlex Crichton2018-09-291-3/+34
| | | | | | | | | | | | | | Currently we ship sanitizer libraries as they're built, but these names unfortunately conflict with the names of the sanitizer libraries installed on the system. If a crate, for example, links in C code that wants to use the system sanitizer and the Rust code doesn't use sanitizers at all, then using `cargo` may accidentally pull in the Rust-installed sanitizer library due to a conflict in names. This change is intended to be entirely transparent for Rust users of sanitizers, it should only hopefully improve our story with other users! Closes #54134
* Deny bare_trait_objects globallyTatsuyuki Ishi2018-07-251-2/+0
|
* Don't build twice the sanitizers on LinuxAlex Crichton2018-07-181-7/+20
| | | | | | | | 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.
* Deny bare trait objects in the rest of rustljedrz2018-07-121-0/+2
|
* Run rustfmt on build_helperSeiichi Uchida2018-04-121-47/+70
|
* Move deny(warnings) into rustbuildMark Simulacrum2018-04-081-1/+0
| | | | | | | This permits easier iteration without having to worry about warnings being denied. Fixes #49517
* Remove filetime dep from build_helperMark Simulacrum2018-04-012-15/+7
|
* Revert "Add a file to trivially disable tool building or testing"kennytm2017-12-271-61/+19
| | | | | | | | This reverts commit ab018c76e14b87f3c9e0b7384cc9b02d94779cd5. 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.
* build_helper: destination file can't be up to date when not existsNikolay Merinov2017-12-011-0/+3
| | | | | Function "up_to_date" return incorrect result if mtime for all fetched sources is set to epoch time. Add existence check to function.
* rustbuild: Support specifying archiver and linker explicitlyVadim Petrochenkov2017-10-151-21/+0
|
* Add a file to trivially disable tool building or testingOliver Schneider2017-09-171-19/+61
|
* rustbuild: Replace create_dir_racy with create_dir_allOliver Middleton2017-08-071-20/+1
| | | | `create_dir_all` has since been fixed so no need for `create_dir_racy`.
* Switch to rust-lang-nursery/compiler-builtinsAlex Crichton2017-07-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* rustbuild: Add `./x.py test --no-fail-fast`Josh Stone2017-06-021-12/+26
| | | | | | | | | | | | 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.
* Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin.kennytm2017-04-251-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* rustbuild: Assert directory creation succeedsAlex Crichton2017-03-071-3/+22
| | | | | | | | | | | 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.
* Automate timestamp creation and build skipping for native librariesVadim Petrochenkov2017-03-041-13/+20
| | | | Add comments
* Build compiler-rt and sanitizers only onceVadim Petrochenkov2017-03-041-1/+36
|
* rustbuild: Add support for compiling CargoAlex Crichton2017-03-031-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Build libbacktrace/jemalloc only when their timestamps are older than sourcesVadim Petrochenkov2017-02-022-0/+59
|
* rustbuild: Build jemalloc and libbacktrace only once (take 2)Vadim Petrochenkov2017-02-021-0/+15
|
* let BSD to use gmake for GNU-makeSébastien Marie2016-12-171-0/+10
| | | | | | | 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
* Disconnect ar from cc on OpenBSDSébastien Marie2016-12-171-0/+2
| | | | | OpenBSD usually use an alternative compiler (`egcc') from ports. But the `ar' is unprefixed as it comes from base.
* rustbuild: Print out failing commandsAlex Crichton2016-12-071-2/+4
| | | | | | | Just ensure that we always print out the command line which should aid in debugging. Closes #38228
* run rustfmt on various foldersSrinivas Reddy Thatiparthy2016-10-161-2/+6
|
* Fix issue where rustbuild expected msvc to have arPeter Atashian2016-06-161-5/+7
| | | | Signed-off-by: Peter Atashian <retep998@gmail.com>
* whoopspierzchalski2016-04-041-1/+1
|
* Change build_helper to modify suffix of ccpierzchalski2016-04-041-3/+9
| | | | This should help avoid issues when using tools like ccache.
* Add a Cargo-based build systemAlex Crichton2016-02-112-0/+76
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!