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 -B,--build-arg option for the cargo build stage of the default subcommand #177

Open
elpiel opened this issue Jan 9, 2023 · 5 comments

Comments

@elpiel
Copy link
Contributor

elpiel commented Jan 9, 2023

With cargo-deb you have the ability to set specific features that you want to use when building the package.
It would be great to include such ability in cargo-wix as now you have to build manually with the given feature(s) and run cargo-wix with --no-build.

Our use case is that we distinguish between installed app and running with cargo run because of some binaries locations.

@volks73
Copy link
Owner

volks73 commented Jan 9, 2023

My understanding was the features feature of cargo-deb was for defining a set of properties/flags/arguments like Profiles, but there are the -C and -L options that pass arguments to the candle.exe and light.exe applications for building the installer. To clarify, you would like something similar, like -B, to pass arguments to cargo for the cargo build "stage" of the cargo wix default subcommand?

To note, the -B option is already used for the init and print subcommands but not the cargo wix default command. I could see adding the -B,--build-arg option. Again, assuming this is what you are requesting.

@elpiel
Copy link
Contributor Author

elpiel commented Jan 10, 2023

yes, build arguments (cli) or features (config) to build the binaries with.
For the config, I really like the simple cargo-deb approach of specifying the features with a key.

For the CLI --build-args seems reasonable. cargo-deb uses --cargo-build but that overrides the whole cargo command, i.e. if you want to build with features (and I have to verify, though, if -- --features=... is actually used by cargo build):

cargo deb --cargo-build build -- --features=bundled

@volks73
Copy link
Owner

volks73 commented Jan 10, 2023

Got it. I see cargo deb uses the -- syntax for passing additional arguments to the cargo build command. This appears to be the convention for various cargo subcommands that pass additional arguments to the underlying binary, such as passing arguments to rustc.

While this is the convention and I like to follow conventions as much as possible, I am leaning towards the -B,--build-arg option to be consistent with the -C and -L options. There are three binaries at work with the default cargo wix subcommand: (1) cargo build, (2) candle.exe, and (3) light.exe. I believe the cargo convention of using -- to pass additional arguments works well because there is only one underlying binary per subcommand/action. With three, it could be a little confusing and then having it work just for the cargo build binary but needing to use options for the Candle and Light binaries would be inconsistent and an exception that needed to be documented and heavily noted. A -B option is feels cleaner and more consistent at the moment.

@volks73 volks73 changed the title Enable build features in cargo WiX config Added -B,--build-arg option for the cargo build stage of the default subcommand Jan 10, 2023
@volks73 volks73 changed the title Added -B,--build-arg option for the cargo build stage of the default subcommand Add -B,--build-arg option for the cargo build stage of the default subcommand Jan 10, 2023
@volks73
Copy link
Owner

volks73 commented Jan 10, 2023

I have renamed the issue to be more descriptive and focused to the requested enhancement. I would also greatly appreciate and welcome any PR that implements this enhancement.

@volks73
Copy link
Owner

volks73 commented Sep 6, 2023

@elpiel While the -B,--build-arg has not been added to the CLI, does #198 work for the configuration aspect?

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

No branches or pull requests

2 participants