I’ve recently migrated some of my build steps to Microsoft-Hosted mac agents.
After creating .dmg
of my app (about 10MB), I copy it into the Artifacts Staging di3rectory. This used to take seconds on my self-hosted mac agents, but now consistently takes about 15 minutes!
This should be a local file copy operation and should be much quicker. Has anyone experienced something similar?
Here’s my YAML in case
- job: MacOSApp
pool:
name: 'Azure Pipelines' # Use Microsoft Agent
vmImage: 'macOS-14'
steps:
- task: CopyFiles@2
displayName: 'Copy App'
inputs:
SourceFolder: 'deploy/build-app/output'
Contents: 'MyApp.dmg'
TargetFolder: '$(build.artifactstagingdirectory)'
CleanTargetFolder: false
OverWrite: true
flattenFolders: true
preserveTimestamp: true
Agent version 3.241.0
, image version: 20240707.1
I’ve tried without success:
- running on macos-13 or macos-12
- turning off
flattenFolders
andpreserveTimestamp
options
UPDATE: I’ve tried adding a ArchiveFiles@2
step to create a .zip and then copying thart. In this case, the ArchiveFiles@2
step times out after 50 minutes (!)
2
Answers
The problem seems to have been due to the contents of my
.dmg
, which containsMyApp.app
and a symbolic link to/Applications
(so users can drag App to install). If I remove the link, the copy operation behaves normally.I found a workaround: Use a Finder 'alias' instead of symbolic link.
I'm running the following in a
bash
step to create an alias in the current working directory:(For reference: I used to create the symlink like this:
ln -s /Applications Applications
)I tested this in my organization (Geography is Europe), and
macOS-14
took only 2 seconds to copy files of about 12MB using theCopyFiles@2
task.You can try other image,
macOS-13
ormacOS-12
, and check if it takes a long time.