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

Avoid being a build-dependency #93

Closed
rasky opened this issue Dec 25, 2018 · 2 comments
Closed

Avoid being a build-dependency #93

rasky opened this issue Dec 25, 2018 · 2 comments

Comments

@rasky
Copy link

rasky commented Dec 25, 2018

skeptic is a helper for tests, and as such it must and should be a dev-dependency. Unfortunately, the way it plugs into build.rs causes all downstream users of libraries using skeptic to also compile and build skeptic and all its dependencies, for the purpose of generating a test file that will never be executed. The dependency tree is not so small as one would hope:

│   │   [build-dependencies]
│   │   └── skeptic v0.13.4
│   │       ├── bytecount v0.4.0
│   │       ├── cargo_metadata v0.6.4
│   │       │   ├── error-chain v0.12.0
│   │       │   │   └── backtrace v0.3.9
│   │       │   │       ├── cfg-if v0.1.6 (*)
│   │       │   │       ├── libc v0.2.44 (*)
│   │       │   │       └── rustc-demangle v0.1.9
│   │       │   ├── semver v0.9.0
│   │       │   │   ├── semver-parser v0.7.0
│   │       │   │   └── serde v1.0.82
│   │       │   ├── serde v1.0.82 (*)
│   │       │   ├── serde_derive v1.0.80
│   │       │   │   ├── proc-macro2 v0.4.24 (*)
│   │       │   │   ├── quote v0.6.10 (*)
│   │       │   │   └── syn v0.15.22
│   │       │   │       ├── proc-macro2 v0.4.24 (*)
│   │       │   │       ├── quote v0.6.10 (*)
│   │       │   │       └── unicode-xid v0.1.0 (*)
│   │       │   └── serde_json v1.0.33
│   │       │       ├── itoa v0.4.3
│   │       │       ├── ryu v0.2.7
│   │       │       └── serde v1.0.82 (*)
│   │       ├── error-chain v0.12.0 (*)
│   │       ├── glob v0.2.11
│   │       ├── pulldown-cmark v0.2.0
│   │       │   └── bitflags v1.0.4 (*)
│   │       ├── serde_json v1.0.33 (*)
│   │       ├── tempdir v0.3.7
│   │       │   ├── rand v0.4.3
│   │       │   │   └── libc v0.2.44 (*)
│   │       │   └── remove_dir_all v0.5.1
│   │       └── walkdir v2.2.7
│   │           └── same-file v1.0.4

Given that rust is not... fast at builds, I think that adding all this overhead is a disservice for users of libraries using skeptic.

Is it possible to devise a better way to handle this?

@rasky
Copy link
Author

rasky commented Dec 25, 2018

My own two cents: create a skeptic binary and let users of skeptic install it through cargo install. Running skeptic README.md generates the test file. The test file itself contains a checksum for README.md and checks it at every run; if it changes, it suggests the developer to re-run skeptic README.md (or re-run it itself?).

@rasky
Copy link
Author

rasky commented Dec 25, 2018

Duplicate of #60

@rasky rasky closed this as completed Dec 25, 2018
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

No branches or pull requests

1 participant