Skip to content

修复了macos arm64版本可能导致的lwjgl natives匹配错误#5990

Open
yaalyy wants to merge 4 commits intoHMCL-dev:mainfrom
yaalyy:main
Open

修复了macos arm64版本可能导致的lwjgl natives匹配错误#5990
yaalyy wants to merge 4 commits intoHMCL-dev:mainfrom
yaalyy:main

Conversation

@yaalyy
Copy link
Copy Markdown

@yaalyy yaalyy commented Apr 23, 2026

问题描述:

在macos arm64版本下,导入整合包时,某些Forge/MultiMC导出的manifests会使用LWJGL natives的已经legacy的classifier,如natives-macos。而由于HMCL会将1.19+版本的arm64自动跳过patch, 所以该classifier会继续保持,从而导致下载的LWJGL与系统版本不匹配并路径错误导致找不到。

修复方式

对于legacy的classifier做了检测,已经legacy的classifier会做patch

@yaalyy yaalyy marked this pull request as ready for review April 23, 2026 02:28
@Glavo
Copy link
Copy Markdown
Member

Glavo commented Apr 23, 2026

/gemini reivew

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the native library patching mechanism to support ARM64 architectures on macOS and Windows, particularly for legacy LWJGL versions. It introduces a hasLegacyLwjglNatives check and a fallback replacement strategy using library classifiers. Additionally, several LWJGL 3.3.1 native mappings for macOS ARM64 were added to the configuration. Feedback was provided regarding redundant logging in the library replacement logic that could lead to duplicate output.

Comment thread HMCL/src/main/java/org/jackhuang/hmcl/util/NativePatcher.java
@burningtnt
Copy link
Copy Markdown
Member

把 LWJGL 直接提升到这么高的版本真的能保持兼容性吗?

@yaalyy
Copy link
Copy Markdown
Author

yaalyy commented Apr 23, 2026

把 LWJGL 直接提升到这么高的版本真的能保持兼容性吗?

native.json 新增的LWJGL映射是从文件本身已有的映射复制而来,3.3.1. 并没有拉高版本

本次修改并没有对当前版本的native patcher触发做过大修改,因为在arm64环境下,遇到没有系统架构标识的legacy classifier, 原逻辑会默认当做x86处理,所以这次修改仅为arm64环境下新增了legacy classifier的检测,且只对macos arm64做了特别处理。在classifier不是legacy的情况下, 1.19+版本仍会按照原逻辑执行。

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