René's URL Explorer Experiment


Title: Fix deprecated constant and method usage in `host_env` and `vm` crates. · Issue #8297 · RustPython/RustPython · GitHub

Open Graph Title: Fix deprecated constant and method usage in `host_env` and `vm` crates. · Issue #8297 · RustPython/RustPython

X Title: Fix deprecated constant and method usage in `host_env` and `vm` crates. · Issue #8297 · RustPython/RustPython

Description: While compiling RustPython (specifically rustpython-host_env v0.5.0 and the vm crate), several deprecation warnings are emitted. While these do not currently break the build, they introduce technical debt, clutter CI logs, and pose poten...

Open Graph Description: While compiling RustPython (specifically rustpython-host_env v0.5.0 and the vm crate), several deprecation warnings are emitted. While these do not currently break the build, they introduce technic...

X Description: While compiling RustPython (specifically rustpython-host_env v0.5.0 and the vm crate), several deprecation warnings are emitted. While these do not currently break the build, they introduce technic...

Opengraph URL: https://github.com/RustPython/RustPython/issues/8297

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fix deprecated constant and method usage in `host_env` and `vm` crates.","articleBody":"While compiling RustPython (specifically `rustpython-host_env v0.5.0` and the `vm` crate), several deprecation warnings are emitted. While these do not currently break the build, they introduce technical debt, clutter CI logs, and pose potential stability and portability risks if left unaddressed.\n\n## Context \u0026 Compiler Output\nThe following warnings are generated during compilation:\n\n**1. `libc::RLIM_NLIMITS` deprecation in `host_env`**\n```text\nwarning: use of deprecated constant `libc::RLIM_NLIMITS`: Not stable across OS versions\n  --\u003e crates/host_env/src/resource.rs:11:15\n   |\n11 | pub use libc::RLIM_NLIMITS;\n   |               ^^^^^^^^^^^^\n```\n\n**2. `Atomic::fetch_update` deprecation in `vm`**\n```text\nwarning: use of deprecated method `rustpython_common::atomic::Atomic::\u003cu32\u003e::fetch_update`: renamed to `try_update` for consistency\n  --\u003e crates/vm/src/builtins/function.rs:90:10\n   |\n90 | ...   .fetch_update(Relaxed, Relaxed, |v| (v != 0)...\n   |        ^^^^^^^^^^^^\n\nwarning: use of deprecated method `rustpython_common::atomic::Atomic::\u003cu64\u003e::fetch_update`: renamed to `try_update` for consistency\n  --\u003e crates/vm/src/builtins/type.rs:683:14\n   |\n683| ...   .fetch_update(Ordering::AcqRel, Ordering::A...\n   |        ^^^^^^^^^^^^\n```\n\n## Risks Involved\n\n### 1. Cross-Platform Instability (`RLIM_NLIMITS`)\nThe `libc` crate explicitly marks `RLIM_NLIMITS` as deprecated because **it is not stable across OS versions**. The number of resource limits (`RLIMIT_*`) varies between different operating systems and even across different versions of the same OS (e.g., Linux kernel updates). \n* **Risk:** Relying on this constant as a boundary for iterating over resource limits can lead to out-of-bounds errors, incorrect resource limit calculations, or panics when RustPython is compiled for or run on newer/older OS versions. It severely hinders cross-platform reliability.\n\n### 2. Codebase Confusion and Future Breakage (`fetch_update`)\nThe internal `rustpython_common::atomic::Atomic` wrapper renamed `fetch_update` to `try_update` for API consistency (likely to avoid confusion with the standard library's `std::sync::atomic::Atomic*::fetch_update`).\n* **Risk:** While currently just a warning, keeping deprecated methods in the codebase causes \"warning fatigue\" in CI. If the deprecated `fetch_update` method is eventually removed from `rustpython_common` in a future minor release, it will cause hard compilation failures. Furthermore, it confuses contributors who might look up the standard library's `fetch_update` and expect it to behave identically to the custom wrapper.\n\n## Proposed Solutions\n\n### Fix 1: Replace `RLIM_NLIMITS` in `crates/host_env/src/resource.rs`\nInstead of exporting or using `RLIM_NLIMITS` as a generic upper bound, we should handle resource limits dynamically or use explicit constants.\n* **Action:** Investigate how `RLIM_NLIMITS` is being used in `resource.rs`. If it's used to iterate over all possible limits, refactor the code to use an explicit array of supported `RLIMIT_*` constants for the target OS, or use conditional compilation (`#[cfg(target_os = \"...\")]`) to handle OS-specific maximums safely. Remove the `pub use libc::RLIM_NLIMITS;` export.\n\n### Fix 2: Rename `fetch_update` to `try_update` in `vm`\nThis is a straightforward find-and-replace to align with the updated `rustpython_common` API.\n* **Action:** Update the method calls in the following files:\n  * `crates/vm/src/builtins/function.rs` (Line 90)\n  * `crates/vm/src/builtins/type.rs` (Line 683)\n\n**Example diff for `function.rs`:**\n```diff\n-         .fetch_update(Relaxed, Relaxed, |v| (v != 0).then(|| v.wrapping_add(1)))\n+         .try_update(Relaxed, Relaxed, |v| (v != 0).then(|| v.wrapping_add(1)))\n```\n\n**Example diff for `type.rs`:**\n```diff\n-             .fetch_update(Ordering::AcqRel, Ordering::Acquire, |old| {\n+             .try_update(Ordering::AcqRel, Ordering::Acquire, |old| {\n```\n\n## Action Items\n- [ ] Refactor `crates/host_env/src/resource.rs` to remove reliance on `libc::RLIM_NLIMITS`.\n- [ ] Rename `fetch_update` to `try_update` in `crates/vm/src/builtins/function.rs`.\n- [ ] Rename `fetch_update` to `try_update` in `crates/vm/src/builtins/type.rs`.\n- [ ] Run `cargo build` and `cargo test` to ensure no regressions and verify that the deprecation warnings are gone.","author":{"url":"https://github.com/human-on-vm","@type":"Person","name":"human-on-vm"},"datePublished":"2026-07-17T01:04:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/8297/RustPython/issues/8297"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5db2e714-2bc0-cf1c-bc05-6be2438534cc
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB080:2B266B:273B76:353562:6A614B4C
html-safe-nonce5e1d4702832fe5cf82dd3a79a9bdb40ca966c159434627f06aa56317a1c1fe02
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDgwOjJCMjY2QjoyNzNCNzY6MzUzNTYyOjZBNjE0QjRDIiwidmlzaXRvcl9pZCI6IjY0Njc2NTg3NjE2ODAwMTQxNTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac0008f80d2b00e1a70652f3c75420133bd549e795fe9adbe33afb8a78136f9b76
hovercard-subject-tagissue:4907157548
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/RustPython/RustPython/8297/issue_layout
twitter:imagehttps://opengraph.githubassets.com/60b47e305f77c47a8c39607dddfdeb66ccd493e0429556888d6832629d43e054/RustPython/RustPython/issues/8297
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/60b47e305f77c47a8c39607dddfdeb66ccd493e0429556888d6832629d43e054/RustPython/RustPython/issues/8297
og:image:altWhile compiling RustPython (specifically rustpython-host_env v0.5.0 and the vm crate), several deprecation warnings are emitted. While these do not currently break the build, they introduce technic...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamehuman-on-vm
hostnamegithub.com
expected-hostnamegithub.com
None4876c15b81beff1a5306612a3386748550c731559f1dbbe4cf7146fda63fc0e0
turbo-cache-controlno-preview
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3e1bd3b6ebab0d27ffbef3a6bbb1043bc5f098ae
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/issues/8297#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fissues%2F8297
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fissues%2F8297
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/issues/8297
Reloadhttps://github.com/RustPython/RustPython/issues/8297
Reloadhttps://github.com/RustPython/RustPython/issues/8297
Please reload this pagehttps://github.com/RustPython/RustPython/issues/8297
RustPython https://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Notifications https://github.com/login?return_to=%2FRustPython%2FRustPython
Fork 1.5k https://github.com/login?return_to=%2FRustPython%2FRustPython
Star 22.2k https://github.com/login?return_to=%2FRustPython%2FRustPython
Code https://github.com/RustPython/RustPython
Issues 293 https://github.com/RustPython/RustPython/issues
Pull requests 103 https://github.com/RustPython/RustPython/pulls
Discussions https://github.com/RustPython/RustPython/discussions
Actions https://github.com/RustPython/RustPython/actions
Projects https://github.com/RustPython/RustPython/projects
Models https://github.com/RustPython/RustPython/models
Wiki https://github.com/RustPython/RustPython/wiki
Security and quality 0 https://github.com/RustPython/RustPython/security
Insights https://github.com/RustPython/RustPython/pulse
Code https://github.com/RustPython/RustPython
Issues https://github.com/RustPython/RustPython/issues
Pull requests https://github.com/RustPython/RustPython/pulls
Discussions https://github.com/RustPython/RustPython/discussions
Actions https://github.com/RustPython/RustPython/actions
Projects https://github.com/RustPython/RustPython/projects
Models https://github.com/RustPython/RustPython/models
Wiki https://github.com/RustPython/RustPython/wiki
Security and quality https://github.com/RustPython/RustPython/security
Insights https://github.com/RustPython/RustPython/pulse
#8300https://github.com/RustPython/RustPython/pull/8300
Fix deprecated constant and method usage in host_env and vm crates.https://github.com/RustPython/RustPython/issues/8297#top
#8300https://github.com/RustPython/RustPython/pull/8300
https://github.com/lsahn-gh
C-bugSomething isn't workinghttps://github.com/RustPython/RustPython/issues?q=state%3Aopen%20label%3A%22C-bug%22
https://github.com/human-on-vm
human-on-vmhttps://github.com/human-on-vm
on Jul 17, 2026https://github.com/RustPython/RustPython/issues/8297#issue-4907157548
lsahn-ghhttps://github.com/lsahn-gh
C-bugSomething isn't workinghttps://github.com/RustPython/RustPython/issues?q=state%3Aopen%20label%3A%22C-bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.