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

.travis.yml: Test no_std platform, WASM, all feature combos, --release #21

Merged
merged 11 commits into from Aug 12, 2019

Conversation

tarcieri
Copy link
Member

This uses a CI config more like the one at:

https://github.com/RustCrypt/signatures

It runs all tests with the --release flag to ensure that crates aren't broken by release-dependent functionality after being tested in debug mode (we can add back debug mode testing if it's helpful, but it doesn't look like we have anything presently gated on debug builds). I now see @newpavlov also requested it on #20.

It also tests on a no_std platform (thumbv7) which @newpavlov requested in #18.

Finally, it tests with --all-features. This should uncover some lingering breakages (it won't in this commit, but it appears some of the conditional compilation is incorrectly gated and I intend to fix it in a follow-up commit).

This uses a CI config more like the one at:

https://github.com/RustCrypt/signatures

It runs all tests with the `--release` flag to ensure that crates aren't
broken by release-dependent functionality after being tested in debug
mode (we can add back debug mode testing if it's helpful, but it doesn't
look like we have anything presently gated on debug builds). I now see
@newpavlov also requested it on #20.

It also tests on a `no_std` platform (thumbv7) which @newpavlov
requested in #18.

Finally, it tests with `--all-features`. This should uncover some
lingering breakages (it won't in this commit, but it appears some of the
conditional compilation is incorrectly gated and I intend to fix it in a
follow-up commit).
The code presently isn't rustfmt'd.

Some of these clippy failures really look like they should be addressed,
but for the purposes of getting more CI checks to pass, we don't need to
enforce clippy for now.
.travis.yml Outdated Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
.travis.yml Show resolved Hide resolved
.travis.yml Outdated Show resolved Hide resolved
Each install step cooresponds to only one entry in the build matrix, so
split it up that way.

This allows tests on Rust 1.27.0 to continue to pass, and prevents
installing irrelevant components on Rust versions that don't need them.
@newpavlov suggested we either do a full-blown WASM test on Node or
don't build at all.

I agree that if it builds on another `no_std` platform, it will probably
build on WASM too, so building on both probably isn't helpful.
I think these might be worth keeping as I think when running tests in a
workspace it doesn't do a docs test by default, but we can circle back
on that later.
The `--all-features` build doesn't work on 1.27.0 because `zeroize` is a
2018 edition crate and 1.27.0 is a pre-2018-edition release.
@tarcieri
Copy link
Member Author

@newpavlov regarding c57a8cd, any thoughts on bumping these to 2018 edition crates? (and therefore 1.31+)

@tarcieri
Copy link
Member Author

tarcieri commented Aug 12, 2019

@newpavlov okay, well it's green and the no_std failure has been caught.

The clippy warnings seem really bad, and in general a lot of the code seems to have warnings (and cargo features that simply don't work, but I'll save that for another PR), but this seems like a reasonable baseline of CI checks to me.

@newpavlov
Copy link
Member

newpavlov commented Aug 12, 2019

After a cursory look I don't see any serious issues in clippy warnings, one questionable place is this one from ctr crate:

ptr::read_unaligned(nonce as *const Nonce<Self> as *const [u64; 2])

Clippy does not like casting into a pointer with a stricter aligment, but if I am not mistaken it should not be an issue since we use resulting pointer with read_unaligned. We can replace it with transmute_copy (previously std was using aligned reads in it, but it got fixed).

Also maybe it's worth to use RUSTFLAGS="-D warnings" and add #![warn(unused_lifetimes, missing_docs)] to crates?

@tarcieri
Copy link
Member Author

Aah, now I understand what's up with c57a8cd... see #22. The extern crate std was needed for an incorrectly gated cargo feature, so perhaps instead of splitting that out I'll just fix it in this PR too.

Several things were gated under `cargo_feature` attributes, which don't
appear to do anything. Because of it, much of it was broken/untested.
It was previously missing a needed generic parameter
It appears `std` was being imported to access a trait from `core` (`Drop`).

This removes the `std` import and imports `Drop` from `core` instead.
@tarcieri
Copy link
Member Author

tarcieri commented Aug 12, 2019

@newpavlov okay, I'd say this is ready. Re:

Also maybe it's worth to use RUSTFLAGS="-D warnings" and add #![warn(unused_lifetimes, missing_docs)] to crates?

I agree with that, but how about separate PRs? I think the fix for the current warning deserves to be split out because it's a little weird and I want to make sure it the fix for it I want to do doesn't unintentionally impact the current logic and I don't want that change to get lost in this much shuffle.

@tarcieri
Copy link
Member Author

I opened an issue to discuss the current warning in salsa20-core: #23

I suppose I can add -D warnings and annotate that warning specifically to allow it but note the open issue about it (a.k.a. "stop the bleeding")

Have CI fail on warnings.

There's one warning across the workspace in the `salsa20-crate`.
I opened an issue about it here:

#23

I've gone ahead and thrown an `allow` attribute on the relevant code so
CI passes, which should at least prevent additional warnings from going
uncaught on CI.
@tarcieri
Copy link
Member Author

@newpavlov okay, 6d0d83b adds RUSTFLAGS="-D warnings" with an allow attribute and comment with a link to #23

@tarcieri
Copy link
Member Author

Unfortunately it seems on Rust 1.27.0, there are several generic-array related warnings:

https://travis-ci.org/RustCrypto/stream-ciphers/jobs/571083202

I'll see if I can disable -D warnings for 1.27.0 only...

There are several `generic-array`-related warnings on 1.27.0:

https://travis-ci.org/RustCrypto/stream-ciphers/jobs/571083202

We should probably phase 1.27.0 out anyway (#24), so ignore them.
@tarcieri tarcieri merged commit 5506366 into master Aug 12, 2019
@tarcieri tarcieri deleted the ci-config-improvements branch August 12, 2019 23:52
@tarcieri
Copy link
Member Author

Disabling the warnings for 1.27.0 worked. Now on to the PR I actually wanted to write in the first place 😉

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

Successfully merging this pull request may close these issues.

None yet

2 participants