Skip to content

Commit ab62c8b

Browse files
committed
[tools] initial work on target determinator
Introduce an initial version of a target determinator: a way to figure out which packages have changed in a repository.
1 parent d86471c commit ab62c8b

31 files changed

+2530
-72
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,16 @@ jobs:
6565
with:
6666
command: build
6767
args: --all-targets --package target-spec
68-
# Build all packages we care about one by one to ensure feature unification
69-
# doesn't happen.
70-
# Build all targets to ensure examples are built as well.
7168
- name: Build and test guppy
7269
uses: actions-rs/cargo@v1
7370
with:
7471
command: build
7572
args: --all-targets --package guppy
76-
# Build all packages we care about one by one to ensure feature unification
77-
# doesn't happen.
78-
# Build all targets to ensure examples are built as well.
73+
- name: Build and test determinator
74+
uses: actions-rs/cargo@v1
75+
with:
76+
command: build
77+
args: --all-targets --package determinator
7978
- name: Build and test cargo-guppy
8079
uses: actions-rs/cargo@v1
8180
with:

Cargo.lock

Lines changed: 69 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ members = [
1010
"internal-tools/fixture-manager",
1111
"internal-tools/proptest-ext",
1212
"target-spec",
13+
"tools/determinator",
1314
]

fixtures/guppy/package_rules.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file lists out determinator package rules that can be used in tests.
2+
3+
# This path rule means guppy is triggered, which causes guppy-benchmark to be changed, which causes
4+
# everything to change.
5+
[[path-rule]]
6+
globs = ["**/fake-trigger"]
7+
mark-changed = ["proptest-ext"]
8+
9+
[[package-rule]]
10+
on-affected = ["fixtures"]
11+
mark-changed = ["guppy-cmdlib"]
12+
13+
[[package-rule]]
14+
on-affected = ["guppy-benchmarks"]
15+
mark-changed = "all"
16+

fixtures/guppy/path_rules.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file lists out determinator path rules that can be used in tests.
2+
3+
[[path-rule]]
4+
# Ignore README files.
5+
globs = ["**/README.md", "**/README.tpl"]
6+
mark-changed = []
7+
post-rule = "skip"
8+
9+
[[path-rule]]
10+
# This is a test rule to ensure that marking packages changed works.
11+
globs = ["CODE_OF_CONDUCT.md", "CONTRIBUTING.md"]
12+
mark-changed = ["cargo-guppy"]
13+
post-rule = "fallthrough"
14+
15+
[[path-rule]]
16+
# Ensure fallthrough works from above.
17+
globs = ["CODE_OF_CONDUCT.md"]
18+
mark-changed = ["guppy"]
19+
20+
[[path-rule]]
21+
# Test for skip-rules.
22+
globs = ["**/foo"]
23+
mark-changed = ["cargo-compare"]
24+
post-rule = "skip-rules"
25+
26+
[[path-rule]]
27+
# The above rule should mean this never gets applied.
28+
globs = ["**/foo"]
29+
mark-changed = ["target-spec"]

fixtures/guppy/summaries/metadata_guppy_78cb7e8-1.toml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include-dev = false
77
proc-macros-on-target = false
88

99
[metadata.target-platform]
10-
triple = 'x86_64-fortanix-unknown-sgx'
10+
triple = 'x86_64-apple-tvos'
1111
target-features = 'all'
1212
flags = ['abc']
1313

@@ -688,6 +688,13 @@ crates-io = true
688688
status = 'transitive'
689689
features = []
690690

691+
[[target-package]]
692+
name = 'openssl-probe'
693+
version = '0.1.2'
694+
crates-io = true
695+
status = 'transitive'
696+
features = []
697+
691698
[[target-package]]
692699
name = 'openssl-sys'
693700
version = '0.9.58'
@@ -891,6 +898,13 @@ crates-io = true
891898
status = 'transitive'
892899
features = []
893900

901+
[[target-package]]
902+
name = 'termios'
903+
version = '0.3.2'
904+
crates-io = true
905+
status = 'transitive'
906+
features = []
907+
894908
[[target-package]]
895909
name = 'textwrap'
896910
version = '0.11.0'

fixtures/guppy/summaries/metadata_guppy_78cb7e8-4.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include-dev = false
77
proc-macros-on-target = true
88

99
[metadata.target-platform]
10-
triple = 'aarch64-apple-ios'
10+
triple = 'aarch64-apple-darwin'
1111
target-features = 'all'
1212

1313
[[target-package]]

fixtures/guppy/summaries/metadata_guppy_78cb7e8-7.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include-dev = true
77
proc-macros-on-target = false
88

99
[metadata.host-platform]
10-
triple = 'mips64-unknown-linux-gnuabi64'
10+
triple = 'mips64-unknown-linux-muslabi64'
1111
target-features = ['sse4.2', 'ssse3', 'xsaves']
1212
flags = ['cargo_web']
1313

0 commit comments

Comments
 (0)