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

Fix setting timestamp on Windows on readonly files #62638

Merged
merged 3 commits into from
Dec 11, 2021

Conversation

danmoseley
Copy link
Member

Fix #62602

All other attribute/timestamp operations go through GetFileAttributesEx/SetFileAttributes and work fine.

Curiously this is a bug back to .NET Framework.

@ghost
Copy link

ghost commented Dec 10, 2021

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

Fix #62602

All other attribute/timestamp operations go through GetFileAttributesEx/SetFileAttributes and work fine.

Curiously this is a bug back to .NET Framework.

Author: danmoseley
Assignees: -
Labels:

area-System.IO

Milestone: -

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Subject to my question on the issue, LGTM.

@danmoseley
Copy link
Member Author

@dotnet/dnceng any idea about this

2021-12-10T19:06:56.4173416Z /__w/1/s/.dotnet/sdk/6.0.100/MSBuild.dll /nologo -maxcpucount /m -verbosity:m /v:minimal /bl:/__w/1/s/artifacts/log/Checked/ToolsetRestore.binlog /clp:Summary /clp:ErrorsOnly;NoSummary /nr:false /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=true /p:__ToolsetLocationOutputFile=/__w/1/s/artifacts/toolset/7.0.0-beta.21602.3.txt /t:__WriteToolsetLocation /warnaserror /__w/1/s/artifacts/toolset/restore.proj
2021-12-10T19:07:50.9286909Z /__w/1/s/artifacts/toolset/restore.proj : error : Unable to load the service index for source https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json.
2021-12-10T19:07:51.0461863Z Build failed with exit code 1. Check errors above.
2021-12-10T19:07:51.1177834Z ##[section]Finishing: Build and generate native prerequisites

does this go through @MattGal 's patent retry scheme?

@MattGal
Copy link
Member

MattGal commented Dec 10, 2021

does this go through @MattGal 's patent retry scheme?

I'd expect the variables to be set here, checking this out. It is still theoretically possible to fully fail, too (all I added was delay and retry)

@MattGal
Copy link
Member

MattGal commented Dec 10, 2021

does this go through @MattGal 's patent retry scheme?

I'd expect the variables to be set here, checking this out. It is still theoretically possible to fully fail, too (all I added was delay and retry)

@danmoseley the binlog definitely contains the variables and it should definitely be a new enough SDK. It didn't log the retries either, this may have just been some unusual catastrophic response? If it keeps up we can pursue with AzDO packaging folks to see what happened on https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/ in that time.

@danmoseley
Copy link
Member Author

Hmm, NuGet issues on another leg also

dotnet-linker-tests 20211210.67 / Build Linux x64 release Runtime_Release / Build product
❌[Log] .dotnet/sdk/6.0.100/NuGet.RestoreEx.targets(19,5): error : Failed to retrieve information about 'Microsoft.CodeAnalysis.CSharp.CodeStyle' from remote source 'https://pkgs.dev.azure.com/azure-public/3ccf6661-f8ce-4e8a-bb2e-eff943ddd3c7/_packaging/58ca65bb-e6c1-4210-88ac-fa55c1cd7877/nuget/v3/flat2/microsoft.codeanalysis.csharp.codestyle/index.json'.
at NuGet.Protocol.HttpFileSystemBasedFindPackageByIdResource.FindPackagesByIdAsync(String id, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
at NuGet.Protocol.HttpFileSystemBasedFindPackageByIdResource.DoesPackageExistAsync(String id, NuGetVersion version, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)

@danmoseley danmoseley closed this Dec 10, 2021
@danmoseley danmoseley reopened this Dec 10, 2021
@danmoseley danmoseley merged commit f65c469 into dotnet:main Dec 11, 2021
@adamsitnik adamsitnik added this to the 7.0.0 milestone Dec 16, 2021
@adamsitnik
Copy link
Member

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1588621425

@github-actions
Copy link
Contributor

@adamsitnik backporting to release/6.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: fix datetime
.git/rebase-apply/patch:127: trailing whitespace.
        
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs
M	src/libraries/System.IO.FileSystem/tests/Directory/GetSetTimes.cs
M	src/libraries/System.IO.FileSystem/tests/DirectoryInfo/GetSetTimes.cs
M	src/libraries/System.IO.FileSystem/tests/File/GetSetTimes.cs
M	src/libraries/System.IO.FileSystem/tests/FileInfo/GetSetTimes.cs
M	src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.cs
Falling back to patching base and 3-way merge...
Auto-merging src/libraries/System.Private.CoreLib/src/System/IO/FileSystem.Windows.cs
Auto-merging src/libraries/System.IO.FileSystem/tests/FileInfo/GetSetTimes.cs
Auto-merging src/libraries/System.IO.FileSystem/tests/File/GetSetTimes.cs
Auto-merging src/libraries/System.IO.FileSystem/tests/DirectoryInfo/GetSetTimes.cs
Auto-merging src/libraries/System.IO.FileSystem/tests/Directory/GetSetTimes.cs
Auto-merging src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs
CONFLICT (content): Merge conflict in src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 fix datetime
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

@danmoseley danmoseley deleted the fixdatetime branch December 30, 2021 03:14
danmoseley added a commit to adamsitnik/runtime that referenced this pull request Dec 31, 2021
# Conflicts:
#	src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs
@danmoseley danmoseley added breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet labels Jan 6, 2022
@ghost
Copy link

ghost commented Jan 6, 2022

Added needs-breaking-change-doc-created label because this PR has the breaking-change label.

When you commit this breaking change:

  1. Create and link to this PR and the issue a matching issue in the dotnet/docs repo using the breaking change documentation template, then remove this needs-breaking-change-doc-created label.
  2. Ask a committer to mail the .NET Breaking Change Notification DL.

Tagging @dotnet/compat for awareness of the breaking change.

@danmoseley danmoseley removed the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Jan 6, 2022
danmoseley added a commit that referenced this pull request Jan 7, 2022
)

* Fix setting timestamp on Windows on readonly files (#62638)

# Conflicts:
#	src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs

* make it compile

* fix build

Co-authored-by: Dan Moseley <[email protected]>
@ghost ghost locked as resolved and limited conversation to collaborators Feb 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.IO breaking-change Issue or PR that represents a breaking API or functional change over a prerelease.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File.SetLastWrite time fails on readonly files on Windows
4 participants