cargo-cook icon indicating copy to clipboard operation
cargo-cook copied to clipboard

Per-target cooking?

Open norru opened this issue 5 years ago • 8 comments

Hi,

I just found your cool cargo extension. I want to use it to package distinct distribution files for Windows and Linux.

What is the recommended mechanism to achieve this?

norru avatar Mar 20 '19 11:03 norru

Hi! I was not planning on having providing Windows compatibility because I did not have it installed. However, definitely, such a project, if it has users, should allow working on Windows as well.

Right now I don't have any idea whether it works on Windows or not. If it does not, definitely something should be done to solve this, but simply I can't do it myself as I don't have a Windows PC.

If anyone made a PR bringing Windows support, I would definitely accept it, with pleasure.

P.S. Actually there was an attempt to do this but the contributor did not want to solve a simple problem, and as I can not test it myself but only do a review, I neither closed the PR nor solved the problem myself. So, if you are going to fix problems in this PR and make another one, I will merge it ASAP :)

iddm avatar Mar 20 '19 12:03 iddm

Sorry, I guess I have misunderstood. Do you want to package via cargo-cook for Windows while running it under Linux?

iddm avatar Mar 20 '19 12:03 iddm

Yes.

I am building some software which has to run in Windows and Linux and I need to build two separate packages, one which should run in Windows and one which should run in Linux, in the same build.

I have solved the cross-compiling issues; I can manually generate two separate .zip files. I just want this to be automated.

norru avatar Mar 20 '19 15:03 norru

However, this is no longer urgent as I wrote a custom packager as a simple Rust executable which does exactly this.

norru avatar Mar 20 '19 15:03 norru

Well, I am not sure what the problem exactly you were struggling with. Is it something like making cargo-cook to build not one pack of archives but more than one perhaps for different purposes (like one for Linux, another for Windows, etc)?

iddm avatar Mar 21 '19 16:03 iddm

Yes, and those packages will contain a different set of assets (dll for Windows but not for Linux etc).

Perhaps having Cook.[Windows toolchain].toml and Cook.[Linux toolchain].toml would do?

norru avatar Mar 21 '19 18:03 norru

I think it would be better to specify just different packages. I'll definitely think about this. This sounds a nice idea to me.

iddm avatar Mar 22 '19 12:03 iddm

@norru Hi there! I've just added support for specifying custom recipes. Maybe this can help you:

cargo cook -r CookForLinux.toml
cargo cook -r CookForWindows.toml

iddm avatar Feb 29 '20 17:02 iddm