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 verbose flag to print cargo commands #42

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

ian-h-chamberlain
Copy link
Member

I often find myself wanting to reproduce the same command that cargo-3ds was running, so I thought it would be handy to print these commands out when a flag is passed in.

The output looks like this, with the intention that it can be copy-pasted back into the shell easily to run the same command:

$ cargo 3ds -v test
No pre-build std found, using build-std
Running command:
   RUSTDOCFLAGS=" --no-run --persist-doctests target/doctests" \
   RUSTFLAGS=" -L/opt/devkitpro/libctru/lib -lctru" \
   /Users/ianchamberlain/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/cargo test --target armv6k-nintendo-3ds --message-format json-render-diagnostics -Z build-std --no-run

    Finished test [unoptimized + debuginfo] target(s) in 0.26s
Getting metadata
Building smdh:/Users/ianchamberlain/Documents/Development/3ds/test-runner-3ds/target/armv6k-nintendo-3ds/debug/deps/integration-86fc0175e918598b.smdh
Running command:
   smdhtool --create integration "Homebrew Application" "Unspecified Author" /opt/devkitpro/libctru/default_icon.png /Users/ianchamberlain/Documents/Development/3ds/test-runner-3ds/target/armv6k-nintendo-3ds/debug/deps/integration-86fc0175e918598b.smdh

Building 3dsx: /Users/ianchamberlain/Documents/Development/3ds/test-runner-3ds/target/armv6k-nintendo-3ds/debug/deps/integration-86fc0175e918598b.3dsx
Running command:
   3dsxtool /Users/ianchamberlain/Documents/Development/3ds/test-runner-3ds/target/armv6k-nintendo-3ds/debug/deps/integration-86fc0175e918598b.elf /Users/ianchamberlain/Documents/Development/3ds/test-runner-3ds/target/armv6k-nintendo-3ds/debug/deps/integration-86fc0175e918598b.3dsx "--smdh=/Users/ianchamberlain/Documents/Development/3ds/test-runner-3ds/target/armv6k-nintendo-3ds/debug/deps/integration-86fc0175e918598b.smdh"

Running 3dslink
Running command:
   3dslink /Users/ianchamberlain/Documents/Development/3ds/test-runner-3ds/target/armv6k-nintendo-3ds/debug/deps/integration-86fc0175e918598b.3dsx

No response from 3DS!

Also fix minor issue with building test crate for doctests.

Also fix minor issue with building test crate for doctests.
@Meziu
Copy link
Member

Meziu commented Aug 6, 2023

This is a very welcome addition, especially since cargo-3ds presents a film of obscurity between the user and the commands actually run (maybe we should do something about documenting how cargo-3ds interacts with the environment).

Just a thing: even though I think that it'd be almost impossible to move away from 3dslink (especially for how it interacts with the Homebrew Menu), I would still like to work on #2. What do you think about moving away from console commands and actually re-implement some features?

Basically, ensure we follow `should_build_3dsx` all the way through into
the callbacks.
@ian-h-chamberlain
Copy link
Member Author

ian-h-chamberlain commented Aug 6, 2023

Just a thing: even though I think that it'd be almost impossible to move away from 3dslink (especially for how it interacts with the Homebrew Menu), I would still like to work on #2. What do you think about moving away from console commands and actually re-implement some features?

Sure, I don't think it's a bad idea, if you want to. I personally wouldn't consider it a priority, since users will always have to have the toolchain installed anyway, so we should always be able to rely on the existence of those tools. Having more stuff in Rust (and library-usable) is always nice though!

One thing we could do is find the tools' full path using $DEVKITARM/tools/bin/$tool, instead of just relying on $PATH to be set correctly. That would be a much easier change and probably more reliable, in case people don't add that directory to their PATH.

@ian-h-chamberlain
Copy link
Member Author

Going to go ahead and merge this, it fixes some issues with building doctests and doesn't seem too controversial.

@ian-h-chamberlain ian-h-chamberlain merged commit cda49e0 into master Aug 16, 2023
3 checks passed
@ian-h-chamberlain ian-h-chamberlain deleted the feature/verbose-flag branch August 16, 2023 17:39
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.

2 participants