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

Use the rustc_private libc less in tests #123943

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

saethlin
Copy link
Member

I started looking into our use of rustc_private + extern crate libc; in tests because of #123938 and it looks like some fraction of the users of libc simply don't need the libc crate anymore.

@rustbot
Copy link
Collaborator

rustbot commented Apr 14, 2024

r? @estebank

rustbot has assigned @estebank.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 14, 2024
@workingjubilee
Copy link
Member

Thanks for cleaning this up!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 15, 2024

📌 Commit 41bda39 has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 15, 2024

#[link(name = "rust_test_helpers", kind = "static")]
extern "C" {
static rust_dbg_static_mut: libc::c_int; //~ ERROR extern items cannot be `const`
static rust_dbg_static_mut: i32; //~ ERROR extern items cannot be `const`
Copy link
Member

Choose a reason for hiding this comment

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

This is defines as int on the C side, so using i32 will be incorrect on some architectures. Maybe use int32_t on the C side?

int
rust_dbg_static_mut = 3;

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed by using ffi::c_int.

@saethlin saethlin force-pushed the less-sysroot-libc branch from 41bda39 to 7457a0d Compare April 15, 2024 12:54
@ChrisDenton
Copy link
Member

This is already in the queue so let's try...

@bors r-
@bors r=workingjubilee

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 15, 2024
@bors
Copy link
Contributor

bors commented Apr 15, 2024

📌 Commit 7457a0d has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 15, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 15, 2024
…mpiler-errors

Rollup of 4 pull requests

Successful merges:

 - rust-lang#123900 (Stop using `PolyTraitRef` for closure/coroutine predicates already instantiated w placeholders)
 - rust-lang#123924 (Fix various bugs in `ty_kind_suggestion`)
 - rust-lang#123943 (Use the rustc_private libc less in tests)
 - rust-lang#123970 (zkvm: fix references to `os_str` module)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 89e55f7 into rust-lang:master Apr 15, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 15, 2024
Rollup merge of rust-lang#123943 - saethlin:less-sysroot-libc, r=workingjubilee

Use the rustc_private libc less in tests

I started looking into our use of `rustc_private` + `extern crate libc;` in tests because of rust-lang#123938 and it looks like some fraction of the users of libc simply don't need the libc crate anymore.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 18, 2024
…=jieyouxu

Remove libc from more tests

The goal here is to trim down the number of tests that depend on libc from the sysroot to make rust-lang#123938 more plausible.

This PR is a few simple cases that I missed in rust-lang#123943.
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 18, 2024
…ieyouxu

Remove libc from more tests

The goal here is to trim down the number of tests that depend on libc from the sysroot to make rust-lang#123938 more plausible.

This PR is a few simple cases that I missed in rust-lang#123943.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Apr 19, 2024
Remove libc from more tests

The goal here is to trim down the number of tests that depend on libc from the sysroot to make rust-lang/rust#123938 more plausible.

This PR is a few simple cases that I missed in rust-lang/rust#123943.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants