Skip to content

Don't create .msi installer when not building from Windows #141818

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mati865
Copy link
Member

@mati865 mati865 commented May 31, 2025

WIX toolset works only on Windows hosts. I'm not sure about the best approach here, maybe it'd be better to keep it enabled regardless of the host system, but make it configurable?

Split out from: #140772

WIX toolset works only on Windows hosts.
@rustbot
Copy link
Collaborator

rustbot commented May 31, 2025

r? @Kobzol

rustbot has assigned @Kobzol.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 31, 2025
@jieyouxu
Copy link
Member

jieyouxu commented May 31, 2025

WIX toolset works only on Windows hosts.

If that's the case, then disabling it for non-Windows-hosts seems fine I think?

@mati865
Copy link
Member Author

mati865 commented May 31, 2025

Well, it disables creation of .msi installers that are officially provided by Rust. So I'm not sure whether it should be a more conscious decision (via the config) or the implication of using non-Windows host is fine.

@Noratrieb
Copy link
Member

I think there should be a config, it sounds surprising that you suddenly get different results with the same config.

@Kobzol
Copy link
Contributor

Kobzol commented Jun 2, 2025

If the host was not Windows-based before, the build would fail (good luck running WIX or .exe files otherwise). Now it would be silently skipped. I don't think that we need a config for this, but the build should fail instead. So if target is Windows, but the host isn't, bootstrap should bail out.

@mati865
Copy link
Member Author

mati865 commented Jun 2, 2025

That would mean #140772 is a no-go in the current form.
I'll check how painful it would be to bootstrap from other Windows host soon.

@Kobzol
Copy link
Contributor

Kobzol commented Jun 3, 2025

Hmm, I don't see why that should be the case. Do the -gnullvm targets require MSI installers? If not, then we can just modify the check here from is_windows() to is_windows_but_not_gnu_llvm (or just is_msvc). If yes, then we cannot build them from a non-Windows host anyway.

@mati865
Copy link
Member Author

mati865 commented Jun 3, 2025

x.py dist for any Windows host does run (or at least tries to) WIX.
I had hoped msi installers could be missing for a single release (after the initial bootstrap these triples can host themselves in the dedicated job). So if condition like that is fine I'd go for it.

@Kobzol
Copy link
Contributor

Kobzol commented Jun 3, 2025

Sorry, I'm not sure if I understand that 😅 If the -gnullvm targets should contain the MSI installer in their dist archives, we will need to build these target on Windows hosts, right? Because we can't produce these installers from Linux hosts (AFAIK?).

@mati865
Copy link
Member Author

mati865 commented Jun 3, 2025

In the end they should, to be consistent with other hosts at https://forge.rust-lang.org/infra/other-installation-methods.html
The question is whether gnullvm hosts could temporally skip .msi installer for their first release?
If the answer is no, or it requires a proposal, I'll drop this change and try with Windows jobs.

@Kobzol
Copy link
Contributor

Kobzol commented Jun 3, 2025

The question is whether gnullvm hosts could temporally skip .msi installer for their first release?

I'm fine with that, but what I didn't understand is the "for their first release" part. What changes after the first release? How will we be able to create the MSI installers from Linux hosts?

@mati865
Copy link
Member Author

mati865 commented Jun 3, 2025

Sorry for not giving the full context here, I thought I had included it here in the previous comments, but it must have been a different issue/PR/channel.

Let me fix that.
My idea is to create the initial release with host tools for 86_64 and AArch64 windows-gnullvm triples using Linux host. It's the easiest way to achieve that (the possibility to run the containers locally helps a lot), but that means MSI installers are not achievable.
Once the host toolchain for these targets is present in the beta channel, Linux jobs for cross-compiling it would be replaced by native Windows jobs. Windows-gnullvm from that point forward would host themselves, so creating MSI installers becomes possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants