volks73 / cargo-wix

A cargo subcommand to build Windows installers for rust projects using the WiX Toolset
https://volks73.github.io/cargo-wix
Apache License 2.0
306 stars 25 forks source link

cargo wix clean on 0.3.5 broken? #218

Closed bryanlarsen closed 1 year ago

bryanlarsen commented 1 year ago
thread 'main' panicked at 'Mismatch between definition and access of `verbose`. Unknown argument or group id.  Make sure you are using the argument id and not the short or long flags
', C:\Users\bryan\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cargo-wix-0.3.5\src\main.rs:1794:6
bryanlarsen commented 1 year ago

Given how new cargo-wix 3.5 is I thought a quick report would be useful. I'll keep digging and add details.

My command line:

 cargo wix -p bowtie_node -o "..\..\target\wix\bowtie.msi" -C "-dConfExists=no"  -C "-dConfName=" -C "-dGitVersion=${git_version}"  -C "-dBundleVariant=yes" --no-build --nocapture --install-version $install_version
Gankra commented 1 year ago

oof, the update to clap 4 subtly broke a bunch of flags at runtime only, I missed this one 😿

volks73 commented 1 year ago

@Gankra Can you please take a look at this? I have not had a chance to look at clap v4 in any depth.

bryanlarsen commented 1 year ago

Yes, it smelled like something very general where tons of detail on my particular environment wasn't particularly helpful. If that's not the case let me know and I'll send more info.

Gankra commented 1 year ago

Yep, i'll look into this asap (not sure what's breaking here yet...)

Gankra commented 1 year ago

@bryanlarsen can you confirm that the CLI invocation you shared does not in fact set --verbose (or -v)? (Very confused why verbose is being mentioned at all)

Gankra commented 1 year ago

Also could you provide the values of git_version and install_version? I'm wondering if one of those is expanding weird.

Gankra commented 1 year ago

This pair of commands seems to work fine on cargo wix 0.3.5, running in the root of cargo-wix itself:

cargo wix init -p cargo-wix

cargo wix -p cargo-wix -o "target\wix\bowtie.msi" -C "-dConfExists=no"  -C "-dConfName=" -C "-dGitVersion=1.2.3"  -C "-dBundleVariant=yes" --nocapture --install-version 1.2.3 

Adding --verbose or -v or -vvv seems to also work fine.

volks73 commented 1 year ago

Also could you provide the values of git_version and install_version? I'm wondering if one of those is expanding weird.

I am guessing, $git_version or $install_version has a v in it, like v0.3.5 and a - is being prepended to make it appear a -v flag or something.

Gankra commented 1 year ago

Just tossing out more things worth debugging with: what does cargo -Vv print for you? (We just bumped our msrv by a lot)

bryanlarsen commented 1 year ago

I'm sorry, the line that was crashing for me was cargo wix clean.

cargo 1.70.0 (ec8a8a0ca 2023-04-25) release: 1.70.0 commit-hash: ec8a8a0cabb0e0cadef58902470f6c7ee7868bdc commit-date: 2023-04-25 host: x86_64-pc-windows-msvc libgit2: 1.6.3 (sys:0.17.0 vendored) libcurl: 8.0.1-DEV (sys:0.4.61+curl-8.0.1 vendored ssl:Schannel) os: Windows 10.0.22621 (Windows 10 Pro) [64-bit]

bryanlarsen commented 1 year ago

Removing cargo wix clean from my build script enabled the script to succeed.

Gankra commented 1 year ago

Aha, perfect I can definitely reproduce that one!