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

Add unstable --print-command-list flag #175

Merged
merged 1 commit into from
Feb 28, 2023
Merged

Add unstable --print-command-list flag #175

merged 1 commit into from
Feb 28, 2023

Conversation

taiki-e
Copy link
Owner

@taiki-e taiki-e commented Dec 3, 2022

Closes #172

 --print-command-list
    Print commands without run (Unstable).
$ cargo hack check --each-feature --include-deps-features --print-command-list
cargo check --manifest-path Cargo.toml --no-default-features
cargo check --manifest-path Cargo.toml --no-default-features --features anyhow/backtrace
cargo check --manifest-path Cargo.toml --no-default-features --features anyhow/default
cargo check --manifest-path Cargo.toml --no-default-features --features anyhow/std
cargo check --manifest-path Cargo.toml --no-default-features --features ctrlc/termination
cargo check --manifest-path Cargo.toml --no-default-features --features indexmap/arbitrary
cargo check --manifest-path Cargo.toml --no-default-features --features indexmap/quickcheck
cargo check --manifest-path Cargo.toml --no-default-features --features indexmap/rayon
cargo check --manifest-path Cargo.toml --no-default-features --features indexmap/rustc-rayon
cargo check --manifest-path Cargo.toml --no-default-features --features indexmap/serde
cargo check --manifest-path Cargo.toml --no-default-features --features indexmap/serde-1
cargo check --manifest-path Cargo.toml --no-default-features --features indexmap/std
cargo check --manifest-path Cargo.toml --no-default-features --features indexmap/test_debug
cargo check --manifest-path Cargo.toml --no-default-features --features indexmap/test_low_transition_point
cargo check --manifest-path Cargo.toml --no-default-features --features libc/align
cargo check --manifest-path Cargo.toml --no-default-features --features libc/const-extern-fn
cargo check --manifest-path Cargo.toml --no-default-features --features libc/default
cargo check --manifest-path Cargo.toml --no-default-features --features libc/extra_traits
cargo check --manifest-path Cargo.toml --no-default-features --features libc/rustc-dep-of-std
cargo check --manifest-path Cargo.toml --no-default-features --features libc/rustc-std-workspace-core
cargo check --manifest-path Cargo.toml --no-default-features --features libc/std
cargo check --manifest-path Cargo.toml --no-default-features --features libc/use_std
cargo check --manifest-path Cargo.toml --no-default-features --features serde_json/alloc
cargo check --manifest-path Cargo.toml --no-default-features --features serde_json/arbitrary_precision
cargo check --manifest-path Cargo.toml --no-default-features --features serde_json/default
cargo check --manifest-path Cargo.toml --no-default-features --features serde_json/float_roundtrip
cargo check --manifest-path Cargo.toml --no-default-features --features serde_json/indexmap
cargo check --manifest-path Cargo.toml --no-default-features --features serde_json/preserve_order
cargo check --manifest-path Cargo.toml --no-default-features --features serde_json/raw_value
cargo check --manifest-path Cargo.toml --no-default-features --features serde_json/std
cargo check --manifest-path Cargo.toml --no-default-features --features serde_json/unbounded_depth
cargo check --manifest-path Cargo.toml --no-default-features --features slab/default
cargo check --manifest-path Cargo.toml --no-default-features --features slab/serde
cargo check --manifest-path Cargo.toml --no-default-features --features slab/std
cargo check --manifest-path Cargo.toml --no-default-features --features toml_edit/default
cargo check --manifest-path Cargo.toml --no-default-features --features toml_edit/easy
cargo check --manifest-path Cargo.toml --no-default-features --features toml_edit/perf
cargo check --manifest-path Cargo.toml --no-default-features --features toml_edit/serde

@leighmcculloch
Copy link

leighmcculloch commented Dec 4, 2022

I think the output looks great 👏🏻. I'm going to try using it in a GitHub Action's build and will report back how it goes.

@leighmcculloch
Copy link

@taiki-e Thoughts on including this in a release?

@taiki-e
Copy link
Owner Author

taiki-e commented Feb 28, 2023

I think the +<toolchain> in the output should be removed as it limits the reusability of the output, but once that is done, I think we can merge this

@taiki-e
Copy link
Owner Author

taiki-e commented Feb 28, 2023

bors r+

@bors
Copy link
Contributor

bors bot commented Feb 28, 2023

Build succeeded:

@bors bors bot merged commit 1b8fb77 into main Feb 28, 2023
@bors bors bot deleted the print-command-list branch February 28, 2023 16:24
@leighmcculloch
Copy link

leighmcculloch commented Feb 28, 2023

I think the +<toolchain> in the output should be removed as it limits the reusability of the output,

Maybe whether it is provided in the output or not should be based on if it is explicitly set in the input command?

That way if a user specifies it, it is retained.

@taiki-e
Copy link
Owner Author

taiki-e commented Feb 28, 2023

Maybe whether it is provided in the output or not should be based on if it is explicitly set in the input command?

Old version of this PR just displayed the toolchain currently in use. +<toolchain> specified by the user precedes the subcommand, and cargo passes the corresponding cargo for that toolchain as a CARGO environment variable to the subcommand. So, it is not always easy to determine if +<toolchain> was specified by the user.

@taiki-e
Copy link
Owner Author

taiki-e commented Feb 28, 2023

Published in 0.5.28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow outputting the commands that will be run without running them
2 participants