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

Build extra components specified in manifest metadata #114

Merged
merged 13 commits into from
Aug 1, 2022

Commits on Jul 25, 2022

  1. Rewrite build driver selection

    Because #[path = "..."] approach sets different file paths for the same module,
    this causes issues with the normal module structure.
    N3xed committed Jul 25, 2022
    Configuration menu
    Copy the full SHA
    cbd3ee8 View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2022

  1. Configuration menu
    Copy the full SHA
    107c13c View commit details
    Browse the repository at this point in the history
  2. Refactor and use serde for build configuration

    Add dependency `envy` to deserialize struct from env variables.
    Refactor `common::InstallDir` using the strum crate.
    Add `build_driver::TOOLS_DIR`.
    Cargo fmt `build/pio.rs`.
    Split build configuration into separate modules and structs `BuildConfig`, `NativeConfig`.
    N3xed committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    1441dc1 View commit details
    Browse the repository at this point in the history
  3. Allow build configuration to be specified in manifest metadata

    This change allows the build configuration to be specified in the `package.metadata.esp-idf-sys`
    table of the root crate's manifest (Cargo.toml). If no root crate exists in the workspace the crate
    with the name equal to the `ESP_IDF_SYS_ROOT_CRATE` environment variable is used.
    
    All configuration specified via environment variables will override the corresponding options
    of the cargo metadata. If `cargo metadata` fails for some reason, this will only generate a warning
    in the build output and not cause the build to fail.
    
    Add build dependency `cargo_metadata`.
    N3xed committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    4f6e9ce View commit details
    Browse the repository at this point in the history

Commits on Jul 28, 2022

  1. Allow to specify extra esp-idf components in manifest metadata

    Makes it possible to specify extra components in the `package.metadata.esp-idf-sys.extra_components`
    array in the root crate's manifest as well as all direct dependencies.
    This change also instructs cmake to build all extra components, but without generating any bindings.
    N3xed committed Jul 28, 2022
    Configuration menu
    Copy the full SHA
    f9edbe5 View commit details
    Browse the repository at this point in the history

Commits on Jul 29, 2022

  1. Get the list of enabled components from cmake

    Because cmake already knows all the compiled components, it is just a matter of forwarding
    that information to the build script. This removes the need to recurse into every subfolder of
    the esp-idf's components folder.
    N3xed committed Jul 29, 2022
    Configuration menu
    Copy the full SHA
    5f73553 View commit details
    Browse the repository at this point in the history
  2. Generate bindings for extra components

    There are two ways the bindings are generated.
    
    The first is when `bindings_module` is not set. In that case the header
    of the extra component will just be added to the normal esp-idf bindings
    generation. All additional bindings will also be in the root of `esp-idf-sys`.
    
    The second: when `bindings_module` is set. For every unique `bindings_module`
    bindgen will be invoked to generate the bindings, which will then be appended as a new
    module to the `bindings.rs` file. Note though that since this is a new bindgen invocation
    duplicate symbols of the normal esp-idf bindings may be generated.
    N3xed committed Jul 29, 2022
    Configuration menu
    Copy the full SHA
    db3254a View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2022

  1. Remove cargo metadata --frozen and --offline flags

    cargo metadata resolves all dependencies even ones that are disabled (known as weak dependencies)
    which cargo build doesn't do (see issue rust-lang/cargo#10801). These unresolved dependencies require
    network access to load their package metadata.
    As the `--frozen` flag itself blocks network access (in addition to blocking changes to the Cargo.lock)
    too, we need to remove both the `--frozen` and `--offline` flags. Doing this allows cargo the change the
    `Cargo.lock` though, which is undesirable (as we're in the process of building the same dependencies that
    rely on the `Cargo.lock` in the first place).
    N3xed committed Jul 31, 2022
    Configuration menu
    Copy the full SHA
    fc81349 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    351beb6 View commit details
    Browse the repository at this point in the history
  3. Require minimum embuild 0.30.2

    N3xed committed Jul 31, 2022
    Configuration menu
    Copy the full SHA
    62c0f1b View commit details
    Browse the repository at this point in the history
  4. Fix clippy warnings

    N3xed committed Jul 31, 2022
    Configuration menu
    Copy the full SHA
    3a13722 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2022

  1. Add documentation in README

    N3xed committed Aug 1, 2022
    Configuration menu
    Copy the full SHA
    8336bcd View commit details
    Browse the repository at this point in the history
  2. Fix typos

    N3xed committed Aug 1, 2022
    Configuration menu
    Copy the full SHA
    27eb477 View commit details
    Browse the repository at this point in the history