Build.StagingDirectory and Build.ArtifactsStagingDirectory are the same directory
See original GitHub issueWhen I run my build with the PublishBuildArtifacts 1.0.4 task, I get errors like:
Executing the powershell script: C:\VSOAgent\tasks\PublishBuildArtifacts\1.0.4\PublishBuildArtifacts.ps1
Preparing artifact content in staging folder C:\VSOAgent\_work\1\a...
Copying all files from C:\VSOAgent\_work\1\a\layout\Microsoft.PythonTools to C:\VSOAgent\_work\1\a\layout\Microsoft.PythonTools
The process cannot access the file 'C:\VSOAgent\_work\1\a\layout\Microsoft.PythonTools\BuiltinScraper.py' because it is being used by another process.
Previously, the task would prepare artifacts in a staging folder that was different from Build.StagingDirectory
, which the docs suggest using for temporary build artifacts.
I’ve worked around it by inserting an extra directory level into my build outputs, so they don’t conflict with where PublishBuildArtifacts tries to copy them, but ISTM that Build.StagingDirectory
and Build.ArtifactsStagingDirectory
should refer to different folders.
Issue Analytics
- State:
- Created 8 years ago
- Comments:14 (10 by maintainers)
Top Results From Across the Web
The $(Build.ArtifactStagingDirectory) variable's value changes ...
StagingDirectory are interchangeable. This directory is purged before each new build, so you don't have to clean it up yourself. See Artifacts ...
Read more >Publish and download build artifacts - Azure Pipelines
Download artifacts produced by: Current build · Download type: Specific artifact · Artifact name: drop · Destination directory: $(System.
Read more >Understanding the directory structure created by Azure ...
Artifact staging directory. This is where the VS Build task results are stored in. The publish build artifacts task creates an artifact of ......
Read more >Azure DevOps Create Starter Pipeline - STACKSIMPLIFY
Create Azure Pipeline to Build and Push Docker Image to Azure Container ... files from System Default Working Directory to Build Artifact Staging...
Read more >Azure Pipeline Checkout Multiple Repositories
Workspace , Agent.BuildDirectory . Folder /home/vsts/work/1/a for Build.ArtifactStagingDirectory , Build.StagingDirectory .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So
Build.StagingDirectory
was removed? That’s fine, but we were just following the MSDN docs and not hardcoding paths “blindly”.It looks from the MD doc that we should change from
Build.StagingDirectory
toBuild.BinariesDirectory
.You shouldn’t rely on the name of any given folder, that is what the variables are for. We shortened the folder names to take up less path space and try to mitigate long path issues on windows. Further we added the Build.BinariesDirectory back for customers who were using the old build system and wanted to have a single place to redirect binaries to during their build. By default we let MSbuild put binaries where you have defined them to go. Trying to override that blindly causes unexpected results and hard to debug issues.
From: JoelKunze [mailto:notifications@github.com] Sent: Wednesday, October 14, 2015 10:03 AM To: Microsoft/vso-agent-tasks vso-agent-tasks@noreply.github.com Subject: Re: [vso-agent-tasks] Build.StagingDirectory and Build.ArtifactsStagingDirectory are the same directory (#614)
I have noticed a change that may be related… On the build agents I run, the Build.StagingDirectory changed from the documented value of “$(Agent.BuildDirectory)\Staging” to “$(Agent.BuildDirectory)\a”
This appears to coincide with an agent update that occurred about October 7th. There is an additional folder named “b” created in the $(Agent.BuildDirectory) now as well, but it appears empty at least at the point our builds are failing due to the staging folder name change.
— Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/vso-agent-tasks/issues/614#issuecomment-148059306.