-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Only try to modify file times of a writable file on Windows #128977
Conversation
Documented here in the Windows API. LGTM, feel free to r=me once CI is green. |
Only try to modify file times of a writable file - First commit fixes a failure that I was running into locally trying to build a stage 1 `./x build library --stage 1` on windows due to trying to modify file times of a read-only file. - Second commit introduces a `set_file_times` helper which opens a given path as a file in r+w mode and then sets file times. This should hopefully make setting file times less error prone, since trying to set file times on read-only file also happened in rust-lang#127850. (And apparently it only fails locally on Windows or something weird like that.)
Only try to modify file times of a writable file - First commit fixes a failure that I was running into locally trying to build a stage 1 `./x build library --stage 1` on windows due to trying to modify file times of a read-only file. - Second commit introduces a `set_file_times` helper which opens a given path as a file in r+w mode and then sets file times. This should hopefully make setting file times less error prone, since trying to set file times on read-only file also happened in rust-lang#127850. (And apparently it only fails locally on Windows or something weird like that.)
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#128886 (Get rid of some `#[allow(rustc::untranslatable_diagnostic)]`) - rust-lang#128936 (Support reading thin archives in ArArchiveBuilder) - rust-lang#128937 (Fix warnings in rmake tests on `x86_64-unknown-linux-gnu`) - rust-lang#128977 (Only try to modify file times of a writable file) - rust-lang#128978 (Use `assert_matches` around the compiler more) r? `@ghost` `@rustbot` modify labels: rollup
@bors r- 2024-08-12T08:09:07.8523294Z �[1m�[32m Compiling�[0m clap_derive v4.5.5 |
... wat |
It's possible that some files are not writable on Linux (not sure if it's because of Docker or something else), but it was possible to set their modification times (?). Would be useful to see the path for which the mtime modification failed. |
The code that failed is this section: Lines 1785 to 1794 in 13c36f1
It should be writeable because the file was just copied. But setting the permissions may make it unable to be reopen with write access. |
13c36f1
to
73132a9
Compare
Hm, my money is currently on read-only things (on CI) that I am trying to open as writable. I'll run a try-job to see which path causes the failure. |
@bors try |
Only try to modify file times of a writable file - First commit fixes a failure that I was running into locally trying to build a stage 1 `./x build library --stage 1` on windows due to trying to modify file times of a read-only file. - Second commit introduces a `set_file_times` helper which opens a given path as a file in r+w mode and then sets file times. This should hopefully make setting file times less error prone, since trying to set file times on read-only file also happened in rust-lang#127850. (And apparently it only fails locally on Windows or something weird like that.) try-job: dist-loongarch64-musl
That's a good point. Maybe just reordering the file time modification and the permissions setting could fix it? |
This comment has been minimized.
This comment has been minimized.
(We can't do that AFAICT because as I understand it the set file times is there because |
Only try to modify file times of a writable file on Windows Introduces a `set_file_times` helper which opens a given path as a file in r+w mode on Windows and then sets file times. Previously the file was open as read-only for Windows which caused permission errors locally. This should hopefully make setting file times less error prone, since trying to set file times on read-only file on Windows also happened in rust-lang#127850. try-job: dist-loongarch64-musl try-job: x86_64-msvc
…kingjubilee Rollup of 10 pull requests Successful merges: - rust-lang#128064 (Improve docs for Waker::noop and LocalWaker::noop) - rust-lang#128922 (rust-analyzer: use in-tree `pattern_analysis` crate) - rust-lang#128965 (Remove `print::Pat` from the printing of `WitnessPat`) - rust-lang#128977 (Only try to modify file times of a writable file on Windows) - rust-lang#129018 (Migrate `rlib-format-packed-bundled-libs` and `native-link-modifier-bundle` `run-make` tests to rmake) - rust-lang#129037 (Port `run-make/libtest-json` and `run-make/libtest-junit` to rmake) - rust-lang#129078 (`ParamEnvAnd::fully_perform`: we have an `ocx`, use it) - rust-lang#129110 (Add a comment explaining the return type of `Ty::kind`.) - rust-lang#129111 (Port the `sysroot-crates-are-unstable` Python script to rmake) - rust-lang#129135 (crashes: more tests) r? `@ghost` `@rustbot` modify labels: rollup
almost certainly failed in #129142 |
@bors r- |
This comment has been minimized.
This comment has been minimized.
2e7e619
to
26fae1e
Compare
Ah there's a new |
@rustbot ready |
It's not new, it's just now required to pass it to Thanks! @bors r+ |
Looking forward to it 👀 |
☀️ Test successful - checks-actions |
Finished benchmarking commit (8fbdc04): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary -2.6%, secondary 1.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 749.902s -> 751.027s (0.15%) |
Introduces a
set_file_times
helper which opens a given path as a file in r+w mode on Windows and then sets file times. Previously the file was open as read-only for Windows which caused permission errors locally.This should hopefully make setting file times less error prone, since trying to set file times on read-only file on Windows also happened in #127850.
try-job: dist-loongarch64-musl
try-job: x86_64-msvc