question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build.StagingDirectory and Build.ArtifactsStagingDirectory are the same directory

See original GitHub issue

When 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:closed
  • Created 8 years ago
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

4reactions
zoobacommented, Oct 14, 2015

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 to Build.BinariesDirectory.

3reactions
chrispatcommented, Oct 14, 2015

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found