For Windows you can install the MinGW toolchain on your Linux system and then compile for the x86_64-pc-windows-gnu target. You likely only need to set the mingw linker as linker to be used by rustc. As for macOS I don't think you can cross-compile to it. You need the macOS import libraries (.tbd) one way or another and I am not sure if you are allowed to use those on non-macOS systems.
For that I'll have to upload the binaries, is it not possible to have a build script (via GitHub actions or something) that the user can trigger to download the binaries that corresponds to their OS
This seems very promising and close to what I'm looking for, just to be sure, I can do something like curl --location https://github.com/Coding-Badly/rusty-tools/releases/download/current...
and I'll have the binary file built, downloaded and installed, right?
That configuration builds on all git push. The artifacts end up on the releases page. The curl command just downloads an artifact from the releases page.
A better approach is to build on merge-to-main or on push-tag. That gives better control over what is built and when.
I went with build-on-push as a matter of expediency. If the project becomes "sticky" I'll change it to something else.
Ooh. I think I crossed paths with a GitHub Actions bug. It's actually configured to build on push-to-master. It was configured to build on push-to-master. There is no master branch. And it builds on all pushes.
The install is by-hand. You'll have to copy the binary to a location on the PATH, modify the PATH, or run it from the current working directory. The latter is the example in that version of the README file.
There is always the "script" option.
You could maybe make a polyglot script that.
1 calls rustup.rs to install toolchain.
2 curls your sources.
3 from inside your source dir run "cargo install --path ."
4 call rustup to remove toolchain, but make sure not to delete the path to your installed binary.
Silly, yes.
But will, I believe get around "signatures" and app permissions type stuff. Mac os libraries, etc.
Not really. I use GitHub's documentation, Stack Overflow, Stack Exchange, Reddit, via Google Search to find what I need. I've not found a one-stop guide.
If you have specific questions I may be able to help.
is an example of a polyglot rustc and bash file. When executed as bash script it compiles itself using an existing rustc installation and then runs the compiled executable.