dotnet / dotnet/msbuild

UseHardlinksIfPossible, readonly attributes and TFS issue

Open
#473 1 comment 1 reaction 0 assignees View on GitHub
help wanted triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

Microsoft.Build.Tasks.Copy supports UseHardlinksIfPossible property. Unfortunately, using this property causes the issue with coping the files originally located at TFS _(workspace location should be set to Server)_. This task clears all attributes of a destination files, but in case of hard link original and destination files are the same, so original files also changes their attributes (especially readonly one).

And next time on updating TFS can cause conflicting issue, because in Server mode workspace lack of readonly attribute means that the file has been changed and needed for merging.

I'd advise to perform small change at 351 line of Cope.cs file, something like this:

`if (sourceFileState.IsReadOnly && !hardLinkCreated)`

Or better implement additional property which will indicate what we should do with hard links attributes.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting line 351 in Cope.cs and the handling of UseHardlinksIfPossible when copying files from a TFS workspace configured for Server mode. Verify how destination attributes are cleared when the source and destination are hard-linked. Done means hard-link copies no longer alter the original file's readonly state; the issue does not name a test to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.