Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Rustdoc versioning checks #8640

Merged
merged 25 commits into from
Feb 13, 2021
Merged

Commits on Aug 22, 2020

  1. Implement RustDocTargetData

    This intends to be a helper structure similar to
    `RustTargetData` which includes helper functions
    which are useful for interacting with the rustdoc
    fingerprint files among other things.
    CPerezz committed Aug 22, 2020
    Configuration menu
    Copy the full SHA
    5035321 View commit details
    Browse the repository at this point in the history
  2. Impl remove_doc_directory function

    Sometimes we need to remove the `doc/` directory
    (if exists) in order to not mix different versions
    of the js/html/css files that Rustc autogenerates and
    lack versioning.
    CPerezz committed Aug 22, 2020
    Configuration menu
    Copy the full SHA
    c70c2cc View commit details
    Browse the repository at this point in the history
  3. Implement Rustdoc versioning checks

    Before compiling, we need to make sure that if there
    were any previous docs already compiled, they were
    compiled with the same Rustc version that we're
    currently using. Otherways we must remove the
    `doc/` folder and compile again.
    
    This is important because as stated in rust-lang#8461
    the .js/.html&.css files that are generated
    by Rustc don't have any versioning.
    Therefore, we can fall in weird bugs and behaviours
    if we mix different compiler versions of these
    js/.html&.css files.
    CPerezz committed Aug 22, 2020
    Configuration menu
    Copy the full SHA
    51d3050 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2020

  1. Fail when dealing with io fails

    Is the user does not have permissions or a folder/file
    can't be created or deleted, Cargo will fail and return
    an Error indicating the problem.
    CPerezz committed Sep 20, 2020
    Configuration menu
    Copy the full SHA
    e38c3ac View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7a5f784 View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2020

  1. Remove previous solution

    CPerezz committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    87c1f6c View commit details
    Browse the repository at this point in the history
  2. Implement rustdoc versioning

    After refactoring what was done on the latest approach
    this time we included the rustdoc versioning logic inside
    the `compiler::rustdoc` fn.
    
    - Created `RustDocFingerprint` struct so that is easier to
    manage all of the logic & functions related to rustdoc
    versioning as well as scaling it in the future if needed.
    CPerezz committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    65f17e1 View commit details
    Browse the repository at this point in the history
  3. Add tests for rustdoc fingerprint impl

    - Check wether the fingerprint is created with the
    correct data after a `rustdoc` execution.
    - Check wether the previous docs are removed if the version
    used to compile them reported in the fingerprint is different
    from the actual one being used by the compiler.
    CPerezz committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    2fea14e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    31ef7af View commit details
    Browse the repository at this point in the history
  5. Apply rustfmt

    CPerezz committed Dec 16, 2020
    Configuration menu
    Copy the full SHA
    ebd0d58 View commit details
    Browse the repository at this point in the history

Commits on Dec 17, 2020

  1. Address @ehuss suggestions/nits

    CPerezz committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    994ccec View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2021

  1. Move rustdoc fingerprint checks earlier

    As @ehuss suggested, we should only execute once
    the rustdoc fingerprint check per build, not once
    per dep.
    
    Therefore the checks have been moved to an earlier stage.
    CPerezz committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    33a5248 View commit details
    Browse the repository at this point in the history
  2. Create dirs if needed before f_p write call

    Once `RustDocFingerprint::check_rustdoc_fingerprint()` is
    executed it might happen that the `doc/` dir is removed.
    
    This means that when we call `fingerprint.write()` we need
    to create the `doc` directory again.
    CPerezz committed Jan 25, 2021
    Configuration menu
    Copy the full SHA
    94519f2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    27987b6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    47e19f0 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2021

  1. Configuration menu
    Copy the full SHA
    8ddc56f View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2021

  1. Address latest reivew suggestions

    - Instead of `fs` we use the `utils::paths` functions
    to interact with the filesystem.
    - The doc fingerprint is now stored under `target/` instead
    of `target/doc/`.
    - The code in `compile` has been reduced to a single function call.
    CPerezz committed Jan 27, 2021
    Configuration menu
    Copy the full SHA
    d2572a2 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2021

  1. Check target-dependant doc folders

    When checking the fingerprint for rustdoc and applying
    the corresponding logic, we don't only need to consider
    the `target/doc` folder (Host target) but also triple targets.
    
    So now the actual compilation targets are checked during the
    rustdoc_fingerprint processing and they're treated as the Host/doc
    folder.
    CPerezz committed Jan 31, 2021
    Configuration menu
    Copy the full SHA
    7c45021 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2021

  1. Configuration menu
    Copy the full SHA
    cb21e64 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2021

  1. Configuration menu
    Copy the full SHA
    3c93f6c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1af0027 View commit details
    Browse the repository at this point in the history
  3. Fix spelling

    CPerezz committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    7bfb3d0 View commit details
    Browse the repository at this point in the history
  4. Refactor doc_dirs obtention

    We should try to avoid dealing with paths ourseleves. Now the
    access/parsing and construction is handled via `Layout`.
    CPerezz committed Feb 3, 2021
    Configuration menu
    Copy the full SHA
    e78f91c View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2021

  1. Improve RustDocFingerprint::remove_doc_dirs

    We were not filtering the cases where the doc folder
    paths did not exist.
    Also, we were overrwriting the error when it doesn't
    make sense. We now return the first one by folding the
    results of the doc_dirs removal resolutions.
    CPerezz committed Feb 4, 2021
    Configuration menu
    Copy the full SHA
    4afa585 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2021

  1. Update src/cargo/core/compiler/build_context/target_info.rs

    Co-authored-by: Eric Huss <eric@huss.org>
    CPerezz and ehuss committed Feb 13, 2021
    Configuration menu
    Copy the full SHA
    61c2332 View commit details
    Browse the repository at this point in the history