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

use include_str! to trigger a rebuild when the input spec is modified #16

Merged
merged 2 commits into from
Nov 17, 2021

Conversation

ahl
Copy link
Collaborator

@ahl ahl commented Nov 17, 2021

before:

qiviut /Users/ahl/src/progenitor/example-macro $ cargo build
   Compiling progenitor-macro v0.0.0 (/Users/ahl/src/progenitor/progenitor-macro)
   Compiling progenitor v0.0.0 (/Users/ahl/src/progenitor/progenitor)
   Compiling example-macro v0.0.1 (/Users/ahl/src/progenitor/example-macro)
    Finished dev [unoptimized + debuginfo] target(s) in 3.56s
qiviut /Users/ahl/src/progenitor/example-macro $ cargo build
qiviut /Users/ahl/src/progenitor/example-macro $ touch ../sample_openapi/keeper.json 
qiviut /Users/ahl/src/progenitor/example-macro $ cargo build -v
       Fresh unicode-xid v0.2.2
       Fresh autocfg v1.0.1
       Fresh cfg-if v1.0.0
       Fresh itoa v0.4.8
       Fresh lazy_static v1.4.0
       Fresh ppv-lite86 v0.2.15
       Fresh pin-project-lite v0.2.7
       Fresh bytes v1.1.0
       Fresh remove_dir_all v0.5.3
       Fresh hashbrown v0.11.2
       Fresh ucd-trie v0.1.3
       Fresh dyn-clone v1.0.4
       Fresh regex-syntax v0.6.25
       Fresh fnv v1.0.7
       Fresh convert_case v0.4.0
       Fresh same-file v1.0.6
       Fresh tinyvec_macros v0.1.0
       Fresh pin-utils v0.1.0
       Fresh futures-sink v0.3.17
       Fresh bitflags v1.3.2
       Fresh home v0.5.3
       Fresh matches v0.1.9
       Fresh unicode-width v0.1.9
       Fresh try-lock v0.2.3
       Fresh percent-encoding v2.1.0
       Fresh slab v0.4.5
       Fresh unicode-bidi v0.3.7
       Fresh httpdate v1.0.1
       Fresh tower-service v0.3.1
       Fresh base64 v0.13.0
       Fresh ipnet v2.3.1
       Fresh mime v0.3.16
       Fresh tracing-core v0.1.21
       Fresh pest v2.1.3
       Fresh http v0.2.5
       Fresh walkdir v2.3.2
       Fresh tinyvec v1.5.0
       Fresh form_urlencoded v1.0.1
       Fresh getopts v0.2.21
       Fresh proc-macro2 v1.0.32
       Fresh libc v0.2.106
       Fresh memchr v2.4.1
       Fresh ryu v1.0.5
       Fresh log v0.4.14
       Fresh core-foundation-sys v0.8.3
       Fresh tracing v0.1.29
       Fresh quote v1.0.10
       Fresh futures-core v0.3.17
       Fresh semver-parser v0.10.2
       Fresh futures-task v0.3.17
       Fresh unicode-normalization v0.1.19
       Fresh anyhow v1.0.45
       Fresh http-body v0.4.4
       Fresh httparse v1.5.1
       Fresh encoding_rs v0.8.29
       Fresh syn v1.0.81
       Fresh getrandom v0.2.3
       Fresh mio v0.7.14
       Fresh aho-corasick v0.7.18
       Fresh semver v0.11.0
       Fresh security-framework-sys v2.4.2
       Fresh core-foundation v0.9.2
       Fresh futures-util v0.3.17
       Fresh socket2 v0.4.2
       Fresh futures-channel v0.3.17
       Fresh want v0.3.0
       Fresh idna v0.2.3
       Fresh num-traits v0.2.14
       Fresh time v0.1.43
       Fresh serde_derive v1.0.130
       Fresh rand_core v0.6.3
       Fresh serde_derive_internals v0.25.0
       Fresh thiserror-impl v1.0.30
       Fresh tokio v1.13.0
       Fresh regex v1.5.4
       Fresh security-framework v2.4.2
       Fresh url v2.2.2
       Fresh serde v1.0.130
       Fresh rand_chacha v0.3.1
       Fresh thiserror v1.0.30
       Fresh schemars_derive v0.8.6
       Fresh tokio-util v0.6.9
       Fresh toolchain_find v0.2.0
       Fresh num-integer v0.1.44
       Fresh serde_json v1.0.69
       Fresh rand v0.8.4
       Fresh indexmap v1.7.0
       Fresh serde_urlencoded v0.7.0
       Fresh uuid v0.8.2
       Fresh chrono v0.4.19
       Fresh tempfile v3.2.0
       Fresh schemars v0.8.6
       Fresh openapiv3 v1.0.0-beta.5
       Fresh h2 v0.3.7
       Fresh typify-impl v0.0.2 (https://github.com/oxidecomputer/typify#69bc7f3e)
       Fresh native-tls v0.2.8
       Fresh rustfmt-wrapper v0.1.0
       Fresh hyper v0.14.14
       Fresh typify-macro v0.0.2 (https://github.com/oxidecomputer/typify#69bc7f3e)
       Fresh tokio-native-tls v0.3.0
       Fresh typify v0.0.2 (https://github.com/oxidecomputer/typify#69bc7f3e)
       Fresh hyper-tls v0.5.0
       Fresh progenitor-impl v0.0.0 (/Users/ahl/src/progenitor/progenitor-impl)
       Fresh reqwest v0.11.6
       Fresh progenitor-macro v0.0.0 (/Users/ahl/src/progenitor/progenitor-macro)
       Fresh progenitor v0.0.0 (/Users/ahl/src/progenitor/progenitor)
       Fresh example-macro v0.0.1 (/Users/ahl/src/progenitor/example-macro)
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s

after:

qiviut /Users/ahl/src/progenitor/example-macro $ cargo build
   Compiling time v0.1.43
   Compiling uuid v0.8.2
   Compiling reqwest v0.11.6
   Compiling progenitor-macro v0.0.0 (/Users/ahl/src/progenitor/progenitor-macro)
   Compiling chrono v0.4.19
   Compiling progenitor v0.0.0 (/Users/ahl/src/progenitor/progenitor)
   Compiling example-macro v0.0.1 (/Users/ahl/src/progenitor/example-macro)
    Finished dev [unoptimized + debuginfo] target(s) in 3.75s
qiviut /Users/ahl/src/progenitor/example-macro $ touch ../sample_openapi/keeper.json 
qiviut /Users/ahl/src/progenitor/example-macro $ cargo build -v
       Fresh unicode-xid v0.2.2
       Fresh cfg-if v1.0.0
       Fresh autocfg v1.0.1
       Fresh itoa v0.4.8
       Fresh lazy_static v1.4.0
       Fresh ppv-lite86 v0.2.15
       Fresh remove_dir_all v0.5.3
       Fresh ucd-trie v0.1.3
       Fresh pin-project-lite v0.2.7
       Fresh bytes v1.1.0
       Fresh same-file v1.0.6
       Fresh regex-syntax v0.6.25
       Fresh hashbrown v0.11.2
       Fresh home v0.5.3
       Fresh dyn-clone v1.0.4
       Fresh fnv v1.0.7
       Fresh convert_case v0.4.0
       Fresh bitflags v1.3.2
       Fresh futures-sink v0.3.17
       Fresh tinyvec_macros v0.1.0
       Fresh pin-utils v0.1.0
       Fresh matches v0.1.9
       Fresh slab v0.4.5
       Fresh percent-encoding v2.1.0
       Fresh try-lock v0.2.3
       Fresh unicode-width v0.1.9
       Fresh unicode-bidi v0.3.7
       Fresh tower-service v0.3.1
       Fresh httpdate v1.0.1
       Fresh mime v0.3.16
       Fresh base64 v0.13.0
       Fresh ipnet v2.3.1
       Fresh pest v2.1.3
       Fresh tracing-core v0.1.21
       Fresh walkdir v2.3.2
       Fresh http v0.2.5
       Fresh tinyvec v1.5.1
       Fresh form_urlencoded v1.0.1
       Fresh getopts v0.2.21
       Fresh libc v0.2.107
       Fresh proc-macro2 v1.0.32
       Fresh memchr v2.4.1
       Fresh ryu v1.0.5
       Fresh semver-parser v0.10.2
       Fresh log v0.4.14
       Fresh tracing v0.1.29
       Fresh getrandom v0.2.3
       Fresh core-foundation-sys v0.8.3
       Fresh futures-core v0.3.17
       Fresh futures-task v0.3.17
       Fresh socket2 v0.4.2
       Fresh http-body v0.4.4
       Fresh unicode-normalization v0.1.19
       Fresh httparse v1.5.1
       Fresh anyhow v1.0.45
       Fresh encoding_rs v0.8.29
       Fresh time v0.1.43
       Fresh quote v1.0.10
       Fresh rand_core v0.6.3
       Fresh aho-corasick v0.7.18
       Fresh semver v0.11.0
       Fresh mio v0.7.14
       Fresh security-framework-sys v2.4.2
       Fresh core-foundation v0.9.2
       Fresh futures-util v0.3.17
       Fresh futures-channel v0.3.17
       Fresh want v0.3.0
       Fresh num-traits v0.2.14
       Fresh syn v1.0.81
       Fresh rand_chacha v0.3.1
       Fresh regex v1.5.4
       Fresh tokio v1.14.0
       Fresh security-framework v2.4.2
       Fresh idna v0.2.3
       Fresh serde_derive v1.0.130
       Fresh rand v0.8.4
       Fresh thiserror-impl v1.0.30
       Fresh serde_derive_internals v0.25.0
       Fresh toolchain_find v0.2.0
       Fresh tokio-util v0.6.9
       Fresh url v2.2.2
       Fresh num-integer v0.1.44
       Fresh serde v1.0.130
       Fresh tempfile v3.2.0
       Fresh schemars_derive v0.8.7
       Fresh thiserror v1.0.30
       Fresh serde_json v1.0.70
       Fresh indexmap v1.7.0
       Fresh rustfmt-wrapper v0.1.0
       Fresh native-tls v0.2.8
       Fresh serde_urlencoded v0.7.0
       Fresh uuid v0.8.2
       Fresh chrono v0.4.19
       Fresh schemars v0.8.7
       Fresh openapiv3 v1.0.0-beta.5
       Fresh h2 v0.3.7
       Fresh tokio-native-tls v0.3.0
       Fresh typify-impl v0.0.6-dev (https://github.com/oxidecomputer/typify#58bfcd02)
       Fresh hyper v0.14.15
       Fresh typify-macro v0.0.6-dev (https://github.com/oxidecomputer/typify#58bfcd02)
       Fresh hyper-tls v0.5.0
       Fresh typify v0.0.6-dev (https://github.com/oxidecomputer/typify#58bfcd02)
       Fresh reqwest v0.11.6
       Fresh progenitor-impl v0.0.0 (/Users/ahl/src/progenitor/progenitor-impl)
       Fresh progenitor-macro v0.0.0 (/Users/ahl/src/progenitor/progenitor-macro)
       Fresh progenitor v0.0.0 (/Users/ahl/src/progenitor/progenitor)
   Compiling example-macro v0.0.1 (/Users/ahl/src/progenitor/example-macro)
     Running `rustc --crate-name example_macro --edition=2018 example-macro/src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=4af4c12019f3472b -C extra-filename=-4af4c12019f3472b --out-dir /Users/ahl/src/progenitor/target/debug/deps -C incremental=/Users/ahl/src/progenitor/target/debug/incremental -L dependency=/Users/ahl/src/progenitor/target/debug/deps --extern anyhow=/Users/ahl/src/progenitor/target/debug/deps/libanyhow-a701186c282849ba.rlib --extern chrono=/Users/ahl/src/progenitor/target/debug/deps/libchrono-8e2ce9749f0d4e58.rlib --extern percent_encoding=/Users/ahl/src/progenitor/target/debug/deps/libpercent_encoding-d2d21c99c2b79320.rlib --extern progenitor=/Users/ahl/src/progenitor/target/debug/deps/libprogenitor-dec12bd510c5d781.rlib --extern reqwest=/Users/ahl/src/progenitor/target/debug/deps/libreqwest-9cc9d3e65e41d29d.rlib --extern serde=/Users/ahl/src/progenitor/target/debug/deps/libserde-f68e99d106b9b555.rlib --extern uuid=/Users/ahl/src/progenitor/target/debug/deps/libuuid-5f52bc9c4a22acd5.rlib`
    Finished dev [unoptimized + debuginfo] target(s) in 0.53s

Looks like a not-unrelated crate came up with a similar idea: evestera/json_typegen#35

See also: oxidecomputer/omicron#396

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.

1 participant