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

[wasm] Skip Assert.InRange in Copy.cs for Browser #41000

Merged
merged 2 commits into from
Aug 20, 2020

Conversation

mdh1418
Copy link
Member

@mdh1418 mdh1418 commented Aug 18, 2020

This PR reverts #40663.

By reverting dotnet/corefx#37583 in #40753, the file time being set

while ((ret = futimens(outFd, origTimes)) < 0 && errno == EINTR);
is now overwritten by
while ((ret = fchmod(outFd, sourceStat.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO))) < 0 && errno == EINTR);
probably due to Emscripten's implementation. (By commenting out L1173-L1177 the test passes)

Moreover, from some testing, it looks like File.SetAttributes will overwrite a file's LastWrite and LastAccess time on browser also probably due to Emscripten's implementation.

The workaround in #40663 sets the file's LastWrite after Copy for readOnly files, but if we have to do that for both readOnly and non-readOnly because L1157 is defeated by L1173, then the Assert.InRange check is trivial and we should instead skip this assert on Browser.

@mdh1418 mdh1418 merged commit 2e68b6e into dotnet:master Aug 20, 2020
@mdh1418 mdh1418 deleted the mdhwang/file_copy_skip_check branch August 20, 2020 12:40
@mdh1418 mdh1418 restored the mdhwang/file_copy_skip_check branch August 20, 2020 12:47
@mdh1418 mdh1418 deleted the mdhwang/file_copy_skip_check branch September 11, 2020 15:43
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.IO
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants