summary refs log tree commit diff
path: root/src/bootstrap
AgeCommit message (Collapse)AuthorLines
2018-03-13Auto merge of #48930 - Keruspe:beta, r=kennytmbors-3/+10
[beta] rustbuild: pass datadir to rust-installer Backport from #48295
2018-03-11bootstrap: pass datadir to rust-installerMarc-Antoine Perennou-3/+10
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2018-03-06rustbuild: make libdir_relative a methodJosh Stone-23/+17
2018-03-06rustbuild: Restore Config.libdir_relativeJosh Stone-3/+20
This re-introduces a `Config.libdir_relative` field, now derived from `libdir` and made relative to `prefix` if necessary. This fixes a regression from #46592 when `--libdir` is given an absolute path. `Builder::sysroot_libdir` should always use a relative path so its callers don't clobber system locations, and `librustc` also asserts that `CFG_LIBDIR_RELATIVE` is really relative.
2018-02-18Fix panic when `x.py` is called without any arguments.kennytm-2/+4
2018-02-18Consider paths passed to x.py to be root-relative.Mark Simulacrum-6/+6
We'd previously assumed that these paths would be relative to the src dir, and that for example our various CI scripts would, when calling x.py, use `../x.py build ../src/tools/...` but this isn't the case -- they use `../x.py` without using the relevant source-relative path. We eventually may want to make this (actually somewhat logical) change, but this is not that time.
2018-02-18Prevent silently ignoring unmatched pathsMark Simulacrum-1/+1
Primarily for CI purposes; this is intended to avoid cases where we update rustbuild and unintentionally make CI stop running some builds to the arguments being passed no longer applying for some reason.
2018-02-15Auto merge of #48105 - Mark-Simulacrum:exclude-paths, r=alexcrichtonbors-327/+444
Implement excluding a build-step via --exclude First step to fixing https://github.com/rust-lang/rust/issues/47911. This doesn't change any CI configuration, but implements what I believe necessary to make that feasible in rustbuild. In theory this should be sufficient to allow someone to open a PR against .travis.yml and appveyor.yml which splits the Windows 32-bit tests and maybe the OS X tests into multiple builders (depending on what our cost-concerns are) to reduce runtimes. r? @alexcrichton cc @kennytm
2018-02-15Revert "rustbuild: Pass `ccache` to build scripts"Alex Crichton-22/+5
This reverts commit 64a8730e171367e4979cd9c25f0e0fdc2c157446.
2018-02-13Fix default Steps without paths.Mark Simulacrum-5/+10
Some Steps are by-default run but don't have any paths associated with them. We need to have at least one PathSet per each Step, though, so we add an empty one on calls to `never()`.
2018-02-11Change Step to be invoked with a path when in default mode.Mark Simulacrum-312/+415
Previously, a Step would be able to tell on its own when it was invoked "by-default" (that is, `./x.py test` was called instead of `./x.py test some/path`). This commit replaces that functionality, invoking each Step with each of the paths it has specified as "should be invoked by." For example, if a step calls `path("src/tools/cargo")` and `path("src/doc/cargo")` then it's make_run will be called twice, with "src/tools/cargo" and "src/doc/cargo." This makes it so that default handling logic is in builder, instead of spread across various Steps. However, this meant that some Step specifications needed to be updated, since for example `rustdoc` can be built by `./x.py build src/librustdoc` or `./x.py build src/tools/rustdoc`. A `PathSet` abstraction is added that handles this: now, each Step can not only list `path(...)` but also `paths(&[a, b, ...])` which will make it so that we don't invoke it with each of the individual paths, instead invoking it with the first path in the list (though this shouldn't be depended on). Future work likely consists of implementing a better/easier way for a given Step to work with "any" crate in-tree, especially those that want to run tests, build, or check crates in the std, test, or rustc crate trees. Currently this is rather painful to do as most of the logic is duplicated across should_run and make_run. It seems likely this can be abstracted away into builder somehow.
2018-02-10Remove DontDistWithMiri struct and instead just directly check it in builderMark Simulacrum-27/+7
2018-02-10Make exclude and paths relative to root of checkoutMark Simulacrum-7/+10
2018-02-10Implement excluding a build-step via --excludeMark Simulacrum-7/+33
2018-02-11Rollup merge of #48120 - matthiaskrgr:typos_src_1, r=alexcrichtonkennytm-3/+3
fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}} via codespell
2018-02-10fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}}Matthias Krüger-3/+3
2018-02-10Rollup merge of #48098 - alexcrichton:fix-i686-dist-bootstrap, r=Mark-Simulacrumkennytm-0/+7
ci: Actually bootstrap on i686 dist Right now the `--build` option was accidentally omitted, so we're bootstraping from `x86_64` to `i686`. In addition to being slower (more compiles) that's not actually bootstrapping!
2018-02-10Rollup merge of #48059 - alexcrichton:sccachebs, r=Mark-Simulacrumkennytm-5/+22
rustbuild: Pass `ccache` to build scripts Right now the ccache setting is only used for LLVM, but this tweaks it to also be used for build scripts so C++ builds like `librustc_llvm` can be a bit speedier.
2018-02-10Rollup merge of #48015 - o01eg:disableable-installation, r=alexcrichtonkennytm-8/+28
Customizable extended tools This PR adds `build.tools` option to manage installation of extended rust tools. By default it doesn't change installation. All tools are built and `rls` and `rustfmt` allowed to fail installation. If some set of tools chosen only those tools are built and installed without any fails allowed. It solves some slotting issues with extended build enabled: https://bugs.gentoo.org/show_bug.cgi?id=645498
2018-02-09rustc: Upgrade to LLVM 6Alex Crichton-1/+1
The following submodules have been updated for a new version of LLVM: - `src/llvm` - `src/libcompiler_builtins` - transitively contains compiler-rt - `src/dlmalloc` This also updates the docker container for dist-i686-freebsd as the old 16.04 container is no longer capable of building LLVM. The compiler-rt/compiler-builtins and dlmalloc updates are pretty routine without much interesting happening, but the LLVM update here is of particular note. Unlike previous updates I haven't cherry-picked all existing patches we had on top of our LLVM branch as we have a [huge amount][patches4] and have at this point forgotten what most of them are for. Instead I started from the current `release_60` branch in LLVM and only applied patches that were necessary to get our tests working and building. The current set of custom rustc-specific patches included in this LLVM update are: * rust-lang/llvm@1187443 - this is how we actually implement `cfg(target_feature)` for now and continues to not be upstreamed. While a hazard for SIMD stabilization this commit is otherwise keeping the status quo of a small rustc-specific feature. * rust-lang/llvm@013f2ec - this is a rustc-specific optimization that we haven't upstreamed, notably teaching LLVM about our allocation-related routines (which aren't malloc/free). Once we stabilize the global allocator routines we will likely want to upstream this patch, but for now it seems reasonable to keep it on our fork. * rust-lang/llvm@a65bbfd - I found this necessary to fix compilation of LLVM in our 32-bit linux container. I'm not really sure why it's necessary but my guess is that it's because of the absolutely ancient glibc that we're using. In any case it's only updating pieces we're not actually using in LLVM so I'm hoping it'll turn out alright. This doesn't seem like something we'll want to upstream.c * rust-lang/llvm@77ab1f0 - this is what's actually enabling LLVM to build in our i686-freebsd container, I'm not really sure what's going on but we for sure probably don't want to upstream this and otherwise it seems not too bad for now at least. * rust-lang/llvm@9eb9267 - we currently suffer on MSVC from an [upstream bug] which although diagnosed to a particular revision isn't currently fixed upstream (and the bug itself doesn't seem too active). This commit is a partial revert of the suspected cause of this regression (found via a bisection). I'm sort of hoping that this eventually gets fixed upstream with a similar fix (which we can replace in our branch), but for now I'm also hoping it's a relatively harmless change to have. After applying these patches (plus one [backport] which should be [backported upstream][llvm-back]) I believe we should have all tests working on all platforms in our current test suite. I'm like 99% sure that we'll need some more backports as issues are reported for LLVM 6 when this propagates through nightlies, but that's sort of just par for the course nowadays! In any case though some extra scrutiny of the patches here would definitely be welcome, along with scrutiny of the "missing patches" like a [change to pass manager order](rust-lang/llvm@27174447533), [another change to pass manager order](rust-lang/llvm@c782febb7b9), some [compile fixes for sparc](rust-lang/llvm@1a83de63c42), and some [fixes for solaris](rust-lang/llvm@c2bfe0abb). [patches4]: https://github.com/rust-lang/llvm/compare/5401fdf23...rust-llvm-release-4-0-1 [backport]: https://github.com/rust-lang/llvm/commit/5c54c252db [llvm-back]: https://bugs.llvm.org/show_bug.cgi?id=36114 [upstream bug]: https://bugs.llvm.org/show_bug.cgi?id=36096 --- The update to LLVM 6 is desirable for a number of reasons, notably: * This'll allow us to keep up with the upstream wasm backend, picking up new features as they start landing. * Upstream LLVM has fixed a number of SIMD-related compilation errors, especially around AVX-512 and such. * There's a few assorted known bugs which are fixed in LLVM 5 and aren't fixed in the LLVM 4 branch we're using. * Overall it's not a great idea to stagnate with our codegen backend! This update is mostly powered by #47730 which is allowing us to update LLVM *independent* of the version of LLVM that Emscripten is locked to. This means that when compiling code for Emscripten we'll still be using the old LLVM 4 backend, but when compiling code for any other target we'll be using the new LLVM 6 target. Once Emscripten updates we may no longer need this distinction, but we're not sure when that will happen! Closes #43370 Closes #43418 Closes #47015 Closes #47683 Closes rust-lang-nursery/stdsimd#157 Closes rust-lang-nursery/rust-wasm#3
2018-02-09ci: Actually bootstrap on i686 distAlex Crichton-0/+7
Right now the `--build` option was accidentally omitted, so we're bootstraping from `x86_64` to `i686`. In addition to being slower (more compiles) that's not actually bootstrapping!
2018-02-08rustbuild: Pass `ccache` to build scriptsAlex Crichton-5/+22
Right now the ccache setting is only used for LLVM, but this tweaks it to also be used for build scripts so C++ builds like `librustc_llvm` can be a bit speedier.
2018-02-08Convert python script to rustGuillaume Gomez-11/+9
2018-02-08Pass themes folder as parameterGuillaume Gomez-1/+3
2018-02-08Add tests for themesGuillaume Gomez-2/+43
2018-02-07Refactor checks on list of extended tools.O01eg-12/+21
2018-02-05Add build.tools option to manage installation of extended rust tools.O01eg-8/+19
2018-02-05Use time crate in bootstrap dist instead of dateOnur Aslan-3/+5
2018-02-04Auto merge of #47998 - kennytm:rollup, r=kennytmbors-1/+1
Rollup of 10 pull requests - Successful merges: #47862, #47877, #47896, #47912, #47947, #47958, #47978, #47996, #47999, #47892 - Failed merges:
2018-02-04Run the `run-make` tests last, so more tests run on Windows when `make` is ↵John Kåre Alsaker-1/+1
unavailable
2018-02-03Disable ThinLTO for dist builds.Mark Simulacrum-6/+21
Dist builds should always be as fast as we can make them, and since those run on CI we don't care quite as much for the build being somewhat slower. As such, we don't automatically enable ThinLTO on builds for the dist builders.
2018-02-02Auto merge of #47102 - Diggsey:wasm-syscall, r=alexcrichtonbors-0/+14
Implement extensible syscall interface for wasm Currently it's possible to run tests with the native wasm target, but it's not possible to tell whether they pass or to capture the output, because libstd throws away stdout, stderr and the exit code. While advanced libstd features should probably require more specific targets (eg. wasm-unknown-web) I think even the unknown target should at least support basic I/O. Any solution is constrained by these factors: - It must not be javascript specific - There must not be too strong coupling between libstd and the host environment (because it's an "unknown" target) - WebAssembly does not allow "optional" imports - all imports *must* be resolved. - WebAssembly does not support calling the host environment through any channel *other* than imports. The best solution I could find to these constraints was to give libstd a single required import, and implement a syscall-style interface through that import. Each syscall is designed such that a no-op implementation gives the most reasonable fallback behaviour. This means that the following import table would be perfectly valid: ```javascript imports.env = { rust_wasm_syscall: function(index, data) {} } ``` Currently I have implemented these system calls: - Read from stdin - Write to stdout/stderr - Set the exit code - Get command line arguments - Get environment variable - Set environment variable - Get time It need not be extended beyond this set if being able to run tests for this target is the only goal. edit: As part of this PR I had to make a further change. Previously, the rust entry point would be automatically called when the webassembly module was instantiated. This was problematic because from the javascript side it was impossible to call exported functions, access program memory or get a reference to the instance. To solve this, ~I changed the default behaviour to not automatically call the entry point, and added a crate-level attribute to regain the old behaviour. (`#![wasm_auto_run]`)~ I disabled this behaviour when building tests.
2018-01-31rustc: Move location of `codegen-backends` dirAlex Crichton-7/+9
Right now this directory is located under: $sysroot/lib/rustlib/$target/lib/codegen-backends but after seeing what we do in a few other places it seems that a more appropriate location would be: $sysroot/lib/rustlib/$target/codegen-backends so this commit moves it!
2018-01-30Add wasm_syscall feature to build systemDiggory Blake-0/+14
2018-01-30Rollup merge of #47836 - Mark-Simulacrum:stage-flags, r=alexcrichtonkennytm-0/+12
Add per-stage RUSTFLAGS: RUSTFLAGS_STAGE_{0,1,2} and RUSTFLAGS_STAGE_NOT_0 Fixes #47658. r? @alexcrichton
2018-01-29Add per-stage RUSTFLAGS: RUSTFLAGS_STAGE_{0,1,2} and RUSTFLAGS_STAGE_NOT_0Mark Simulacrum-0/+12
Fixes #47658.
2018-01-28rustc: Split Emscripten to a separate codegen backendAlex Crichton-101/+207
This commit introduces a separately compiled backend for Emscripten, avoiding compiling the `JSBackend` target in the main LLVM codegen backend. This builds on the foundation provided by #47671 to create a new codegen backend dedicated solely to Emscripten, removing the `JSBackend` of the main codegen backend in the process. A new field was added to each target for this commit which specifies the backend to use for translation, the default being `llvm` which is the main backend that we use. The Emscripten targets specify an `emscripten` backend instead of the main `llvm` one. There's a whole bunch of consequences of this change, but I'll try to enumerate them here: * A *second* LLVM submodule was added in this commit. The main LLVM submodule will soon start to drift from the Emscripten submodule, but currently they're both at the same revision. * Logic was added to rustbuild to *not* build the Emscripten backend by default. This is gated behind a `--enable-emscripten` flag to the configure script. By default users should neither check out the emscripten submodule nor compile it. * The `init_repo.sh` script was updated to fetch the Emscripten submodule from GitHub the same way we do the main LLVM submodule (a tarball fetch). * The Emscripten backend, turned off by default, is still turned on for a number of targets on CI. We'll only be shipping an Emscripten backend with Tier 1 platforms, though. All cross-compiled platforms will not be receiving an Emscripten backend yet. This commit means that when you download the `rustc` package in Rustup for Tier 1 platforms you'll be receiving two trans backends, one for Emscripten and one that's the general LLVM backend. If you never compile for Emscripten you'll never use the Emscripten backend, so we may update this one day to only download the Emscripten backend when you add the Emscripten target. For now though it's just an extra 10MB gzip'd. Closes #46819
2018-01-28Auto merge of #47663 - malbarbo:mips-crt-static, r=alexcrichtonbors-3/+7
Do not assume dynamic linking for musl/mips[el] targets All musl targets except mips[el] assume static linking by default. This can be [confusing](https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084). When the musl/mips[el] targets was [added](https://github.com/rust-lang/rust/pull/31298), dynamic linking was chosen because of binary size concerns, and probably also because libunwind [didn't](https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084/8) supported mips. Now that we have `crt-static` target-feature (the user can choose dynamic link for musl targets), and libunwind [6.0](https://github.com/llvm-mirror/libunwind/commits/release_60) add support to mips, we do not need to assume dynamic linking.
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-62/+201
Building on the work of # 45684 this commit updates the compiler to unconditionally load the `rustc_trans` crate at runtime instead of linking to it at compile time. The end goal of this work is to implement # 46819 where rustc will have multiple backends available to it to load. This commit starts off by removing the `extern crate rustc_trans` from the driver. This involved moving some miscellaneous functionality into the `TransCrate` trait and also required an implementation of how to locate and load the trans backend. This ended up being a little tricky because the sysroot isn't always the right location (for example `--sysroot` arguments) so some extra code was added as well to probe a directory relative to the current dll (the rustc_driver dll). Rustbuild has been updated accordingly as well to have a separate compilation invocation for the `rustc_trans` crate and assembly it accordingly into the sysroot. Finally, the distribution logic for the `rustc` package was also updated to slurp up the trans backends folder. A number of assorted fallout changes were included here as well to ensure tests pass and such, and they should all be commented inline.
2018-01-26Merge branch 'beta-prerelease' of https://github.com/cuviper/rust into rollupAlex Crichton-1/+5
2018-01-25Call non-git beta builds simply x.y.z-betaJosh Stone-1/+5
We can't use git commands to compute a prerelease version when we're building from a source tarball, or if git is otherwise unavailable. We'll just call such builds `x.y.z-beta`, without a prerelease.
2018-01-23Add ./x.py check src/{libstd,libtest,rustc}.Mark Simulacrum-27/+211
This currently only supports a limited subset of the full compilation, but is likely 90% of what people will want and is possible without building a full compiler (i.e., running LLVM). In theory, this means that contributors who don't want to build LLVM now have an easy way to compile locally, though running tests won't work.
2018-01-23Rename check.rs to test.rsMark Simulacrum-0/+0
2018-01-23Rollup merge of #47558 - spastorino:rustc_args, r=nikomatsakiskennytm-0/+18
Add rustc-args option to test runner r? @nikomatsakis
2018-01-22Do not assume dynamic linking for musl/mips[el] targetsMarco A L Barbosa-3/+7
All musl targets except mips[el] assume static linking by default. This can be confusing https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084 When the musl/mips[el] targets was [added](https://github.com/rust-lang/rust/pull/31298), dynamic linking was chosen because of binary size concerns, and probably also because libunwind [didn't](https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084/8) supported mips. Now that we have `crt-static` target-feature (the user can choose dynamic link for musl targets), and libunwind [6.0](https://github.com/llvm-mirror/libunwind/commits/release_60) add support to mips, we do not need to assume dynamic linking.
2018-01-21Rollup merge of #47582 - alexcrichton:auto-beta, r=kennytmGuillaume Gomez-8/+51
Automaticaly calculate beta prerelease numbers This is a forward-port of: * 9426dda83d7a928d6ced377345e14b84b0f11c21 * cbfb9858951da7aee22d82178405306fca9decb1 from the beta branch which is used to automatically calculate the beta number based on the number of merges to the beta branch so far.
2018-01-19Automaticaly calculate beta prerelease numbersAlex Crichton-8/+51
This is a forward-port of: * 9426dda83d7a928d6ced377345e14b84b0f11c21 * cbfb9858951da7aee22d82178405306fca9decb1 from the beta branch which is used to automatically calculate the beta number based on the number of merges to the beta branch so far.
2018-01-19Auto merge of #47494 - michaelwoerister:proc-macro-incremental, r=nikomatsakisbors-0/+5
Don't include DefIndex in proc-macro registrar function symbol. There can only ever be one registrar function per plugin or proc-macro crate, so adding the `DefIndex` to the function's symbol name does not serve a real purpose. Remove the `DefIndex` from the symbol name makes it stable across incremental compilation sessions. This should fix issue #47292.
2018-01-19Add rustc-args option to test runnerSantiago Pastorino-0/+18
2018-01-18Auto merge of #47528 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-4/+44
Rollup of 6 pull requests - Successful merges: #47250, #47313, #47398, #47468, #47471, #47520 - Failed merges: