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 Mode instead of mode_t in std::fs fields #123127

Closed
wants to merge 2 commits into from

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Mar 27, 2024

Slightly different implementation of #122812 discussed in #122812 (review).

r? @ghost

@rustbot rustbot added O-unix Operating system: Unix-like 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 Mar 27, 2024
@dtolnay dtolnay marked this pull request as draft March 27, 2024 08:29
@dtolnay dtolnay closed this Mar 27, 2024
@dtolnay dtolnay deleted the mode2 branch March 27, 2024 08:30
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test result: ok. 24 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s

     Running tests/ui.rs (obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/deps/ui-34e0c79da4e404df)
## Running ui tests in tests/pass for x86_64-unknown-linux-gnu
   Compiler: "MIRI_ENV_VAR_TEST"="0" "MIRI_TEMP"="/tmp/miri-uitest-BVHWaI" "RUST_BACKTRACE"="1" /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri "--error-format=json" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--target" "x86_64-unknown-linux-gnu" "--out-dir" OUT_DIR


   Compiler: "MIRI_ENV_VAR_TEST"="0" "MIRI_TEMP"="/tmp/miri-uitest-BVHWaI" "RUST_BACKTRACE"="1" /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri "--error-format=json" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--target" "x86_64-unknown-linux-gnu" "--out-dir" OUT_DIR

## Running ui tests in tests/panic for x86_64-unknown-linux-gnu

test result: ok. 27 passed; 4 ignored;
test result: ok. 27 passed; 4 ignored;

   Compiler: "MIRI_ENV_VAR_TEST"="0" "MIRI_TEMP"="/tmp/miri-uitest-BVHWaI" "RUST_BACKTRACE"="1" /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri "--error-format=json" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--target" "x86_64-unknown-linux-gnu" "--out-dir" OUT_DIR


   Compiler: "MIRI_ENV_VAR_TEST"="0" "MIRI_TEMP"="/tmp/miri-uitest-BVHWaI" "RUST_BACKTRACE"="1" /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri "--error-format=json" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--target" "x86_64-unknown-linux-gnu" "--out-dir" OUT_DIR


FAILED TEST: tests/fail/shims/fs/isolated_file.rs
FAILED TEST: tests/fail/shims/fs/isolated_file.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-BVHWaI" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/miri" "--error-format=json" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--target" "x86_64-unknown-linux-gnu" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/ui/tests/fail/shims/fs" "tests/fail/shims/fs/isolated_file.rs" "--edition" "2021"
error: actual output differed from expected
Execute `./miri test --bless` to update `tests/fail/shims/fs/isolated_file.stderr` to the actual output
--- tests/fail/shims/fs/isolated_file.stderr
+++ <stderr output>
+++ <stderr output>
Error: 
   0: ui tests in tests/fail for x86_64-unknown-linux-gnu failed
   1: tests failed

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
   --> RUSTLIB/std/src/sys/pal/PLATFORM/fs.rs:LL:CC
    |
-LL |         let fd = cvt_r(|| unsafe { open64(path.as_ptr(), flags, opts.mode as c_int) })?;
+LL |         let fd = cvt_r(|| unsafe { open64(path.as_ptr(), flags, opts.mode.0 as c_int) })?;
---
   = help: pass the flag `-Zmiri-disable-isolation` to disable isolation;
   = help: or pass `-Zmiri-isolation-error=warn` to configure Miri to return an error code from isolated operations (if supported for that operation) and continue with a warning
   = note: BACKTRACE:
   = note: inside closure at /checkout/library/std/src/sys/pal/unix/fs.rs:1140:36: 1140:86
   = note: inside `std::sys::pal::unix::cvt_r::<i32, {closure@std::sys::pal::unix::fs::File::open_c::{closure#0}}>` at /checkout/library/std/src/sys/pal/unix/mod.rs:321:19: 321:22
   = note: inside closure at /checkout/library/std/src/sys/pal/unix/fs.rs:1128:42: 1128:66
   = note: inside closure at /checkout/library/std/src/sys/pal/unix/fs.rs:1128:42: 1128:66
   = note: inside `std::sys::pal::common::small_c_string::run_with_cstr_stack::<std::sys::pal::unix::fs::File>` at /checkout/library/std/src/sys/pal/common/small_c_string.rs:49:18: 49:22
   = note: inside `std::sys::pal::common::small_c_string::run_with_cstr::<std::sys::pal::unix::fs::File>` at /checkout/library/std/src/sys/pal/common/small_c_string.rs:29:18: 29:47
   = note: inside `std::sys::pal::common::small_c_string::run_path_with_cstr::<std::sys::pal::unix::fs::File>` at /checkout/library/std/src/sys/pal/common/small_c_string.rs:19:5: 19:58
   = note: inside `std::fs::OpenOptions::_open` at /checkout/library/std/src/fs.rs:1135:9: 1135:42
   = note: inside `std::fs::OpenOptions::open::<&std::path::Path>` at /checkout/library/std/src/fs.rs:1131:9: 1131:34
   = note: inside `std::fs::File::open::<&str>` at /checkout/library/std/src/fs.rs:375:9: 375:58
note: inside `main`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix Operating system: Unix-like 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants