Trangar / periodic_table

Library that provides a list of elements in the periodic table
3 stars 1 forks source link

Move generated code to OUT_DIR #7

Closed VictorKoenders closed 4 years ago

VictorKoenders commented 4 years ago

When deploying cargo, we get the following error:

error: failed to verify package tarball

Caused by:
  Source directory was modified by build.rs during cargo publish. Build scripts should not modify anything outside of OUT_DIR.
Added: /home/trangar/development/rust/periodic_table/target/package/periodic_table-0.2.0/src/lib.rs

To proceed despite this, pass the `--no-verify` flag.

It would be nice if the build script wrote to OUT_DIR, and we had a normal lib.rs that included it with include!(concat!(env!("OUT_DIR"), "/elements.rs"));

VictorKoenders commented 4 years ago

docs.rs won't build our project until this is changed: https://docs.rs/crate/periodic_table/0.2.0/builds/194779

[INFO] [stderr] error: failed to run custom build command for `periodic_table v0.2.0 (/opt/rustwide/workdir)`
[INFO] [stderr] 
[INFO] [stderr] Caused by:
[INFO] [stderr]   process didn't exit successfully: `/opt/rustwide/target/debug/build/periodic_table-402197e00f9996d5/build-script-build` (exit code: 1)
[INFO] [stderr] --- stderr
[INFO] [stderr] Error: Os { code: 30, kind: Other, message: "Read-only file system" }
VictorKoenders commented 4 years ago

Closed in #8