Repository navigation
fix(java): 将 libc 依赖限定为 Unix(#19) - #44
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #19
根因
libc在backend/Cargo.toml的跨平台依赖中声明,但后端仅在backend/src/project_settings.rs的#[cfg(unix)]路径使用libc::O_NOFOLLOW。Windows 构建会看到无用依赖并产生警告。改动
libc = "0.2"移到[target.'cfg(unix)'.dependencies]。Cargo.lock:Unix 构建仍保留依赖;Windows 目标不再把libc作为此 crate 的直接依赖。验证
已在本地 macOS(arm64)复核并运行 CI 等价检查:
libc:仅backend/src/project_settings.rs的#[cfg(unix)]分支调用libc::O_NOFOLLOW。cargo metadata --locked --filter-platform x86_64-pc-windows-msvcvsaarch64-apple-darwin:lithe-java-backend解析依赖中,Windows 目标不再包含libc,macOS 目标保留libc。cargo fmt --all --check:通过cargo clippy --workspace --all-targets --locked -- -D warnings:通过cargo test --workspace --locked:463 个测试全部通过(lithe-java-backend单元测试 165、repository_pins10、session4、lithe-java-domain单元测试 284)node --test --test-timeout=60000 scripts/package/*.test.mjs:11/11 通过node --test --test-timeout=15000 scripts/compiler/process.test.mjs:2/2 通过scripts/verify-sdk-lock.sh --download:通过(Verified manifest and 1 translations against Core 0b6da2725ded74de7c3b62b49d12c1947dc0a38a)x86_64-pc-windows-msvc标准库目标,未在本地执行 Windows 原生/交叉编译。