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

Don't depend on libc inside a test #38

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

bjorn3
Copy link
Contributor

@bjorn3 bjorn3 commented Feb 15, 2024

When the rustc-dev component is installed there will be two versions of
libc in the sysroot. This would result in an error as rustc doesn't know
which version to pick. In this case we don't actually depend on the libc
crate, so we can just remove the extern crate libc.

@bjorn3
Copy link
Contributor Author

bjorn3 commented Feb 15, 2024

CI won't pass until #39 is merged.

@sunfishcode
Copy link
Owner

Would it work to remove the extern crate libc; from src/main.rs, instead of adding libc to Cargo.toml?

When the rustc-dev component is installed there will be two versions of
libc in the sysroot. This would result in an error as rustc doesn't know
which version to pick. In this case we don't actually depend on the libc
crate, so we can just remove the extern crate libc.
@bjorn3 bjorn3 changed the title Don't depend on libc from the sysroot Don't depend on libc inside a test Feb 15, 2024
@bjorn3
Copy link
Contributor Author

bjorn3 commented Feb 15, 2024

That works too.

@sunfishcode sunfishcode merged commit 98c48b1 into sunfishcode:main Feb 15, 2024
5 checks passed
@bjorn3 bjorn3 deleted the no_sysroot_libc branch February 15, 2024 21:40
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