Skip to content

build-support/rust: support default_features in cargo manifest#417808

Merged
andresilva merged 1 commit intoNixOS:stagingfrom
andresilva:andre/rust-support-default_features
Jul 10, 2025
Merged

build-support/rust: support default_features in cargo manifest#417808
andresilva merged 1 commit intoNixOS:stagingfrom
andresilva:andre/rust-support-default_features

Conversation

@andresilva
Copy link
Member

@andresilva andresilva commented Jun 18, 2025

https://github.com/rust-lang/cargo/blob/master/crates/cargo-util-schemas/src/manifest/mod.rs#L706
https://github.com/rust-lang/cargo/blob/master/crates/cargo-util-schemas/src/manifest/mod.rs#L719-L721
https://github.com/rust-lang/cargo/blob/master/crates/cargo-util-schemas/manifest.schema.json#L807

default_features is still supported by Cargo even though it's "soft" deprecated. Cargo handles both keys the same way as implemented in this PR, i.e. try default-features first and fallback to default_features.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

@nix-owners nix-owners bot requested review from figsoda, winterqt and zowoq June 18, 2025 11:34
@andresilva
Copy link
Member Author

andresilva commented Jun 18, 2025

I encountered this issue while trying to build a rust package (some transitive dependency used default_features), this patch fixed it.

@github-actions github-actions bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. labels Jun 18, 2025
@andresilva andresilva changed the base branch from master to staging June 18, 2025 13:56
@nixpkgs-ci nixpkgs-ci bot closed this Jun 18, 2025
@nixpkgs-ci nixpkgs-ci bot reopened this Jun 18, 2025
@andresilva
Copy link
Member Author

Would appreciate a review on this.

@andresilva andresilva merged commit 2361191 into NixOS:staging Jul 10, 2025
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant