Skip to content

Conversation

@eduardorittner
Copy link

@eduardorittner eduardorittner commented Nov 11, 2025

This PR adds tests for the getenv, setenv and unsetenv functions directly through the libc api. Related to #3179

@rustbot
Copy link
Collaborator

rustbot commented Nov 11, 2025

Thank you for contributing to Miri! A reviewer will take a look at your PR, typically within a week or two.
Please remember to not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it.

@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Nov 11, 2025
Copy link
Member

@RalfJung RalfJung left a comment

Choose a reason for hiding this comment

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

Thanks! I left some minor comments.

View changes since this review

@@ -0,0 +1,98 @@
//@ignore-target: windows
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
//@ignore-target: windows
//@ignore-target: windows # No libc

Comment on lines +10 to +12
// PATH should exist and not be null
let s = unsafe { libc::getenv(b"PATH\0".as_ptr().cast()) };
assert!(!s.is_null());
Copy link
Member

Choose a reason for hiding this comment

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

Please check MIRI_ENV_VAR_TEST instead, which is set by the test harness so it should always have the value "0".

Comment on lines +6 to +7
#[path = "../../utils/mod.rs"]
mod utils;
Copy link
Member

Choose a reason for hiding this comment

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

This does not seem to be used?

@rustbot rustbot added S-waiting-on-author Status: Waiting for the PR author to address review comments and removed S-waiting-on-review Status: Waiting for a review to complete labels Nov 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: Waiting for the PR author to address review comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants