-
Notifications
You must be signed in to change notification settings - Fork 27
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
Multi-crate workspace projects support #74
Comments
I ended up with My layout is the following: /core
/core/Cargo.toml
/core/src/lib.rs
/binary1
/binary1/Cargo.toml
/binary1/src/main.rs
/binary2
/binary2/Cargo.toml
/binary2/src/main.rs
/wix
/win/main.wxs My end goal is to build a single installer containing both |
Looks like #20 may help if it's implemented in a way that doesn't depend on |
Supporting multi-crate workspace project has never occurred to me! Thanks for the feature request and making me aware.
It makes me happy to hear that the focus on flexibility for this sub-command to capture as many use-cases as possible has worked out, even for a use case I completely missed.
This should be achievable with editing the
Hmm, without #20, this does look to be an issue. Maybe if you are using
I would like to add better support for workspace projects to this subcommand. My initial concern is having to loop through all members in the workspace, determine which members are binaries as opposed to libraries, and then add each binary to the components and feature list for the installer within the WXS file, which would requiring editing the built-in template. This is all relatively straight-forward programming and would be super slick, but how often would this feature be needed? As you mention, it only took a minute or two to modify the WXS file to your specific needs. What is the majority work-flow, desired installer for workspace-based projects? This is my initial thought on the installation layout for a workspace-based project:
My initial thought on this: #20 would not depend on the existence of the Interestingly, I just found this information in the Cargo book:
This seems to indicate that the root I created a temporary workspace project to play with this a little. The following project layout was used:
The contents of the workspace [workspace]
members = [
"binary1",
"binary2",
"core"
]
[package]
name = "my_workspace_project"
authors = ["Workspace Author <author@example.com>"]
version = "0.0.1"
[lib]
path = "core/src/lib.rs" A Then I did a
The linker (light.exe) could not find the I ran the installer. The following installation layout was created:
and the In summary, I think you can add a |
Nice! Here's my project, as an additional data for this issue: https://github.com/MOZGIII/rebootinto I see the point about the virtual and non-virtual workspaces, though I'd like to have proper support for virtual manifests too - mainly because I don't like to have a package at the top level, because it doesn't have a purpose other that holding the installer data. That said, I'll try adding the I would also consider building multiple installers - one per each workspace project. In fact, I think it makes even more sense for my project than packaging everything in all-in-one installer... |
Thank you for sharing your project. It will be useful as a template to implement better support for workspace projects.
I agree with not liking the Interestingly, as an experiment, I changed the [workspace]
members = [
"binary1",
"binary2",
"core"
]
name = "my_workspace_project"
authors = ["Workspace Author <author@example.com>"]
version = "0.0.1" I was able to build the workspace, but I received the following warnings:
So, we can add other keys to the
This all depends on how you envision your distribution of your project. A workspace is a grouping of libraries and binaries that have some build dependence on each other. It is supposed to make organizing and developing multiple, related project easier. I foresee two scenarios for installers from workspace projects:
There are, of course, a plethora of alternatives. For example, you could create individual installers for each binary, and then create an installer of installers. This is supported with WiX but not currently supported, nor do I expect it in the future, for this subcommand. I will have to think about this some more for adding workspace project support. Some questions to think about:
|
This missing feature currently really complicates my CI setup :/ |
I still do not have a clear picture of how to implement workspace support given the above discussion, questions, and variety of project layouts. After reviewing some discussion on workspaces for the cargo-deb project, I am not even sure any new enhancement/feature is even needed. cargo-deb will not be implementing one deb for multiple packages (projects within workspaces):
However, they did add the I would like to callout and mention @notriddle's comment in the cargo-deb discussion on workspaces, where they are using both cargo-deb and cargo-wix for the same workspace project. I would be curious to hear more about their project organization and how that all works. Would it be possible for you (@Songtronix) to elaborate a little more on your project layout, your expectation for support for workspaces, and why cargo-wix currently complicates your CI setup? I believe a combination of modifying the WXS file and the "recently" implemented and released #20 feature in v0.2 maybe enough to un-complicate your CI setup and generally support workspaces. |
Well I could in theory switch from (Github actions): - name: Build
run: cargo build --bin airshipper --release
- name: MSI Installer
run: cargo wix --no-build --nocapture -n client --install-version ${{ steps.vars.outputs.version }}
- name: proper naming
run: |
ren target/wix/client-${{ steps.vars.outputs.version }}-x86_64.msi airshipper-${{ steps.vars.outputs.version }}-x86_64.msi
# Upload artifact
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: airshipper-windows-installer
path: target/wix/airshipper-${{ steps.vars.outputs.version }}-x86_64.msi To (with the -p option): - name: MSI Installer
run: cargo wix --nocapture -p client
# Upload artifact
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: airshipper-windows-installer
path: target/wix/airshipper-${{ steps.vars.outputs.version }}-x86_64.msi As you see, to avoid that the server gets compiled, I do a cargo build first then invoke cargo wix to generate the msi. However the msi will be named |
Hmm, I looked at your airshipper project. Is it possible to move the I am missing why you need to pass the install version. Is the client a different version than the workspace and server package? |
I have to pass the version otherwise the command does not work at all:
I've tested moving the wix folder into client and it looks like this works perfectly and removes the renaming bit and explicitly stating the version, thanks! |
@Songtronix Great! I am glad this worked for you. So, I am going to assume that moving the wix folder into the client folder means that for your workspace layout, you do not actually need the This would indicate to me that there is already some workspace-related support in Really only workspace support is needed if you want a single installer for all of the packages in a workspace, but I think this already works as well because if you did not need to exclude the server package from the installer, I think everything would have worked. The |
One annoyance is that the target directory will be in client now which effectively removes my caching completely and now I need to symlink or such which is the same level of annoyance as renaming the msi file. EDIT: I now know what the issue was for why I was going the way I did all along: I'm really confused as to why it worked fine when I've tested it... |
Would a combination of the
This would use the v0.2
Please note the requirement for a trailing forward/backward slash to output to a folder and keep the default naming, which includes the version number from the client's Given this, a |
Ah, This data point indicates that the eventual |
Workspace support might be supported with the new implementation that resolves #70 as of 4cf7cc0. A path to the client's Cargo.toml file could be used and the installer should be created relative to the client's manifest as opposed to the virtual manifest. This should eliminate all of the workarounds (renaming) in combination with the defining a I would be curious to know if the resolution of #70 does work for you (@Songtronix). |
Running |
@Songtronix, that is good hear! Given this result, do you believe a |
Hmm in my usecase it won't be needed. Furthermore can't think of any other usecase which couldn't be satisified with However I've not tested one thing: Does in theory |
It should only build the client package, not the entire workspace, but I also admit I have not fully tested this. |
Workspaces can now have metadata: rust-lang/cargo#8309. This is already supported by cargo-metadata too! This is a really new feature, so we might want to wait for a stable cargo version to support it. Once it is supported, it removes the only real roadblock I had towards supporting this feature! |
any update on this? cargo wix init -p e2ee-cli
cargo wix -p e2ee-cli I still got error: error LGHT0103 : The system cannot find the file 'wix\License.rtf'. |
I'm trying to use cargo-wix in a multi-crate workspace, and it doesn't work.
The error is on point, since the
Cargo.toml
manifest only contains the workspace definition, and doesn't have a particular crate name.The text was updated successfully, but these errors were encountered: