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

Custom alloc, using stable Rust compilers, and more #402

Merged
merged 26 commits into from
Jul 2, 2021

Commits on Jun 30, 2021

  1. rust: import alloc

    This brings the `alloc` crate in-tree.
    
    The code comes from Rust 1.54.0-beta.1, i.e. commit `bf62f4de3`.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    405c9a1 View commit details
    Browse the repository at this point in the history
  2. rust: alloc: remove BTreeMap and BTreeSet

    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    33f31ce View commit details
    Browse the repository at this point in the history
  3. rust: alloc: remove BinaryHeap

    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    4b9f221 View commit details
    Browse the repository at this point in the history
  4. rust: alloc: remove VecDeque

    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    37d9455 View commit details
    Browse the repository at this point in the history
  5. rust: alloc: remote LinkedList

    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    771912e View commit details
    Browse the repository at this point in the history
  6. rust: alloc: remove task module

    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jun 30, 2021
    Configuration menu
    Copy the full SHA
    2a4f8f9 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2021

  1. rust: alloc: remove parts of vec

    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    45dde9f View commit details
    Browse the repository at this point in the history
  2. rust: alloc: remove tests.rs files

    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    e7ac457 View commit details
    Browse the repository at this point in the history
  3. rust: alloc: add SPDX License Identifiers

    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    db747ba View commit details
    Browse the repository at this point in the history
  4. rust: macros: hide docs for module! public statics/fns

    So that we do not trigger `missing_docs`.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    085cf66 View commit details
    Browse the repository at this point in the history
  5. rust: kernel: add docs for macro stub

    So that we can enable `-Wmissing_docs` globally.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    26a4431 View commit details
    Browse the repository at this point in the history
  6. rust: kernel: clean beta Clippy needless_borrow warnings

    The warning is now in the `style` group.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    edd7ad5 View commit details
    Browse the repository at this point in the history
  7. rust: macros: clean beta Clippy needless_borrow warnings

    The warning is now in the `style` group.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    e415c34 View commit details
    Browse the repository at this point in the history
  8. rust: compile in bootstrapping mode

    Since we are going to use stable releases [*], we need to enable
    the bootstrapping mode to use the unstable features.
    
    [*] For the moment, it is a beta due to a fix we need for LLVM 12,
    but the same logic applies.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    1f1b619 View commit details
    Browse the repository at this point in the history
  9. rust: compile alloc from the in-tree sources

    Includes:
    
      - Cross-building a new sysroot with our custom `alloc` in order
        to support `alloc` tests.
      - Documentation generation for in-tree `alloc`.
      - Split `RUSTDOC` command in two for clarity, since now we have
        to also handle `sysroot` differently.
      - Proper handling of both silent and verbose mode for tests
        and `cargo`.
      - Deny missing docs globally `alloc`.
      - Allow broken intra docs for `alloc`.
      - Do not format `rust/alloc` nor `rust/test`, including handling
        the case where `srctree` is a prent folder.
      - `make clean` now cleans `rust/doc` and `rust/test`.
      - Move allocs out of the second expansion section since it is
        in-tree now.
      - Other small cleanups.
    
    I want to clean this up further and factor a few things,
    but let's move ahead.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    38a10b4 View commit details
    Browse the repository at this point in the history
  10. rust: alloc: disable several new()s, pin()s, default()s, etc.

    They are infallible, and could not be actually used because
    they will trigger an error when monomorphized, but it is better
    to just remove them.
    
    Suggested-by: Gary Guo <[email protected]>
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    b4a8689 View commit details
    Browse the repository at this point in the history
  11. rust: alloc: fix unused import from_fn warning

    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    af999c4 View commit details
    Browse the repository at this point in the history
  12. rust: alloc: add some try_* methods we need

    In preparation for enabling `no_global_oom_handling` for `alloc`,
    we need to add some new methods.
    
    They are all marked as:
    
        #[stable(feature = "kernel", since = "1.0.0")]
    
    for easy identification.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    3 Configuration menu
    Copy the full SHA
    487d757 View commit details
    Browse the repository at this point in the history
  13. rust: kernel: use the new try_* methods

    In preparation for enabling `no_global_oom_handling` for `alloc`,
    we need to stop using methods that will disappear when enabling
    the configuration option. Instead, we use the new methods
    we just added.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 1, 2021
    Configuration menu
    Copy the full SHA
    3fd100b View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2021

  1. android: binder: use the new try_* methods

    In preparation for enabling `no_global_oom_handling` for `alloc`,
    we need to stop using methods that will disappear when enabling
    the configuration option. Instead, we use the new methods
    we just added.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 2, 2021
    Configuration menu
    Copy the full SHA
    90f1659 View commit details
    Browse the repository at this point in the history
  2. rust: alloc: enable no_global_oom_handling

    Now both `alloc` and users are prepared to be compiled with
    `no_global_oom_handling`.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 2, 2021
    Configuration menu
    Copy the full SHA
    622b593 View commit details
    Browse the repository at this point in the history
  3. rustfmt: do not use unstable features

    Sadly, `rustfmt` does not respect `RUSTC_BOOTSTRAP=1` yet,
    so we will have to avoid them for the moment.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 2, 2021
    Configuration menu
    Copy the full SHA
    023ccfc View commit details
    Browse the repository at this point in the history
  4. scripts: update rust-analyzer for local alloc

    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 2, 2021
    Configuration menu
    Copy the full SHA
    b4d81aa View commit details
    Browse the repository at this point in the history
  5. docs: rust: update with new required versions

    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 2, 2021
    Configuration menu
    Copy the full SHA
    ceb8b67 View commit details
    Browse the repository at this point in the history
  6. ci: call rustfmtcheck with the environment

    Now it is needed since we use `objtree` etc. in the target.
    
    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 2, 2021
    Configuration menu
    Copy the full SHA
    a9c675d View commit details
    Browse the repository at this point in the history
  7. ci: use beta release

    Signed-off-by: Miguel Ojeda <[email protected]>
    ojeda committed Jul 2, 2021
    Configuration menu
    Copy the full SHA
    3bb8661 View commit details
    Browse the repository at this point in the history