-
Notifications
You must be signed in to change notification settings - Fork 148
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
Rust: Add no_std CI #1648
Rust: Add no_std CI #1648
Conversation
d9a4aba
to
c964521
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add this as a separate job in the rust.yml
file? I'd rather have just one file for all the Rust tests
.github/workflows/rust.yml
Outdated
runs-on: ubuntu-latest | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ github.job }} |
on both this and the one above, or else the jobs are going to cancel each other
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
- name: curve25519-dalek test | ||
run: etc/ci/test-fiat-rust-curve25519-dalek.sh | ||
run: (cd .. ; etc/ci/test-fiat-rust-curve25519-dalek.sh) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you instead make the scripts robust to cwd changes by sticking in a line like
cd "$(dirname "$0")/../.." || exit 7 |
in the script itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend to do that in a follow-up PR where I will remove those shellscripts together and it will be natively github action - or a bit more idiomatic w/o shellscripts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, sounds good. In that case I think you'll need to fix the cd ..; ../etc/...
that's a couple lines down though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh thanks fixed 💜
I don't see the |
Sorry - Here: https://github.com/dalek-cryptography/curve25519-dalek/blob/main/.github/workflows/no_std.yml I forgot I had a PR which isn't yet in main where I shifted them around: https://github.com/dalek-cryptography/curve25519-dalek/pull/572/files#diff-92d698a5ce32a269344d647e18fb6501bf6a58b69ea93cf4a80fd5c9c12efc21 😅 |
.github/workflows/rust.yml
Outdated
jobs: | ||
test-rust: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ github.job }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this doesn't work the way I hoped, and still cancels the job
Let's try
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ github.job }} | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ job.name }} |
Or else just manually disambiguate them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it needs to be at root level
- name: no_std / no feat fiat-crypto | ||
run: cargo build -p fiat-crypto --target thumbv7em-none-eabi --release --no-default-features | ||
- name: no_std / cargo hack fiat-crypto | ||
run: cargo hack build -p fiat-crypto --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to complete in 0.00s?
Run cargo build -p fiat-crypto --target thumbv7em-none-eabi --release --no-default-features
Compiling fiat-crypto v0.2.2 (/home/runner/work/fiat-crypto/fiat-crypto/fiat-rust)
Finished release [optimized] target(s) in 6.75s
0s
Run cargo hack build -p fiat-crypto --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std
cargo hack build -p fiat-crypto --target thumbv7em-none-eabi --release --each-feature --exclude-features default,std
shell: /usr/bin/bash -e {0}
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
info: running cargo build --release --target thumbv7em-none-eabi --no-default-features
on fiat-crypto (1/1)
Finished release [optimized] target(s) in 0.00s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes because it only builds it and it uses incremental compilation - it will take more when there are features
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Adds CI for no_std on a target that does not have it
Prevents #1645
(The current one doesn't use no_std target and may miss it - this is the same workflow we use in curve25519-dalek)
EDIT: The workflow curently in curve25519-dalek is no_std.yml
(I will send further PR's to make the workflows compact + faster separately after this - I see some low hanging fruit 🍓 )