about summary refs log tree commit diff
path: root/src/build_helper
AgeCommit message (Collapse)AuthorLines
2021-09-20Migrate to 2021Mark Rousskov-1/+1
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-1/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
2021-06-04Revert "Revert "Move llvm submodule updates to rustbuild""Joshua Nelson-0/+1
This reverts commit ad308264a38531bc8d2179324bac3652a1cda640.
2021-05-24Revert "Move llvm submodule updates to rustbuild"Mark Rousskov-1/+0
2021-05-19Add track_caller to `builder_helper::output`Joshua Nelson-0/+1
If something goes wrong here, showing `fn output` is unhelpful. Show where the command is being run instead.
2020-11-05Fix even more URLsGuillaume Gomez-1/+1
2020-08-30cleanup: Remove duplicate library names from `Cargo.toml`sVadim Petrochenkov-1/+0
2020-07-22build: Harden env var tracking in build scriptsVadim Petrochenkov-4/+12
2020-01-09Remove sanitizer runtime cratesTomasz Miąsko-104/+0
2019-12-22Format the worldMark Rousskov-49/+26
2019-10-17show up some extra info when t!() failsGuanqun Lu-0/+7
2019-08-27rustbuild: allow disabling deny(warnings) for bootstrapMarc-Antoine Perennou-3/+0
When deny-warnings is not specified or set to true, the behaviour is the same as before. When deny-warnings is set to false, warnings are now allowed Fixes #63911 Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-08-22Apply clippy::redundant_field_names suggestionMateusz Mikuła-1/+1
2019-08-01build_helper: rename (try_)run_silent -> (try_)runRalf Jung-4/+4
2019-08-01build_helper: rename run -> run_verbose (seems unused)Ralf Jung-1/+2
2019-07-28Deny `unused_lifetimes` through rustbuildVadim Petrochenkov-1/+1
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-1/+2
rustbuild Remove some random unnecessary lint `allow`s
2019-05-22Bump compiler-builtins to 0.1.15Alex Crichton-3/+3
This commit bumps the `compiler-builtins` dependency to 0.1.15 which expects to have the source for `compiler-rt` provided externally if the `c` feature is enabled. This then plumbs through the necessary support in the build system to ensure that if the `llvm-project` directory is checked out and present that we enable the `c` feature of `compiler-builtins` and compile in all the C intrinsics.
2019-05-13Remove bitrig support from rustMarcel Hellwig-1/+1
2019-02-10rustc: doc commentsAlexander Regueiro-3/+3
2019-02-04Transition build_helper to 2018 editionHirokazu Hata-0/+3
2019-01-26Workaround presence of LLVM library in stage0/libMark Rousskov-0/+19
This commit works around the newly-introduced LLVM shared library. This is needed such that llvm-config run from librustc_llvm's build script can correctly locate it's own LLVM, not the one in stage0/lib. The LLVM build system uses the DT_RUNPATH/RUNPATH header within the llvm-config binary, which we want to use, but because Cargo always adds the host compiler's "libdir" (stage0/lib in our case) to the dynamic linker's search path, we weren't properly finding the freshly-built LLVM in llvm/lib. By restoring the environment variable setting the search path to what bootstrap sees, the problem is resolved and librustc_llvm correctly links and finds the appropriate LLVM. Several run-make-fulldeps tests are also updated with similar handling.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-11std: Depend directly on crates.io cratesAlex Crichton-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
2018-10-19Prefer unwrap_or_else to unwrap_or in case of function calls/allocationsljedrz-1/+2
2018-10-10A handful of random string-related improvementsljedrz-6/+6
2018-09-29Rename sanitizer runtime libraries on OSXAlex Crichton-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
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-2/+0
2018-07-18Don't build twice the sanitizers on LinuxAlex Crichton-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.
2018-07-12Deny bare trait objects in the rest of rustljedrz-0/+2
2018-04-12Run rustfmt on build_helperSeiichi Uchida-47/+70
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-1/+0
This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-01Remove filetime dep from build_helperMark Simulacrum-15/+7
2017-12-27Revert "Add a file to trivially disable tool building or testing"kennytm-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.
2017-12-01build_helper: destination file can't be up to date when not existsNikolay Merinov-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.
2017-10-15rustbuild: Support specifying archiver and linker explicitlyVadim Petrochenkov-21/+0
2017-09-17Add a file to trivially disable tool building or testingOliver Schneider-19/+61
2017-08-07rustbuild: Replace create_dir_racy with create_dir_allOliver Middleton-20/+1
`create_dir_all` has since been fixed so no need for `create_dir_racy`.
2017-07-05Switch to rust-lang-nursery/compiler-builtinsAlex Crichton-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.
2017-06-02rustbuild: Add `./x.py test --no-fail-fast`Josh Stone-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.
2017-04-25Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin.kennytm-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.
2017-03-07rustbuild: Assert directory creation succeedsAlex Crichton-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.
2017-03-04Automate timestamp creation and build skipping for native librariesVadim Petrochenkov-13/+20
Add comments
2017-03-04Build compiler-rt and sanitizers only onceVadim Petrochenkov-1/+36
2017-03-03rustbuild: Add support for compiling CargoAlex Crichton-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.
2017-02-02Build libbacktrace/jemalloc only when their timestamps are older than sourcesVadim Petrochenkov-0/+59
2017-02-02rustbuild: Build jemalloc and libbacktrace only once (take 2)Vadim Petrochenkov-0/+15
2016-12-17let BSD to use gmake for GNU-makeSébastien Marie-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
2016-12-17Disconnect ar from cc on OpenBSDSébastien Marie-0/+2
OpenBSD usually use an alternative compiler (`egcc') from ports. But the `ar' is unprefixed as it comes from base.
2016-12-07rustbuild: Print out failing commandsAlex Crichton-2/+4
Just ensure that we always print out the command line which should aid in debugging. Closes #38228