pendulum-chain / pendulum

GNU General Public License v3.0
43 stars 14 forks source link

#444 Switch to 'stable' rust toolchain channel #463

Closed b-yap closed 6 months ago

b-yap commented 6 months ago

Closes #444.

There is a problem with using the Rust nightly-2024-02-09:

error[E0449]: visibility qualifiers are not permitted here
   --> /Users/b.carlayap/.cargo/git/checkouts/substrate-7e08433d4c370a21/ff24c60/frame/contracts/src/lib.rs:975:3
    |
975 |         environmental!(executing_contract: bool);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: trait items always share the visibility of their trait
    = note: this error originates in the macro `environmental` (in Nightly builds, run with -Z macro-backtrace for more info)

I tried a lower version (nightly-2023-12-28) but errors still abound:

error[E0658]: use of unstable library feature 'stdsimd'
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/curve25519-dalek-4.1.2/src/backend/vector/ifma/field.rs:26:5
   |
26 |     _mm256_madd52lo_epu64(z.into(), x.into(), y.into()).into()
   |     ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #48556 <https://github.com/rust-lang/rust/issues/48556> for more information
   = help: add `#![feature(stdsimd)]` to the crate attributes to enable

Found this comment to choose a newer version, so I picked nightly-2024-04-18.


How to begin the review:

  1. .github/actions/shared/action.yml:
    • we have to separate the jobs for building project using the stable version, and running the tests with nightly. But both jobs have similar steps. The shared steps are transferred in this file.
    • the file name action.yml is a must. See documentation:

      The metadata filename must be either action.yml or action.yaml.

  2. .github/workflows/test-code.yml:
    • split into 2 jobs:
      • build-check - to run cargo check with stable version
      • test-code - to run cargo test with nightly version
  3. README.md:
    • add explanation on why we override the toolchain for testing
  4. rust-toolchain.toml:
    • change to stable 1.77.0
  5. the other files are to clear up build warnings.