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

ci: move to stable toolchain #223

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AaronFeickert
Copy link
Contributor

Currently, CI uses a mix of stable and nightly toolchains. Nightly is included primarily to support no_std checks, but this is only necessary due to a rand test dependency.

This PR makes changes to allow a move to stable across the board. To do this, it replaces the use of rand in all tests with a random number generator from rand_chacha, which has the side effect of making all tests deterministic.

However, due to a desire to keep a secure random number generator in doctests, we add an optional rand feature whose only role is to enable rand_core::OsRng. Doctests that use this are gated on this feature.

The no_std target has been changed to wasm32-unknown-unknown for easier local testing; it should still meet the goal.

Finally, note that some formatting rules are not available on stable, so we still use the latest nightly for this.

@AaronFeickert AaronFeickert marked this pull request as draft February 7, 2024 19:40
Copy link
Contributor

@SWvheerden SWvheerden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we need to remove rand, rand should work on stable.

- name: Check code
run: cargo +stable check --release --all-targets
- name: Check code (no default features)
run: cargo +stable check --release --no-default-features
# This check here is to ensure that it builds for no-std rust targets
- name: Check code (no-std)
run: cargo +${{ env.nightly }} check --no-default-features --target=thumbv8m.main-none-eabi -Zavoid-dev-deps
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont change this target at all, it was chosen very specifically to match this: https://github.com/tari-project/ledger/tree/main/ledger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants