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 (!)
1
I tested this in my organization (Geography is Europe), and macOS-14
took only 2 seconds to copy files of about 12MB using the CopyFiles@2
task.
You can try other image, macOS-13
or macOS-12
, and check if it takes a long time.
7
The problem seems to have been due to the contents of my .dmg
, which contains MyApp.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:
osascript -e 'tell application "Finder"'
-e "make alias file to (POSIX file "/Applications")
at (POSIX file "$PWD") with properties {name:"Applications"}"
-e 'end tell'
(For reference: I used to create the symlink like this: ln -s /Applications Applications
)