1. 10 4月, 2018 1 次提交
  2. 04 4月, 2018 4 次提交
    • M
      Fix a few accidental expectations · 0ce5cf06
      Mark Simulacrum 提交于
      0ce5cf06
    • M
      Avoid printing output when in dry run mode · 545b92f4
      Mark Simulacrum 提交于
      545b92f4
    • M
      Refactor to use a dry-run config instead of cfg(test) · a727447f
      Mark Simulacrum 提交于
      This ensures that each build will support the testing design of "dry
      running" builds. It's also checked that a dry run build is equivalent
      step-wise to a "wet" run build; the graphs we generate when running are
      directly compared node/node and edge/edge, both for order and contents.
      a727447f
    • M
      Add tests to rustbuild · 42fde21c
      Mark Simulacrum 提交于
      In order to run tests, previous commits have cfg'd out various parts of
      rustbuild. Generally speaking, these are filesystem-related operations
      and process-spawning related parts. Then, rustbuild is run "as normal"
      and the various steps that where run are retrieved from the cache and
      checked against the expected results.
      
      Note that this means that the current implementation primarily tests
      "what" we build, but doesn't actually test that what we build *will*
      build. In other words, it doesn't do any form of dependency verification
      for any crate. This is possible to implement, but is considered future
      work.
      
      This implementation strives to cfg out as little code as possible; it
      also does not currently test anywhere near all of rustbuild. The current
      tests are also not checked for "correctness," rather, they simply
      represent what we do as of this commit, which may be wrong.
      
      Test cases are drawn from the old implementation of rustbuild, though
      the expected results may vary.
      42fde21c
  3. 24 3月, 2018 1 次提交
  4. 23 3月, 2018 1 次提交
    • A
      rustc: Add a `#[wasm_custom_section]` attribute · 7df6f416
      Alex Crichton 提交于
      This commit is an implementation of adding custom sections to wasm artifacts in
      rustc. The intention here is to expose the ability of the wasm binary format to
      contain custom sections with arbitrary user-defined data. Currently neither our
      version of LLVM nor LLD supports this so the implementation is currently custom
      to rustc itself.
      
      The implementation here is to attach a `#[wasm_custom_section = "foo"]`
      attribute to any `const` which has a type like `[u8; N]`. Other types of
      constants aren't supported yet but may be added one day! This should hopefully
      be enough to get off the ground with *some* custom section support.
      
      The current semantics are that any constant tagged with `#[wasm_custom_section]`
      section will be *appended* to the corresponding section in the final output wasm
      artifact (and this affects dependencies linked in as well, not just the final
      crate). This means that whatever is interpreting the contents must be able to
      interpret binary-concatenated sections (or each constant needs to be in its own
      custom section).
      
      To test this change the existing `run-make` test suite was moved to a
      `run-make-fulldeps` folder and a new `run-make` test suite was added which
      applies to all targets by default. This test suite currently only has one test
      which only runs for the wasm target (using a node.js script to use `WebAssembly`
      in JS to parse the wasm output).
      7df6f416
  5. 18 3月, 2018 1 次提交
    • A
      rustbuild: Tweak where timing information goes · 6fd4d678
      Alex Crichton 提交于
      This commit tweaks where timing and step information is printed out as part of
      the build, ensuring that we do it as close to the location where work happens as
      possible. In rustbuild various functions may perform long blocking work as
      dependencies are assembled, so if we print out timing information early on we
      may accidentally time more than just the step we were intending to time!
      6fd4d678
  6. 17 3月, 2018 1 次提交
  7. 09 3月, 2018 2 次提交
    • A
      rustbuild: Fix MSBuild location of `llvm-config.exe` · be902e71
      Alex Crichton 提交于
      For LLD integration the path to `llvm-config` needed to change to inside the
      build directory itself (for whatever reason) but the build directory is
      different on MSBuild than it is on `ninja` for MSVC builds, so the path to
      `llvm-config.exe` was actually wrong and not working!
      
      This commit removes the `Build::llvm_config` function in favor of the source of
      truth, the `Llvm` build step itself. The build step was then updated to find the
      right build directory for MSBuild as well as `ninja` for where `llvm-config.exe`
      is located.
      
      Closes #48749
      be902e71
    • M
      Remove ONLY_BUILD. · 1c8f3b01
      Mark Simulacrum 提交于
      All uses are replaced with not accessing run.target/run.host, and
      instead directly using run.builder.build.build.
      1c8f3b01
  8. 06 3月, 2018 1 次提交
  9. 04 3月, 2018 1 次提交
    • A
      rust: Import LLD for linking wasm objects · d69b2480
      Alex Crichton 提交于
      This commit imports the LLD project from LLVM to serve as the default linker for
      the `wasm32-unknown-unknown` target. The `binaryen` submoule is consequently
      removed along with "binaryen linker" support in rustc.
      
      Moving to LLD brings with it a number of benefits for wasm code:
      
      * LLD is itself an actual linker, so there's no need to compile all wasm code
        with LTO any more. As a result builds should be *much* speedier as LTO is no
        longer forcibly enabled for all builds of the wasm target.
      * LLD is quickly becoming an "official solution" for linking wasm code together.
        This, I believe at least, is intended to be the main supported linker for
        native code and wasm moving forward. Picking up support early on should help
        ensure that we can help LLD identify bugs and otherwise prove that it works
        great for all our use cases!
      * Improvements to the wasm toolchain are currently primarily focused around LLVM
        and LLD (from what I can tell at least), so it's in general much better to be
        on this bandwagon for bugfixes and new features.
      * Historical "hacks" like `wasm-gc` will soon no longer be necessary, LLD
        will [natively implement][gc] `--gc-sections` (better than `wasm-gc`!) which
        means a postprocessor is no longer needed to show off Rust's "small wasm
        binary size".
      
      LLD is added in a pretty standard way to rustc right now. A new rustbuild target
      was defined for building LLD, and this is executed when a compiler's sysroot is
      being assembled. LLD is compiled against the LLVM that we've got in tree, which
      means we're currently on the `release_60` branch, but this may get upgraded in
      the near future!
      
      LLD is placed into rustc's sysroot in a `bin` directory. This is similar to
      where `gcc.exe` can be found on Windows. This directory is automatically added
      to `PATH` whenever rustc executes the linker, allowing us to define a `WasmLd`
      linker which implements the interface that `wasm-ld`, LLD's frontend, expects.
      
      Like Emscripten the LLD target is currently only enabled for Tier 1 platforms,
      notably OSX/Windows/Linux, and will need to be installed manually for compiling
      to wasm on other platforms. LLD is by default turned off in rustbuild, and
      requires a `config.toml` option to be enabled to turn it on.
      
      Finally the unstable `#![wasm_import_memory]` attribute was also removed as LLD
      has a native option for controlling this.
      
      [gc]: https://reviews.llvm.org/D42511
      d69b2480
  10. 24 2月, 2018 1 次提交
  11. 23 2月, 2018 1 次提交
  12. 18 2月, 2018 1 次提交
  13. 17 2月, 2018 1 次提交
  14. 12 2月, 2018 1 次提交
    • M
      Change Step to be invoked with a path when in default mode. · f104b120
      Mark Simulacrum 提交于
      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.
      f104b120
  15. 10 2月, 2018 1 次提交
  16. 08 2月, 2018 3 次提交
  17. 04 2月, 2018 1 次提交
  18. 31 1月, 2018 1 次提交
  19. 28 1月, 2018 1 次提交
    • A
      rustc: Load the `rustc_trans` crate at runtime · 884715c6
      Alex Crichton 提交于
      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.
      884715c6
  20. 24 1月, 2018 1 次提交
  21. 19 1月, 2018 1 次提交
  22. 17 1月, 2018 1 次提交
  23. 14 1月, 2018 1 次提交
  24. 13 1月, 2018 3 次提交
  25. 12 1月, 2018 1 次提交
  26. 04 1月, 2018 1 次提交
  27. 27 12月, 2017 2 次提交
  28. 12 12月, 2017 1 次提交
  29. 06 12月, 2017 1 次提交
  30. 03 12月, 2017 1 次提交
  31. 29 11月, 2017 1 次提交
    • A
      ci: Start running wasm32 tests on Travis · 73970bf6
      Alex Crichton 提交于
      This commit allocates a builder to running wasm32 tests on Travis. Not all test
      suites pass right now so this is starting out with just the run-pass and the
      libcore test suites. This'll hopefully give us a pretty broad set of coverage
      for integration in rustc itself as well as a somewhat broad coverage of the llvm
      backend itself through integration/unit tests.
      73970bf6