-
Notifications
You must be signed in to change notification settings - Fork 26
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
Deterministic GUIDs for cargo-wix init #85
Comments
I wonder if this would be better implemented as CLI options instead of messing with random number generation seeding? Something like:
I do recognize that it is not very user friendly to have to type the GUID on the command-line, but I am imagine the desire for deterministic GUIDs is for automated deployment/build reasons. These options could be added to the build configuration. Additionally, if I ever get #20 completed, then these GUIDs could be added there as well and not have to be typed out each time. This would enable a secondary flag that would delete the WXS after build. A sort of variant of your single Can you just add the WXS file to the vcs ignore list? What about putting the WXS file in a hidden folder or somewhere outside of the project's version control root? I would also mention that according to the WiX Toolset developers, it is best practice to include the WXS file in the project's version control and keep along with the source code. They consider it source code. |
OK, this would work for my scenario.
That won't work if/when #78 is implemented.
No.
Thanks to cargo-wix, we can (almost) consider WXS as an intermediate build artifact. Actually, I see contradicting signals here:
|
The binary GUID is for the An explicit GUID is not needed for the binaries. The default template does not currently account for explicitly providing a GUID for the binary (exe) components. Is there is a situtation where they need to be explicit? If so, then another flag should be added to the
These were some initial thoughts and ideas before coffee, so I am not surprised they were not fully coherent or consistent.
Yes, I envision the As you mention, the product GUID is a configuration and should not change. So, ayny command-line option for it would be associated with the
Yes, since the potential
Can you elaborate a little more on the desire, or use-case, of wanting to eliminate the WXS file as a source file? Additional thoughts (ramblings?): Seeding the RNG with the crate name is an elegant solution but wouldn't this increase the likelihood of generating a collision since multiple applications of the same name, inside or outside the Rust and crates.io ecosystem, are possible? Granted, it is still unlikely, but increasing the likelihood of collisions is kind of bad, right? Maybe seeding it with the authors (vendor) and crate/product/project name? This would alleviate the need for relying on crates.io to ensure crate/application/product name uniqueness. Is playing with the seeding overly complicating things? I did some (very brief) investigation, and the IETF RFC for UUIDs allows for an "Algorithm for Creating a Name-Based UUID" (Section 4.3). Could the crate/project/package/product name be the name and the authors (vendor) be the namespace? The uuid crate supports both v3 and v5 UUIDs that can be used for this scheme. At the very least, I would want this to be behind a CLI flag of some kind for the Yet another thought: the flag could be an option instead, where the value is the name and namespace that is passed to the UUID generator. Something like |
Yes, you're absolutely right.
All data that I do understand that more complex apps will require custom WXS, so it is good that you separated I thought once again and think there is another route: more dynamic things could be proxied via WIX variables to WXS, like you're currently doing with Anyway, possibly I am being too much a perfectionist here and current cargo-wix behavior is Good Enough. And seems like you're right, seeding from project data GUIDs is not so trivial and can cause issues, so command-line switch to pass them from outside is a better way to go. Though, again, if |
My 10y+ programming experience tells me that any system that involves GUIDs stored in files sooner or later hits problems caused by users copying those files all over around and eventually forgetting to change GUID after copying :) Okay, let's forget that seeding idea and instead go |
For the history: #50 also doesn't want to store WXS in VCS but instead produce MSI from Cargo.toml in one go. |
I agree, let's add some mechanism for a combined create-init command to the CLI. Should we rename this issue or create a separate one to track this feature, maybe something like "Ephemeral Builds"? I have been thinking about the implementation of this feature and would appreciate some comments on the following:
Some additional comments and background:
Having to update the same information in multiple places ultimately leads to chaos. I think the variability of the contents of the Cargo.toml file and use of a concrete WXS file is related to the timing of the project's development process and introduction of an installer. Do you want, or need, an installer during the early stages of project development when configurations, names, etc. are highly instable (changing frequently), or is an installer only needed in later, stable stages of project development? There is no right or wrong answer to this question, but currently The subcommand came about from another project where I needed to create a Windows installer for an existing, stable project and I had several other cargo-related, stable projects that would benefit from Windows installers. I was copying-n-pasting the same WXS file over-and-over and making small modifications to the product name, upgrade code, etc. which we all agree is a source of pain and headaches. So, |
I have created a new issue for artifact-free builds (#88). Please continue discussion there as I feel this issue can be closed. |
Currently,
cargo-wix init
produces new random GUIDs each time it is run: for product and for binary.Instead, I suggest seeding RNG that is used to generate UUIDs with crate name for product UUID and with crate name + binary name for per-binary UUID. That would allow simple applications to completely avoid storing
wxs
file in repository and instead directly runcargo wix init && cargo wix
in one go (this could possibly later be made a single command).The text was updated successfully, but these errors were encountered: