Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: PublishCodeCoverageResults@2 failing with Syntax error: word unexpected (expecting ")") on ARM64 #19346

Open
4 of 7 tasks
mitoihs opened this issue Dec 6, 2023 · 2 comments

Comments

@mitoihs
Copy link

mitoihs commented Dec 6, 2023

New issue checklist

Task name

PublishCodeCoverageResults

Task version

2

Issue Description

The task stopped working after changing the agent to run on Ubuntu 22.04 ARM64 instead of the previous AmazonLinux2 x64. Looking at the path of the used tool (with linux-x64 in it) it seems like the task is not compiled to run on ARM64 machines.

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

Ubuntu 22.04 ARM64

Relevant log output

/anonymized/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console /anonymized/cobertura-coverage.xml --reportDirectory /anonymized --sourceDirectory /anonymized/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console: 9: Syntax error: word unexpected (expecting ")")

Full task logs with system.debug enabled

    ##[debug]loading INPUT_SUMMARYFILELOCATION
    ##[debug]loading INPUT_PATHTOSOURCES
    ##[debug]loading INPUT_FAILIFCOVERAGEEMPTY
    ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
    ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
    ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
    ##[debug]loading SECRET_SYSTEM_ACCESSTOKEN
    ##[debug]found 1 paths
    ##[debug]applying include pattern
    ##[debug]adjustedPattern: '/anonymized/_work/1/s/anonymized/test-results-exports/cobertura-coverage.xml'
    ##[debug]1 matches
    ##[debug]1 final results
    Found 1 result(s) matching pattern: anonymized/test-results-exports/cobertura-coverage.xml
    /anonymized/_work/1/s/anonymized/test-results-exports/cobertura-coverage.xml
    ##[debug]Agent.Version=3.230.0
    ##[debug]Agent.TempDirectory=/anonymized/_work/_temp
    ##[debug]which 'dotnet'
    ##[debug]found: '/anonymized/_work/_tool/dotnet/dotnet'
    ##[debug]which '/anonymized/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console'
    ##[debug]found: '/anonymized/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console'
    ##[debug]/anonymized/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console arg: /anonymized/_work/1/s/anonymized/test-results-exports/cobertura-coverage.xml
    ##[debug]/anonymized/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console arg: --reportDirectory
    ##[debug]/anonymized/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console arg: /anonymized/_work/_temp/dc586d42-5197-467c-8b83-12dd7d586bd1
    ##[debug]/anonymized/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console arg: --sourceDirectory
    ##[debug]/anonymized/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console arg: anonymized
    ##[debug]SystemVssConnection auth param AccessToken = ***
    ##[debug]System.TeamFoundationCollectionUri=anonymized
    ##[debug]Build.BuildId=3337650
    ##[debug]Build.ContainerId=5161874
    ##[debug]Agent.TempPath=undefined
    ##[debug]System.TeamProjectId=anonymized
    ##[debug]PIPELINES_COVERAGEPUBLISHER_DEBUG=undefined
    ##[debug]exec tool: /anonymized/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console
    ##[debug]arguments:
    ##[debug]   /anonymized/_work/1/s/anonymized/test-results-exports/cobertura-coverage.xml
    ##[debug]   --reportDirectory
    ##[debug]   /anonymized/_work/_temp/dc586d42-5197-467c-8b83-12dd7d586bd1
    ##[debug]   --sourceDirectory
    ##[debug]   anonymized
    /anonymized/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console /anonymized/_work/1/s/anonymized/test-results-exports/cobertura-coverage.xml --reportDirectory /anonymized/_work/_temp/dc586d42-5197-467c-8b83-12dd7d586bd1 --sourceDirectory anonymized
    /anonymized/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console: 9: Syntax error: word unexpected (expecting ")")
##[debug]task result: Failed
##[debug]Processed: ##vso[task.complete result=Failed;]
##[debug]Exit code 2 received from tool '/anonymized/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console'
##[debug]STDIO streams have closed for tool '/anonymized/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.229.0/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console'
Finishing: Publish code coverage

Repro steps

No response

@tscott-au
Copy link

PublishCodeCoverageResults@2 is also failing on our AWS ARM64 ec2 self hosted instance.
PublishCodeCoverageResults@1 works perfectly on same self hosted instance.

Error reported by task:
.../linux-x64/CoveragePublisher.Console: cannot execute binary file

Starting: Publish code coverage
==============================================================================
Task         : Publish code coverage results v2
Description  : Publish any of the code coverage results from a build
Version      : 2.238.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-code-coverage-results
==============================================================================
Found 3 result(s) matching pattern: test-all-results/*-*-*-*-*/coverage.cobertura.xml
/home/ec2-user/azure_devops_build_agent/_work/3/s/test-all-results/1f46d431-56e9-4574-b685-39e91a23287b/coverage.cobertura.xml
/home/ec2-user/azure_devops_build_agent/_work/3/s/test-all-results/2fdde070-8639-4af1-9dae-601619be18cf/coverage.cobertura.xml
/home/ec2-user/azure_devops_build_agent/_work/3/s/test-all-results/c1bab804-ac5f-4526-84f8-463e77051c36/coverage.cobertura.xml
/home/ec2-user/azure_devops_build_agent/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.238.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console /home/ec2-user/azure_devops_build_agent/_work/3/s/test-all-results/1f46d431-56e9-4574-b685-39e91a23287b/coverage.cobertura.xml /home/ec2-user/azure_devops_build_agent/_work/3/s/test-all-results/2fdde070-8639-4af1-9dae-601619be18cf/coverage.cobertura.xml /home/ec2-user/azure_devops_build_agent/_work/3/s/test-all-results/c1bab804-ac5f-4526-84f8-463e77051c36/coverage.cobertura.xml --reportDirectory /home/ec2-user/azure_devops_build_agent/_work/_temp/b7605fba-425b-4998-b8c4-de64850af146
/home/ec2-user/azure_devops_build_agent/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.238.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console: /home/ec2-user/azure_devops_build_agent/_work/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.238.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console: cannot execute binary file

Finishing: Publish code coverage

@luca-drf
Copy link

luca-drf commented Oct 2, 2024

Similar problem as @tscott-au on our self hosted AWS EC2 ARM64 instance running Ubuntu 22.04.

Starting: Publish Coverage Report
==============================================================================
Task         : Publish code coverage results v2
Description  : Publish any of the code coverage results from a build
Version      : 2.242.1
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-code-coverage-results
==============================================================================
Found 1 result(s) matching pattern: /__w/15/s/**/coverage.xml
/__w/15/s/coverage.xml
/__w/_tasks/PublishCodeCoverageResults_2a7ebc54-c13e-490e-81a5-d7561ab7cd97/2.242.1/node_modules/coveragepublisher/CoveragePublisher/linux-x64/CoveragePublisher.Console /__w/15/s/coverage.xml --reportDirectory /__w/_temp/5a1a9d1e-5c11-4a43-bf62-b8fbfcd45aca
qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory


Finishing: Publish Coverage Report

In our case, we're performing some cross compilation tasks so we've set up qemu with binfmt.

Looks like when CoveragePublisher.Console is invoked, the system is trying to find x86_64 libs, however UseDotNet@2 tasks (correctly) installs ARM64 .NET libs:

Starting: Use .NET Core sdk 7.0.x
==============================================================================
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.246.1
Author       : Microsoft Corporation
Help         : https://aka.ms/AA4xgy0
==============================================================================
Tool to install: .NET Core sdk version 7.0.x.
Found version 7.0.410 in channel 7.0 for user specified version spec: 7.0.x
get-os-distro: Error: Distribution specific OS name and version could not be detected: UName = Linux
Version 7.0.410 was not found in cache.
Getting URL to download .NET Core sdk version: 7.0.410.
Detecting OS platform to find correct download package for the OS.
/__w/_tasks/UseDotNet_b0ce7256-7898-45d3-9cb5-176b752bfea6/2.246.1/externals/get-os-distro.sh
Primary:linux-arm64
Legacy:-arm64
Detected platform (Primary): linux-arm64
Detected platform (Legacy): -arm64
Downloading: https://download.visualstudio.microsoft.com/download/pr/3e408891-74af-4ccb-9ce8-895f6806a97d/3a589bbf6e264059544cef47be672540/dotnet-sdk-7.0.410-linux-arm64.tar.gz
Extracting downloaded package /__w/_temp/cabd1c53-2462-46e7-ba05-1f5aa68a312e.
Extracting archive
/usr/bin/tar xC /__w/_temp/849df373-5580-489f-aebe-5909f824f225 -f /__w/_temp/cabd1c53-2462-46e7-ba05-1f5aa68a312e

Successfully installed .NET Core sdk version 7.0.410.
Creating global tool path and pre-pending to PATH.
Finishing: Use .NET Core sdk 7.0.x

IMO the solution would be shipping CoveragePublisher.Console ARM64 binaries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants