Hello,

I have a project for which some machines have only a subset of features set. Currently, I write

cargo run --no-default-features --features "toto,titi" --bin my_bin

This is a bit cumbersome and I sometimes forget the --no-default-features --features part. I was wondering if there is a local config file that I could put in the directory to instruct cargo to use this particular subset of features. I guess this should be in the documentation, but I didn’t find it.

You are viewing a single thread.
View all comments View context
3 points
*

Yeah, a simple bash script should do. Such as:

#!/usr/bin/env bash

BUILD_FEATURES=${BUILD_FEATURES:=default}

cargo run --no-default-features --features "${BUILD_FEATURES}" --bin my_bin

Then just set a BUILD_FEATURES env var.

permalink
report
parent
reply

Rust

!rust@programming.dev

Create post

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits
  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

Community stats

  • 504

    Monthly active users

  • 890

    Posts

  • 3.9K

    Comments