Skip to content

Commit

Permalink
Merge #2915
Browse files Browse the repository at this point in the history
2915: Update rust-toolchain to 2021-12-04 r=ppannuto a=lschuermann

### Pull Request Overview

This pull request updates the Rust toolchain to version `1.59.0-nightly (efec54529 2021-12-04)`. The motivation for this change is that the `litex-sim-ci` breaks when compiling `elf2tab` on the previous toolchain version:

```
error[E0658]: use of unstable library feature 'proc_macro_is_available'
  --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.33/src/detection.rs:28:21
   |
28 |     let available = proc_macro::is_available();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #71436 <rust-lang/rust#71436> for more information
   = help: add `#![feature(proc_macro_is_available)]` to the crate attributes to enable

For more information about this error, try `rustc --explain E0658`.
error: could not compile `proc-macro2` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `elf2tab v0.8.0`, intermediate artifacts can be found at `/tmp/cargo-installl05bA0`
```

Now, I'm not entirely sure as to why this happens. We haven't upgraded either of the Rust toolchain or `elf2tab`, and -- as far as I understand -- `cargo install elf2tab` should use the `Cargo.lock` file, so dependencies shouldn't change.

In any case, this update seems to fix it. Besides the failing `litex-sim-ci` workflow, it seems like a good idea to pin a `rustc` version on which vital tools such as `elf2tab` properly compile. I can also reproduce the `elf2tab` build failure locally while the `rust-toolchain` of the Tock repository is used.


### Testing Strategy

This pull request was tested by CI.


### TODO or Help Wanted

N/A


### Documentation Updated

- [x] ~Updated the relevant files in `/docs`,~ or no updates are required.

### Formatting

- [x] Ran `make prepush`.


Co-authored-by: Leon Schuermann <leon@is.currently.online>
  • Loading branch information
bors[bot] and lschuermann committed Dec 9, 2021
2 parents e02c562 + 16c7d99 commit 7581905
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/litex_sim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ jobs:
with:
components: rustfmt, clippy

# Install elf2tabl to be able to build userspace apps
- name: Install elf2tab
run: |
cargo install elf2tab
# Install tockloader, which is used to prepare binaries with userspace
# applications.
- name: Install tockloader
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"editor.formatOnSave": true,
"rust-client.channel": "nightly-2021-10-05",
"rust-client.channel": "nightly-2021-12-04",
}
2 changes: 1 addition & 1 deletion arch/cortex-m/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#![crate_name = "cortexm"]
#![crate_type = "rlib"]
#![feature(asm)]
#![feature(asm, asm_sym)]
#![feature(naked_functions)]
#![no_std]

Expand Down
2 changes: 1 addition & 1 deletion arch/cortex-m0/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#![crate_name = "cortexm0"]
#![crate_type = "rlib"]
#![feature(asm, naked_functions)]
#![feature(asm, asm_sym, naked_functions)]
#![no_std]

// Re-export the base generic cortex-m functions here as they are
Expand Down
2 changes: 1 addition & 1 deletion arch/rv32i/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#![crate_name = "rv32i"]
#![crate_type = "rlib"]
#![feature(asm, const_fn_trait_bound, naked_functions)]
#![feature(asm, asm_sym, const_fn_trait_bound, naked_functions)]
#![no_std]

use core::fmt::Write;
Expand Down
2 changes: 1 addition & 1 deletion chips/litex_vexriscv/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! LiteX SoCs based around a VexRiscv CPU

#![feature(asm, const_fn_trait_bound)]
#![feature(asm, asm_const, const_fn_trait_bound)]
#![no_std]
#![crate_name = "litex_vexriscv"]
#![crate_type = "rlib"]
Expand Down
4 changes: 2 additions & 2 deletions doc/Getting_Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ of installing some of these tools, but you can also install them yourself.

#### Rust (nightly)

We are using `nightly-2021-10-05`. We require
We are using `nightly-2021-12-04`. We require
installing it with [rustup](http://www.rustup.rs) so you can manage multiple
versions of Rust and continue using stable versions for other Rust code:

Expand All @@ -90,7 +90,7 @@ to your `$PATH`.
Then install the correct nightly version of Rust:

```bash
$ rustup install nightly-2021-10-05
$ rustup install nightly-2021-12-04
```

#### Tockloader
Expand Down
2 changes: 1 addition & 1 deletion libraries/riscv-csr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! Uses the Tock Register Interface to control RISC-V CSRs.

#![feature(asm)]
#![feature(asm, asm_const)]
#![feature(const_fn_trait_bound)]
#![no_std]

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2021-10-05
nightly-2021-12-04
2 changes: 1 addition & 1 deletion tools/netlify-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set -u
set -x

# Install rust stuff that we need
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2021-10-05
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2021-12-04

# And fixup path for the newly installed rust stuff
export PATH="$PATH:$HOME/.cargo/bin"
Expand Down

0 comments on commit 7581905

Please sign in to comment.