rust-mobile / xbuild

Cross compile rust to any platform
442 stars 32 forks source link

winget missing packages #129

Open Jasper-Bekkers opened 1 year ago

Jasper-Bekkers commented 1 year ago
dvc94ch commented 1 year ago

can you run x doctor on a clean windows installation? then list all the missing packages and see if you can install them with winget. would be interested to know which packages can't be installed with winget and have an issue to track that. would also be nice to update the readme for other users.

Jasper-Bekkers commented 1 year ago

Hey @dvc94ch I don't quite understand why you changed my issue?

dvc94ch commented 1 year ago

Well, we don't need an issue for every missing package, one to track missing packages is enough

duckinator commented 7 months ago

Due to there being no appropriate flag on the installer, you can't just do winget install LLVM.LLVM and get it in your PATH.

However, until that's resolved: winget install -e -i --id LLVM.LLVM will show the GUI for the installer, which lets you select the option to add it to the PATH.

This gets you all of the LLVM tools.


I have not tested it, but it looks like winget also has Rustlang.Rustup, which (if it works properly) should address the Rust toolchain.

dvc94ch commented 7 months ago

Some docs would be great! I don't have a windows machine and the GitHub ci has chocolatey pre installed. But I know @MarijnS95 had some issues with installing all packages with winget

duckinator commented 7 months ago

It's worth someone trying this in a fresh Windows VM to make sure it actually works, but this may be all you need for Android development using a pure-Rust codebase:

winget install -e -i --id LLVM.LLVM # Make sure to enable the option to add it to your PATH.
winget install Rustlang.Rustup Google.AndroidStudio

I don't see a way to install the iOS tools, mksquashfs, kotlin, or gradle via winget.

Things to be determined:

MarijnS95 commented 7 months ago

@duckinator that's what we have in our own documentation, but having -i in the winget command and requiring developers to manually click the right options in the visual installer is cumbersome.

I've been following https://github.com/microsoft/winget-pkgs/issues/11767 and https://github.com/llvm/llvm-project/issues/54724 for a long time, but nothing appears to be moving :(.

Not that it matters much, xbuild throws a stripped NDK in a user path, which cc-rs' --sysroot fails on when the username includes spaces (https://github.com/rust-mobile/xbuild/issues/124). The only "workaround" I've considered is not stripping clang out of the NDK prebuilts, or perhaps there's a user-writable (not requiring root) path outside of %USERPROFILE% that is known to never have spaces, which xbuild could install to?

Until that's resolved, cargo-apk is still the go-to solution which does not suffer from this issue.

duckinator commented 7 months ago

@MarijnS95 I agree, it's pretty cumbersome and frustrating. I'm just trying to document the state of things in a public spot (to hopefully save other folks the hassle of figuring it out themselves like I did).