Skip to content

Node reuse locks task assembly file #3141

@natemcmaster

Description

@natemcmaster

We have build scripts that produce tasks as a local assembly. These assembly files are locked by the nodes, which means we can't use nodeReuse on repos that use custom local tasks.

Steps to reproduce

  1. Git clone https://github.com/aspnet/BuildTools/tree/6e2c86240ffd0056d202eb8ede1fba1e251804b4
  2. build.cmd /p:SkipTests=true
  3. build.cmd /p:SkipTests=true

Expected behavior

It would be great if nodeReuse was savvy enough to handle changes to task assemblies on disk.

Actual behavior

C:\Users\namc\.dotnet\x64\sdk\2.1.300-preview2-008396\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(137,5): warning MSB3026: Could not copy "obj\Release\netcoreapp2.0\RepoTasks.dll" to "C:\dev\aspnet\BuildTools\build\tasks\bin\publish\RepoTasks.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'C:\dev\aspnet\BuildTools\build\tasks\bin\publish\RepoTasks.dll' because it is being used by another process.  [C:\dev\aspnet\BuildTools\build\tasks\RepoTasks.csproj]

The process locking the file is

C:\Users\namc\.dotnet\x64\dotnet.exe "C:\Users\namc\.dotnet\x64\sdk\2.1.300-preview2-008396\MSBuild.dll" C:\Users\namc\.dotnet\x64\sdk\2.1.300-preview2-008396\MSBuild.dll /nologo /nodemode:1 /nodeReuse:true

Environment data

.NET Core SDK (reflecting any global.json):
 Version:   2.1.300-preview2-008396
 Commit:    400e670faa

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.16299
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Users\namc\.dotnet\x64\sdk\2.1.300-preview2-008396\

Workaround

build.cmd /nodeReuse:false

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions