summary refs log tree commit diff
path: root/src/bootstrap/compile.rs
AgeCommit message (Collapse)AuthorLines
2017-12-22Don't try to statically link libstdc++ on FreeBSDScott Abbey-0/+1
The code inside this conditional will not work on FreeBSD 10+ because those versions use clang and libc++ rather than libstdc++. Since FreeBSD comes with libc++ in the base, presumably all 10+ systems will have it present. Searching for libstdc++.a will not work if it is not present. As a result, this would previously have set `LLVM_STATIC_STDCPP=libstdc++.a`, which isn't a valid path and caused problems later on when building `librustc_llvm`. This could possibly be updated in the future to look for `libc++.a` on FreeBSD, by expanding the code inside the conditional. In one attempt to run this on x86_64-freebsd, I found that libc++ was not compiled with PIC, so it failed anyway.
2017-12-17Add sync module to rustc_data_structuresJohn Kåre Alsaker-0/+3
2017-11-08std: Remove `rand` crate and moduleAlex Crichton-8/+10
This commit removes the `rand` crate from the standard library facade as well as the `__rand` module in the standard library. Neither of these were used in any meaningful way in the standard library itself. The only need for randomness in libstd is to initialize the thread-local keys of a `HashMap`, and that unconditionally used `OsRng` defined in the standard library anyway. The cruft of the `rand` crate and the extra `rand` support in the standard library makes libstd slightly more difficult to port to new platforms, namely WebAssembly which doesn't have any randomness at all (without interfacing with JS). The purpose of this commit is to clarify and streamline randomness in libstd, focusing on how it's only required in one location, hashmap seeds. Note that the `rand` crate out of tree has almost always been a drop-in replacement for the `rand` crate in-tree, so any usage (accidental or purposeful) of the crate in-tree should switch to the `rand` crate on crates.io. This then also has the further benefit of avoiding duplication (mostly) between the two crates!
2017-10-25rustbuild: Fix `no output generated` error for next bootstrap cargo.kennytm-4/+12
Due to rust-lang/cargo#4570, a `*.dll.lib` file is uplifted when building dynamic libraries on Windows. The current bootstrap code does not understand files with multiple extensions, and will instead assume `xxxx.dll` is the file name. This caused a `no output generated` error because it tries to search for `xxxx.dll-hash.lib` inside the `deps/` folder, while it should check for `xxxx-hash.dll.lib` instead. This PR is blocking #45285 (Bump to 1.23 and update bootstrap).
2017-10-21Fix rustbuild --color conflict when building on Travis outside of Docker.kennytm-2/+2
2017-10-18Make sure to clear out the stageN-{rustc,std,tools} directories.Mark Simulacrum-14/+9
We copy built tool binaries into a dedicated directory to avoid deleting them, stageN-tools-bin. These aren't ever cleared out by code, since there should be no reason to do so, and we'll simply overwrite them as necessary. When clearing out the stageN-{std,rustc,tools} directories, make sure to delete both Cargo directories -- per-target and build scripts. This ensures that changing libstd doesn't cause problems due to build scripts not being rebuilt, even though they should be.
2017-10-09cleanup: rustc doesn't use an external archiverVadim Petrochenkov-3/+0
2017-08-22Copy musl startup objects before building stdSamuel Holland-16/+27
They are required for linking it, even though it is a library, because crtn.o in post_link_objects, as hardcoded in src/librustc_back/target/ linux_musl_base.rs, is added to the linker command line for both executables and libraries.
2017-08-22Improve explanation of musl_rootSamuel Holland-1/+4
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-10/+10
Like #43008 (f668999), but _much more aggressive_.
2017-08-13Clean tools after building libstd/libtest/librustc.Mark Simulacrum-0/+17
This fixes the bug we previously had where we'd build a libtest tool after building a libstd tool and clear out the libstd tool. Since we clear out all tools for a given stage on invocations of CleanTools after lib{std, test, rustc} change, we need to make sure that all tools built with that stage will be built after the clearing is done. The fix contained here technically isn't perfect; there is still an edge case of compiling a libstd tool, then compiling libtest, which will clear out the libstd tool and it won't ever get rebuilt within that session of rustbuild. This is where the caching system used today shows it's problems -- in effect, all tools depend on a global counter of the stage being cleared out. We can implement such a counter in a future patch to ensure that tools are rebuilt as needed, but it is deemed unlikely that it will be required in practice, since most if not all tools are built after the relevant stage's std/test/rustc are built, though this is only an opinion and hasn't been verified.
2017-08-13Unify flags into config.Mark Simulacrum-2/+2
This introduces a slight change in behavior, where we unilaterally respect the --host and --target parameters passed for all sanity checking and runtime configuration.
2017-07-27Build rustdoc on-demand.Mark Simulacrum-9/+0
Rustdoc is no longer compiled in every stage, alongside rustc, instead it is only compiled when requested, and generally only for the last stage.
2017-07-25Bump master to 1.21.0Alex Crichton-107/+130
This commit bumps the master branch's version to 1.21.0 and also updates the bootstrap compiler from the freshly minted beta release.
2017-07-22Fix StartupObject buildMark Simulacrum-1/+1
2017-07-20Change make_run signature to taking a RunConfig struct for refactorability.Mark Simulacrum-37/+17
2017-07-20Remove step.rs commentsMark Simulacrum-162/+0
2017-07-20Implement available paths list.Mark Simulacrum-28/+19
2017-07-20Fix tidyMark Simulacrum-3/+4
2017-07-20Implement keep-stage supportMark Simulacrum-1/+13
2017-07-20Require should_run to be implemented.Mark Simulacrum-0/+20
2017-07-20Utilize interning to allow Copy/Clone stepsMark Simulacrum-107/+112
2017-07-20Remove core_intrinsics feature gateMark Simulacrum-0/+9
2017-07-20Cleanups and fixes throughoutMark Simulacrum-6/+3
2017-07-20Migrate to serde_json entirelyMark Simulacrum-5/+5
2017-07-20Pacify tidyMark Simulacrum-1/+2
2017-07-20Finish fixing warnings and errors. Bootstrap builds.Mark Simulacrum-6/+6
2017-07-20Fixes warnings and errors introduced while moving code aroundMark Simulacrum-54/+58
2017-07-20Change code to work with the new systemMark Simulacrum-23/+197
2017-07-20Move code into Step trait implementations.Mark Simulacrum-451/+419
No changes are introduced to code body. This commit will not build; it is done to permit a better diff in later commits.
2017-07-20Move rule configs out of stepMark Simulacrum-0/+252
2017-07-04Use build.build instead of build.config.buildMark Simulacrum-5/+5
2017-07-04Clippy lintsMark Simulacrum-8/+9
2017-07-04Cleanup compile.rs.Mark Simulacrum-4/+6
2017-06-30rustc_llvm: re-run build script when env var LLVM_CONFIG changesVenkata Giri Reddy-4/+0
2017-06-22Make Build.cxx() return a Result instead of panickingIan Douglas Scott-1/+1
2017-06-21Make rustc errors colorful.Mark Simulacrum-0/+32
Rustbuild passes --message-format=json to Cargo to learn about the dependencies for a given build, which then makes Cargo steal the stderr/stdout for the compiler process, leading to non colorful output. To avoid this, detection of stderr being a tty is added to rustbuild, and an environment variable is used to communicate with the rustc shim.
2017-06-04rustc_llvm: re-run build script if config.toml changesVenkata Giri Reddy-0/+4
2017-06-02ci: Improve log output (mainly Travis).kennytm-0/+4
* Bring back colors on Travis, which was disabled since #39036. Append --color=always to cargo when running in CI environment. * Removed `set -x` in the shell scripts. The `retry` function already prints which command it is running, add `-x` just add noise to the output. * Support travis_fold/travis_time. Matching pairs of these allow Travis CI to collapse the output in between. This greatly cut down the unnecessary "successful" output one need to scroll through before finding the failed statement.
2017-05-30rustbuild: Fix copying duplicate crates into the sysrootAlex Crichton-84/+171
After compiling a project (e.g. libstd, libtest, or librustc) rustbuild needs to copy over all artifacts into the sysroot of the compiler it's assembling. Unfortunately rustbuild doesn't know precisely what files to copy! Today it has a heuristic where it just looks at the most recent version of all files that look like rlibs/dylibs and copies those over. This unfortunately leads to bugs with different versions of the same craet as seen in #42261. This commit updates rustbuild's strategy of copying artifacts to work off the list of artifacts produced by `cargo build --message-format=json`. The build system will now parse json messages coming out of Cargo to watch for files being generated, and then it'll only copy over those precise files. Note that there's still a bit of weird logic where Cargo prints that it's creating `libstd.rlib` where we actually want `libstd-xxxxx.rlib`, so we still do a bit of "most recent file" probing for those. This commit should take care of the crates.io dependency issues, however, as they're all copied over precisely. Closes #42261
2017-04-29Update stage0 bootstrap compilerAlex Crichton-4/+1
We've got a freshly minted beta compiler, let's update to use that on nightly! This has a few other changes associated with it as well * A bump to the rustc version number (to 1.19.0) * Movement of the `cargo` and `rls` submodules to their "proper" location in `src/tools/{cargo,rls}`. Now that Cargo workspaces support the `exclude` option this can work. * Updates of the `cargo` and `rls` submodules to their master branches. * Tweak to the `src/stage0.txt` format to be more amenable for Cargo version numbers. On the beta channel Cargo will bootstrap from a different version than rustc (e.g. the version numbers are different), so we need different configuration for this. * Addition of `dev` as a readable key in the `src/stage0.txt` format. If present then stage0 compilers are downloaded from `dev-static.rust-lang.org` instead of `static.rust-lang.org`. This is added to accomodate our updated release process with Travis and AppVeyor.
2017-04-25Support AddressSanitizer and ThreadSanitizer on x86_64-apple-darwin.kennytm-0/+19
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-21Update #[no_core] users with the "freeze" lang item.Eduard-Mihai Burtescu-0/+1
2017-04-13rustbuild: Fix recompilation of stage0 tools dirAlex Crichton-9/+24
This commit knocks out a longstanding FIXME in rustbuild which should correctly recompile stage0 compiletest and such whenever libstd itself changes. The solution implemented here was to implement a notion of "order only" dependencies and then add a new dependency stage for clearing out the tools dir, using order-only deps to ensure that it happens correctly. The dependency drawing for tools is a bit wonky now but I think this'll get the job done. Closes #39396
2017-03-18Auto merge of #40482 - wagenet:fix-old-macos, r=alexcrichtonbors-0/+9
Target builds for older macOS Fix #40481
2017-03-14Target builds for older macOSPeter Wagenet-0/+9
2017-03-12Update usages of 'OSX' (and other old names) to 'macOS'.Corey Farwell-1/+1
As of last year with version 'Sierra', the Mac operating system is now called 'macOS'.
2017-03-10Don't put Cargo into the rustc workspaceAlex Crichton-1/+4
This causes problems when first cloning and bootstrapping the repository unfortunately, so let's ensure that Cargo sticks around in its own workspace. Because Cargo is a submodule it's not available by default on the inital clone of the rust-lang/rust repository. Normally it's the responsibility of the rustbuild to take care of this, but unfortunately to build rustbuild itself we need to resolve the workspace conflicts. To deal with this we'll just have to ensure that all submodules are in their own workspace, which sort of makes sense anyway as updates to dependencies as bugfixes to Cargo should go to rust-lang/cargo instead of rust-lang/rust. In any case this commit removes Cargo from the global workspace which should resolve the issues that we've been seeing. To actually perform this the `cargo` submodule has been moved to the top directory to ensure it's outside the scope of `src/Cargo.toml` as a workspace.
2017-03-03rustbuild: Add support for compiling CargoAlex Crichton-7/+27
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-24Auto merge of #39892 - petrochenkov:rt, r=alexcrichtonbors-13/+21
Fix test caching on Windows/GNU Addresses https://github.com/rust-lang/rust/issues/36385#issuecomment-277131231 Previously the sysroot directory was purged on every build and mingw startup objects were rebuilt unconditionally and always triggered test reruns. Now mingw startup objects are built in the native directory and then copied into the sysroot directory. They are also rebuilt only when necessary, so test caching works.