Skip to content
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

Fix unnecessary search path warning on macOS #235

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

madsmtm
Copy link
Contributor

@madsmtm madsmtm commented Feb 10, 2025

The linker on macOS warns on unused search paths, and concretely, when compiling zlib-ng via this crate, it warns with:

ld: search path 'target/debug/build/libz-sys-3eb8b95c9c44bf93/out/lib64' not found

This warning has previously been hidden away, but rustc wants to surface them by default at some point.

So let's avoid the warning by setting CMAKE_INSTALL_LIBDIR explicitly, and then only passing a single search path to the linker.

Can be tested on macOS with:

$ RUSTFLAGS="-Wlinker-messages" cargo +nightly test --no-default-features --features zlib-ng

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks a lot! I validated he warning, and that it doesn't occur with this PR.

@Byron Byron merged commit 2e2e4f5 into rust-lang:main Feb 11, 2025
48 checks passed
@madsmtm madsmtm deleted the fix-unnecessary-search-path branch February 11, 2025 06:59
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.

2 participants