Skip to content

Set Distro Env HOSTTYPE to aarch64 for ARM64 build#40048

Merged
wangxin12 merged 2 commits intomasterfrom
user/wangxin12/hosttype
Apr 2, 2026
Merged

Set Distro Env HOSTTYPE to aarch64 for ARM64 build#40048
wangxin12 merged 2 commits intomasterfrom
user/wangxin12/hosttype

Conversation

@wangxin12
Copy link
Copy Markdown
Contributor

Summary of the Pull Request

Set Distro Env HOSTTYPE to aarch64 for ARM64 build

PR Checklist

  • Closes: Link to issue HOSTTYPE reports incorrect value on aarch64 systems #40040
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@wangxin12 wangxin12 requested a review from a team as a code owner March 31, 2026 10:53
@wangxin12 wangxin12 requested review from OneBlue, benhillis, Copilot, damanm24 and jstarks and removed request for Copilot March 31, 2026 10:53
Copy link
Copy Markdown
Member

@benhillis benhillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding more #defines, can you do something similar to what we do for WSL_PACKAGE_VERSION?

Copilot AI review requested due to automatic review settings April 1, 2026 05:11
@wangxin12 wangxin12 requested a review from benhillis April 1, 2026 05:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates WSL’s default distro environment so HOSTTYPE reflects the target architecture, fixing incorrect HOSTTYPE=x86_64 on ARM64 builds (issue #40040).

Changes:

  • Introduce a build-time DISTRO_HOSTTYPE define set to x86_64 on x64 and aarch64 on arm64.
  • Use DISTRO_HOSTTYPE when constructing the default distro environment (both the IDL macro and the service-side default environment vector).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
CMakeLists.txt Defines DISTRO_HOSTTYPE based on TARGET_PLATFORM and exports it as a compile definition.
src/windows/service/inc/wslservice.idl Switches LXSS_DISTRO_DEFAULT_ENVIRONMENT to build HOSTTYPE from DISTRO_HOSTTYPE.
src/windows/service/exe/DistributionRegistration.h Updates the DefaultEnvironment default value to use DISTRO_HOSTTYPE instead of a hardcoded x86_64.

@wangxin12 wangxin12 merged commit f8e579a into master Apr 2, 2026
10 checks passed
@wangxin12 wangxin12 deleted the user/wangxin12/hosttype branch April 2, 2026 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants