Skip to content

Commit

Permalink
Exclude README.md from cargo change tracking
Browse files Browse the repository at this point in the history
In packages using cargo-readme, README.md files are touched by build.rs, which
triggers cargo's change tracking in the next build.  This means cargo is
rebuilding the package every time.

This change adds README.md to the exclude list in Cargo.toml files so that
cargo doesn't think a README change requires a rebuild.  Most of our packages
use cargo-readme to generate README.md, and for packages that don't, this still
isn't harmful; manual updates to README.md don't need a Rust build.  (Special
cases can just remove this exclude line.)

The downside is that accidental changes to README.md, like removing it, won't
be automatically corrected with a rebuild if you haven't touched anything else.
This should be rare, and will correct itself upon any other change.  (And a
developer is unlikely to commit such an accidental change.)
  • Loading branch information
tjkirch committed Jul 17, 2020
1 parent 94b5329 commit cd7e66d
Show file tree
Hide file tree
Showing 35 changed files with 70 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sources/api/apiclient/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
futures = "0.3"
Expand Down
2 changes: 2 additions & 0 deletions sources/api/apiserver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
actix-rt = "1.0.0"
Expand Down
2 changes: 2 additions & 0 deletions sources/api/bork/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["Samuel Mendoza-Jonas <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
rand = "0.7.0"
Expand Down
2 changes: 2 additions & 0 deletions sources/api/early-boot-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
apiclient = { path = "../apiclient" }
Expand Down
2 changes: 2 additions & 0 deletions sources/api/host-containers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
apiclient = { path = "../apiclient" }
Expand Down
2 changes: 2 additions & 0 deletions sources/api/migration/migration-helpers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["Tom Kirchner <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
apiserver = { path = "../../apiserver" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["Erikson Tung <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
migration-helpers = { path = "../../../migration-helpers" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["Erikson Tung <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
migration-helpers = { path = "../../../migration-helpers" }
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["Jamie Anderson <[email protected]"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
migration-helpers = { path = "../../../migration-helpers" }
2 changes: 2 additions & 0 deletions sources/api/migration/migrator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
bottlerocket-release = { path = "../../../bottlerocket-release" }
Expand Down
2 changes: 2 additions & 0 deletions sources/api/netdog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["Ben Cressey <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
dns-lookup = "1.0"
Expand Down
2 changes: 2 additions & 0 deletions sources/api/pluto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
reqwest = { version = "0.10", default-features = false, features = ["blocking"]}
Expand Down
2 changes: 2 additions & 0 deletions sources/api/schnauzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
apiclient = { path = "../apiclient" }
Expand Down
2 changes: 2 additions & 0 deletions sources/api/servicedog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
apiclient = { path = "../apiclient" }
Expand Down
2 changes: 2 additions & 0 deletions sources/api/settings-committer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
apiclient = { path = "../apiclient" }
Expand Down
2 changes: 2 additions & 0 deletions sources/api/storewolf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
apiserver = { path = "../apiserver" }
Expand Down
2 changes: 2 additions & 0 deletions sources/api/sundog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
apiclient = { path = "../apiclient" }
Expand Down
2 changes: 2 additions & 0 deletions sources/api/thar-be-settings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
apiclient = { path = "../apiclient" }
Expand Down
2 changes: 2 additions & 0 deletions sources/api/thar-be-updates/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
apiclient = { path = "../apiclient" }
Expand Down
2 changes: 2 additions & 0 deletions sources/bottlerocket-release/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["Tom Kirchner <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
envy = "0.4"
Expand Down
2 changes: 2 additions & 0 deletions sources/growpart/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["Ben Cressey <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
gptman = { version = "0.6.1", default-features = false }
Expand Down
2 changes: 2 additions & 0 deletions sources/logdog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["Matt Briggs <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
flate2 = "1.0"
Expand Down
2 changes: 2 additions & 0 deletions sources/models/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
base64 = "0.12"
Expand Down
2 changes: 2 additions & 0 deletions sources/models/model-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[lib]
path = "src/lib.rs"
Expand Down
2 changes: 2 additions & 0 deletions sources/parse-datetime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["Zac Mrowicki <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
chrono = "0.4.11"
Expand Down
2 changes: 2 additions & 0 deletions sources/updater/block-party/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["iliana destroyer of worlds <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
snafu = "0.6.0"
2 changes: 2 additions & 0 deletions sources/updater/signpost/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["iliana destroyer of worlds <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
bit_field = "0.10.0"
Expand Down
2 changes: 2 additions & 0 deletions sources/updater/update_metadata/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["Samuel Mendoza-Jonas <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
chrono = { version = "0.4.9", features = ["serde"] }
Expand Down
2 changes: 2 additions & 0 deletions sources/updater/updog/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["iliana destroyer of worlds <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
bottlerocket-release = { path = "../../bottlerocket-release" }
Expand Down
2 changes: 2 additions & 0 deletions sources/webpki-roots-shim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["iliana destroyer of worlds <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
lazy_static = "1.4.0"
Expand Down
2 changes: 2 additions & 0 deletions tools/buildsys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ authors = ["Ben Cressey <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2018"
publish = false
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[dependencies]
duct = "0.13.0"
Expand Down
2 changes: 2 additions & 0 deletions variants/aws-dev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ version = "0.1.0"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[package.metadata.build-variant]
included-packages = [
Expand Down
2 changes: 2 additions & 0 deletions variants/aws-k8s-1.15/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ version = "0.1.0"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[package.metadata.build-variant]
included-packages = [
Expand Down
2 changes: 2 additions & 0 deletions variants/aws-k8s-1.16/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ version = "0.1.0"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[package.metadata.build-variant]
included-packages = [
Expand Down
2 changes: 2 additions & 0 deletions variants/aws-k8s-1.17/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ version = "0.1.0"
edition = "2018"
publish = false
build = "build.rs"
# Don't rebuild crate just because of changes to README.
exclude = ["README.md"]

[package.metadata.build-variant]
included-packages = [
Expand Down

0 comments on commit cd7e66d

Please sign in to comment.