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

Display build-dependencies on crate page #1641

Closed
olson-dan opened this issue Feb 28, 2019 · 4 comments · Fixed by #1949
Closed

Display build-dependencies on crate page #1641

olson-dan opened this issue Feb 28, 2019 · 4 comments · Fixed by #1949

Comments

@olson-dan
Copy link

I noticed that dependencies and dev dependencies are currently listed on individual crate pages, but build dependencies are not.

Cargo's build-dependencies often pull in external programs or libraries (gcc, cmake, pkg-config, libclang) and these programs are often missing on the machines of users attempting to build the crates.

It'd be helpful to list the build dependencies for each crate so that users have an idea of what 3rd party software must be installed to use it. This could also help people vet crates for security purposes, as build.rs is not sandboxed in any way as far as I am aware.

@critical-path
Copy link

May I try to address this issue? Thank you!

@carols10cents
Copy link
Member

So I was just looking into this more, and looking at the PR #1761 that was closed (sorry for the delay on reviewing!)

It turns out build dependencies are currently being displayed; they're listed as regular dependencies though, rather than being split out into their own category.

For example, https://crates.io/crates/lapin currently has listed:

Dependencies

    amq-protocol ^3.0
    amq-protocol-codegen ^3.0
    crossbeam-channel ^0.3
    log ^0.4
    mio ^0.6
    parking_lot ^0.9
    serde_json ^1.0
    futures-core-preview = 0.3.0-alpha.19 optional

Dev-Dependencies

    env_logger ^0.7
    futures-executor-preview ^0.3.0-alpha.19
    futures-util-preview ^0.3.0-alpha.19
    tcp-stream ^0.7

But looking at the JSON returned from the API, amq-protocol is a normal dependency and amq-protocol-codegen is a build dependency, for example.

So the code in #1761 needs to exclude build dependencies from the regular dependency display as well as adding the new build dependency section, and the test should assert that the build dependency only appears under the appropriate section.

@Mordorreal
Copy link

Can I try to fix this?

@smarnach
Copy link
Contributor

@Mordorreal Sure, feel free to go ahead! You can ask questions here, or you can send a PR.

bors added a commit that referenced this issue Dec 13, 2019
…encies, r=carols10cents

Filter crate dependencies by kind properly

Add strict filtering by 'kind' field for crates.
Add separate section for Build dependencies.
Refactor crate deps filter functions.
Add tests for filters.

Fixes: #1641
@bors bors closed this as completed in acb62ac Dec 13, 2019
@Turbo87 Turbo87 removed the A-ui label Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants