Skip to content

[BUG]: UseDotNet@2 task cannot find global,json on MacOS VMs #21470

@prathikr

Description

@prathikr

New issue checklist

Task name

UseDotNet@2

Task version

2.263.0

Issue Description

In our pipelines we checkout a second repo in addition to the current repo running the pipeline. On MacOS VMs we are observing failure in finding the global.json file which blocks our pipelines from running. It works fine on Windows/Linux, the issue is only present for MacOS. If you comment out the checkout of test-data-shared, the macos pipeline runs and there's no issue with the UseDotNet step. So something is happening before the UseDotNet@2 step runs that is affected by the checkout step even though it hasn't run it yet

Please advise on how we can resolve this issue, thanks!

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

macos-14-arm64

Relevant log output

Starting: Use .NET SDK from global.json
==============================================================================
Task         : Use .NET Core
Description  : Acquires a specific version of the .NET Core SDK from the internet or the local cache and adds it to the PATH. Use this task to change the version of .NET Core used in subsequent tasks. Additionally provides proxy support.
Version      : 2.263.0
Author       : Microsoft Corporation
Help         : https://aka.ms/AA4xgy0
==============================================================================
##[error]Failed to find global.json at and inside path: /Users/runner/work/1/s
Finishing: Use .NET SDK from global.json

Full task logs with system.debug enabled

No response

Repro steps

Build.yml

#################################################################################
#                              OneBranch Pipelines                              #
# This pipeline was created by EasyStart from a sample located at:              #
#   https://aka.ms/obpipelines/easystart/samples                                #
# Documentation:  https://aka.ms/obpipelines                                    #
# Yaml Schema:    https://aka.ms/obpipelines/yaml/schema                        #
# Retail Tasks:   https://aka.ms/obpipelines/tasks                              #
# Support:        https://aka.ms/onebranchsup                                   #
#################################################################################

trigger: none # https://aka.ms/obpipelines/triggers

parameters: # parameters are shown up in ADO UI in a build queue time
- name: 'debug'
  displayName: 'Enable debug output'
  type: boolean
  default: false
- name: 'isRelease'
  displayName: 'Release build'
  type: boolean
  default: false

variables:
  CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
  DEBIAN_FRONTEND: noninteractive
  LinuxContainerImage: 'mcr.microsoft.com/onebranch/azurelinux/build:3.0' # https://eng.ms/docs/products/onebranch/infrastructureandimages/containerimages/linuximages/marinerazurelinux/azurelinux
  WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest' # https://aka.ms/obpipelines/containers
  VERSION: '0.9.0'
  PRERELEASE_IDENTIFIER: 'dev' # optional prerelease identifier (ie. alpha, beta, rc)

resources:
  repositories:
    - repository: templates
      type: git
      name: OneBranch.Pipelines/GovernedTemplates
      ref: refs/heads/main

extends:
  template: v2/OneBranch.NonOfficial.CrossPlat.yml@templates # https://aka.ms/obpipelines/templates
  parameters:
    git:
      fetchDepth: -1
    featureFlags:
      EnableCDPxPAT: false
      WindowsHostVersion: '1ESWindows2022'
      linuxEsrpSigning: true
    stages:
      - template: templates/stages.yml@self
        parameters:
          version: $(VERSION)
          isWinML: false
          isRelease: ${{ parameters.isRelease }}
          prereleaseIdentifier: $(PRERELEASE_IDENTIFIER)

templates/stages.yml

steps:
  - task: UseDotNet@2
    displayName: 'Use .NET SDK from global.json'
    inputs:
      packageType: 'sdk'
      useGlobalJson: true
  - checkout: git://windows.ai.toolkit/test-data-shared
    displayName: 'Checkout test-data-shared for Chat/Audio Client Tests'
    path: s/../test-data-shared # tells Azure Pipelines to check out the repository to a sibling directory of the main source directory (neutron-server)
    lfs: true
    persistCredentials: true

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions