Skip to content
This repository was archived by the owner on Sep 28, 2022. It is now read-only.
This repository was archived by the owner on Sep 28, 2022. It is now read-only.

explain only shows one feature set for target and one for host, so why is the crate in the workspace hack crate? #526

Description

@carols10cents

I'm using cargo-hakari 0.9.10, with the new explain feature (🎉 ), but I'm still confused about why the regex-syntax crate is in my project's workspace hack crate generated by cargo-hakari, and explain isn't helping (or I don't understand what it's telling me).

I've put a small-ish reproduction of this on this branch in this repo: https://github.com/integer32llc/hakari-repro/tree/regex-syntax

Crate "hello" has a dependency on croaring, which has bindgen as a build dependency, which has regex as a dependency in two places, and each place has regex-syntax as a dependency.

Relevant part of `cargo tree --no-dedupe` output
hello v0.1.0 (/Users/carolnichols/rust/hakari-repro/hello)
├── croaring v0.5.1
│   ├── croaring-sys v0.5.1
│   │   [build-dependencies]
│   │   ├── bindgen v0.59.2
│   │   │   ├── env_logger v0.9.0
│   │   │   │   ├── regex v1.5.4
│   │   │   │   │   └── regex-syntax v0.6.25
│   │   │   ├── regex v1.5.4
│   │   │   │   └── regex-syntax v0.6.25

Crate "world" has a dependency on regex-automata, which has regex-syntax as a dependency.

Relevant part of `cargo tree --no-dedupe` output
world v0.1.0 (/Users/carolnichols/rust/hakari-repro/world)
├── regex-automata v0.1.10
│   └── regex-syntax v0.6.25

cargo hakari generate has put regex-syntax in the workspace-hack crate under both regular and build dependencies:

[dependencies]
regex-syntax = { version = "0.6", features = ["unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }

[build-dependencies]
regex-syntax = { version = "0.6", features = ["unicode", "unicode-age", "unicode-bool", "unicode-case", "unicode-gencat", "unicode-perl", "unicode-script", "unicode-segment"] }

When I run cargo hakari explain regex-syntax, I get this output:

info:
  package  |  include dev?  features  platform

on the target platform, feature set default, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment was built by:

   world   |       *           *         *

on the host platform, feature set unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment was built by:

   hello   |       *           *         *

Based on the crate listings, I assume the "on the target platform" section is talking about the regular dependency and "on the host platform" is talking about the build dependency.

Based on my understanding of cargo-hakari, I expected at least 2 different feature sets to appear here for both the target section and the host section-- but there's only one set of features.

So I still don't know why cargo-hakari has put regex-syntax into the workspace hack crate, and cargo hakari explain isn't telling me in a way I can understand :)

I very much appreciate your help, thank you!!!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions