killercup / killercup/cargo-edit

Idea: cargo edit lib

Open
#250 0 comments 0 reactions 0 assignees View on GitHub
help wanted new command
Dominant language
Rust
Stars
3.5k
Forks
166
PR merge metrics
No merged PRs in 30d

Description

Hi there!

First of all: Thanks for the project. It is great!

I've been working on [crossgen](https://github.com/yoshuawuyts/crossgen) to get support to build cross platform libs using Travis and Appveyor.

Sadly, I've come to face an [issue with cargo](https://github.com/rust-lang/cargo/issues/6160) where it is not possible to override the lib type through the command line.

One of the ideas I had was to be able to execute `cargo edit lib --crate-type=staticlib` and let it modify the manifest right before building. This would be added to the scripts, and would allow specifying only a single type of crate per target, without producing the `rlib` artifacts as well.

This would be very useful for C libs, but also WASM, as it needs to output a small library and it can't have the optimizations passed in if the manifest still have the `lib.crate-type` not overriden. ([See](https://github.com/rust-lang/rust/issues/51009))

What would you think of having this on `cargo-edit`? Or would you rather have this as a separate project?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the cargo-edit CLI entry point for the proposed `cargo edit lib` command and how it currently handles Cargo manifests. Clarify whether the change belongs in cargo-edit or a separate project, then define the manifest update and build behavior needed for static libraries and WASM before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
build-system, cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.