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 no_global_oom_handling build #110649

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

arlosi
Copy link
Contributor

@arlosi arlosi commented Apr 21, 2023

provide_sorted_batch in core is incorrectly marked with #[cfg(not(no_global_oom_handling))] which prevents core from building with the cfg enabled.

Nothing in core allocates memory (including this function). The cfg gate is incorrect.

cc @dpaoliello
r? @wesleywiser

The cfg was added by #107191

`provide_sorted_batch` in core is incorrectly marked with
`#[cfg(not(no_global_oom_handling))]` which prevents core
from building with the cfg enabled.

Nothing in core allocates memory including this function, so
the `cfg` gate is incorrect.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 21, 2023
@rustbot
Copy link
Collaborator

rustbot commented Apr 21, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@arlosi arlosi added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Apr 21, 2023
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Apr 21, 2023
@dpaoliello
Copy link
Contributor

dpaoliello commented Apr 21, 2023

@Ericson2314 @ojeda - Looks like the existing test (https://github.com/rust-lang/rust/blob/409661936f929b254ffc8adb644cf35d1f9765c4/tests/run-make/alloc-no-oom-handling/Makefile) only builds alloc, not core, seems like something that can be improved on?

@dpaoliello
Copy link
Contributor

r? @Mark-Simulacrum

@ojeda
Copy link
Contributor

ojeda commented Apr 21, 2023

Definitely @dpaoliello, thanks! Sent #110652.

ojeda added a commit to ojeda/rust that referenced this pull request Apr 23, 2023
…m_handling`

`tests/run-make/alloc-no-oom-handling` tests that `alloc` under
`no_global_oom_handling` builds and is warning-free.

Do the same for `core` to prevent issues such as [1].

Link: rust-lang#110649 [1]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 24, 2023

📌 Commit 5731655 has been approved by Mark-Simulacrum

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 24, 2023
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Apr 25, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 25, 2023
… r=Mark-Simulacrum

Fix no_global_oom_handling build

`provide_sorted_batch` in core is incorrectly marked with `#[cfg(not(no_global_oom_handling))]` which prevents core from building with the cfg enabled.

Nothing in `core` allocates memory (including this function). The `cfg` gate is incorrect.

cc `@dpaoliello`
r? `@wesleywiser`

The cfg was added by rust-lang#107191
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 25, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#110556 (Switch to `EarlyBinder` for `explicit_item_bounds`)
 - rust-lang#110615 (Add `impl_tag!` macro to implement `Tag` for tagged pointer easily)
 - rust-lang#110649 (Fix no_global_oom_handling build)
 - rust-lang#110671 (Consider polarity in new solver)
 - rust-lang#110783 (Fix ICE on --print=... i/o errors)
 - rust-lang#110796 (Updating Wake example to use new 'pin!' macro)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 94dfb3b into rust-lang:master Apr 25, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 25, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 29, 2023
…test, r=Mark-Simulacrum

Add test for warning-free builds of `core` under `no_global_oom_handling`

`tests/run-make/alloc-no-oom-handling` tests that `alloc` under `no_global_oom_handling` builds and is warning-free.

Do the same for `core` to prevent issues such as [1].

Link: rust-lang#110649 [1]
SamZhang3 added a commit to SamZhang3/doors-rs-old that referenced this pull request Jun 11, 2023
With the current Rust nightly (2023-06-01 as of this writing), using
`-Zbuild-std` to recompile the `core` and `alloc` crates while enabling
the `no_global_oom_handling` cfg now works properly. Therefore there is
no further need for the `doors_alloc` hack, which involved manually
copying the source for `alloc` and adding it as a Cargo dependency.

It is still not clear what change on the Rust/Cargo end fixed the
bug that previously blocked using `-Zbuild-std` to set the cfg (at the
time, trying to enable the cfg resulted in large numbers of mysterious
"duplicate lang item" errors). Maybe rust-lang/rust#110649 is related.
SamZhang3 added a commit to SamZhang3/doors-rs-old that referenced this pull request Jun 11, 2023
With the Rust nightly currently used for Doors (2023-06-01 as of this
writing), using `-Zbuild-std` to recompile the `core` and `alloc`
crates while enabling the `no_global_oom_handling` cfg now works
properly. Therefore there is no further need for the `doors_alloc`
hack, which involved manually copying the source for `alloc` and adding
it as a Cargo dependency.

It is still not clear what change on the Rust/Cargo end fixed the
bug that previously blocked using `-Zbuild-std` to set the cfg (at the
time, trying to enable the cfg resulted in large numbers of mysterious
"duplicate lang item" errors). Maybe rust-lang/rust#110649 is related.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-stable Performance or correctness regression from one stable version to another. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library 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