Skip to content

Allow crate to compile without leaking features from dev-dependencies.#5

Merged
althonos merged 1 commit intoalthonos:masterfrom
najamelan:fix/syn-features
Jun 4, 2021
Merged

Allow crate to compile without leaking features from dev-dependencies.#5
althonos merged 1 commit intoalthonos:masterfrom
najamelan:fix/syn-features

Conversation

@najamelan
Copy link
Copy Markdown
Contributor

When adding blanket as a dependency to a blank cargo project, it fails to
compile. This is due to missing features on the syn crate.

This commit adds the needed features. This problem could not be detected
from within the crate itself because features were leaking through from
the dev-dependency of syn which does not have default-features = false.

I turned on resolver = "2". This is the new feature resolver for cargo
that will become the default in edition 2021. This is not strictly necessary
but it helps as it no longer leaks features. This means that cargo check
will now fail if there are missing features. As cargo test obviously turns
on the features from dev-dependencies, this will still not detect the
issue.

You might want to check your CI script and add a cargo check before
running cargo test.

NOTE: rebased on #3 and #4, so you probably want to merge them first.

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 1, 2021

Codecov Report

Merging #5 (ba4ab9a) into master (c22888f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #5   +/-   ##
=======================================
  Coverage   78.18%   78.18%           
=======================================
  Files           9        9           
  Lines         495      495           
=======================================
  Hits          387      387           
  Misses        108      108           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c22888f...ba4ab9a. Read the comment docs.

@najamelan
Copy link
Copy Markdown
Contributor Author

ps I didn't run rustfmt, as that wanted to reformat the entire crate more or less.

@najamelan najamelan force-pushed the fix/syn-features branch 2 times, most recently from 4f5fa05 to d4f0a66 Compare June 4, 2021 17:11
@najamelan
Copy link
Copy Markdown
Contributor Author

Ah, the merge conflicts caused a bug here. I'll try and fix.

When adding blanket as a dependency to a blank cargo project, it fails to
compile. This is due to missing features on the syn crate.

This commit adds the needed features. This problem could not be detected
from within the crate itself because features were leaking through from
the dev-dependency of syn which does not have `default-features = false`.

I turned on `resolver = "2"`. This is the new feature resolver for cargo
that will become the default in edition 2021. This is not strictly necessary
but it helps as it no longer leaks features. This means that `cargo check`
will now fail if there are missing features. As `cargo test` obviously turns
on the features from `dev-dependencies`, this will still not detect this
issue.

You might want to check your CI script and add a `cargo check` before
running `cargo test`.
@althonos althonos merged commit 158c7d4 into althonos:master Jun 4, 2021
@althonos
Copy link
Copy Markdown
Owner

althonos commented Jun 4, 2021

Good catch, thanks!

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.

2 participants