Inwelling: collecting metadata from downstream users

Here is project repository.

Library Overview

This library helps to send metadata through the hierarchy of crates, from
downstream crates to one of their common ancestor.

The main API is inwelling(), which is expected to be called in build.rs of
the common ancestor crate.

.      +--------------> [topmost crate]
.      |      3            |       ^
.      |                  4|       |8
.      |                   |       |
.      |                 [dependencies]
.      |2                  |       |
.      |                   |       |
.      |        (metadata) |5     7| (API)
.      |                   |       |
.      |        1          v   6   |
. inwelling() <---- build.rs ----> bindings.rs
.[inwelling crate]     [common ancestor]

The information in section [package.metadata.inwelling.{common ancestor}.*]
in downstream crates' Cargo.toml files will be collected by inwelling().

1 Like

version 0.1.2 published.

What' new:

Optional Metadata

Cargo features can control whether to send metadata or not. in section [package.metadata.inwelling.{common ancestor}] , a value of feature = blah means that the metadata will be collected by inwelling if and only if blah feature is enabled. See beta crate in examples for more.

version 0.2.0 published.

What' new:

Optional Metadata

Cargo features can control whether to send metadata or not. in section [package.metadata.inwelling-{common ancestor}] , a value of feature = blah means that the metadata will be collected by inwelling if and only if blah feature is enabled. See beta crate in examples for more.
Note: '.' has been replaced by '-' in section names.

The inwelling crate opens up the possibility of reverse dependencies and some kind of global analysis. See examples: clib and structx for more.

version 0.3.0 published.

What's new

  • Watch downstream's Cargo.toml files, and re-run user's build.rs if these manifests have been changed.

  • Watch downstream's *.rs files under src/, examples/, tests/ directories, and re-run user's build.rs if these source files have been changed.

  • Collect .rs files as required.

Breaking changes

  • The signature of fn inwelling() has been changed.

    pub fn inwelling( Opts{ watch_manifest, watch_rs_files, dump_rs_paths }: Opts ) -> Inwelling;
    
  • The newly added argument of inwelling() is Opts:

    pub struct Opts {
        /// build.rs using inwelling() will re-run if downstream crates' Cargo.toml files have been changed.
        pub watch_manifest : bool,
        /// build.rs using inwelling() will re-run if   downstream crates' .rs files have been changed.
        pub watch_rs_files : bool,
        /// if this flag is true, inwelling()'s returning value will contain .rs file paths.
        pub dump_rs_paths  : bool,
    }
    
  • The definition of struct Section has been changed.

    pub struct Section {
        // Unchanged fields omitted.
    
        /// .rs files under src/, examples/ and tests/ directories if dump_rs_file is
        /// true, otherwise `None`.
        pub rs_paths : Option<Vec<PathBuf>>,
    }
    
    

And its downstream crates have been updated to utilize this new version of inwelling as their dependencies:

  • clib, generating Rust bindings of C libraries and put them in the whole namespace clib::*.

  • structx, simulating anonymous struct and named arguments in Rust. Non-local "anonymous struct" type provided.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.