Skip to content

Commit

Permalink
Add Linux ARM64 Support (#768)
Browse files Browse the repository at this point in the history
* A workflow to build linux arm64 profiler (#742)

* Adds new profiler build job for arm64
Updates existing linuc job name to callout out arch
Updates conditionals to match new job names
Updates _profilerBuild deletion list to include new paths

* Updates build_functions.ps1 to support new folder names

* Removed -march from CMAKELIST

* Move to https and no caching for wget (#744)

* Netcore targeted integration tests (#752)

* Builds but some int tests fail locally; want to test in GHA

* Multi-targeted integration test project

* Conditional inclusion of WCF project

* Various Linux compatibility fixes, WIP

* Linux debugging, WIP, will not work on Windows

* Dynamic detection of Windows vs. Linux

* Added commands to remove expired cert. (#748)

* More windows/linux differences

* Make IsLinux a property

* Update mongodb tests (#747)

* Updates MongDb driver to v2.13.1.
Adds CoreIndexManger related tests to test against a net core test application.
Refactors tests.

* fixes failed test endpoints due to incorrectly exercises mongodb apis.

* Expands AsyncCursorsTests tests to NetCore test application.

* Expands IndexManagerTests tests to the netcore mongodb test application.

* Expands the rest of MongoDb tests to test against .net core test application.

* removes irrelevant ref.

* Remove RIDs from test app project files; handle Process.HasExited exception

* Attempt to solve .exe issue

Co-authored-by: Basil <tehbio@gmail.com>
Co-authored-by: Vu Tran <56414817+vuqtran88@users.noreply.github.com>

* Updates to produce Linux ARM64 artifacts (#745)

* ArtifactBuilder updates for new linux artifacts.

* Script + workflow updates for Linux ARM64 artifacts.

* Fixed Artifact default value.

* Fix for expired CA.

* Added commands to remove expired cert. (#748)

* Updated to handle multiple file checksums.

* Added Processor Architecture to Environment payload. (#755)

* Arm64 publishing for debian (#756)

* renaming deploy.yml to deploy_agent.yml to better call out its function

* Updates repoman-promote.bash for arm64

* Updates deploy-packages.bash for arm64

* Updates debain conf files for arm64

* Undo deploy rename

* Use named pipes for test app ipc (#762)

* Using named pipes for test application process control

* Get test using AspNetCoreMvcBasicRequestsApplication to pass on Windows

* Refactor test app lifecycle management into helper library

* Refactor lifecycle management for AspNetCore3BasicWebApiApp

* Refactored several apps to use shared lifecycle management code

* oops, missed a spot

* Refactor SerilogSumologic app

* Move net core attribute instrumentation tests to use ConsoleMF app

* Remove NetCoreAttributeInstrumentationFixture

* Unify framework and core attribute instrumentation tests

* Arm64 testing fixes.

* Arm64 testing fixes continued.

* Updates broken local build to match GHA (#764)

Removes old linux-release folder
Adds linux-arm64-release with the .so from the old folder
Adds linux-arm64-release with the so from https://github.com/newrelic/newrelic-dotnet-agent/actions/runs/1356682557
Updates profiler build.ps1 with the new-correct path (this is only used locally)

* Fix linux integration test failures (#766)

* Using named pipes for test application process control

* Get test using AspNetCoreMvcBasicRequestsApplication to pass on Windows

* Refactor test app lifecycle management into helper library

* Refactor lifecycle management for AspNetCore3BasicWebApiApp

* Refactored several apps to use shared lifecycle management code

* oops, missed a spot

* Refactor SerilogSumologic app

* Move net core attribute instrumentation tests to use ConsoleMF app

* Remove NetCoreAttributeInstrumentationFixture

* Unify framework and core attribute instrumentation tests

* Attempt to fix Linux issues with EnvironmentTests

* Add comment about nullable total ram field

* Update Rejit tests to use Path.Combine instead of explicit backslash

* Use Path.Combine in InterfaceDefaultsInstrumentationTests

* Use Path.Combine in DetachWrapperTests

* Use Path.Combine in AspNetCoreMvcAsyncTests

* Path.Combine ALL THE THINGS

* Somehow AspNet5BasicWebApiApplication wasn't in the solution so it was missed when making all the named pipe changes

* Fix framework/core inconsistency in headers tests

* Update test app for netcore thread profiling tests to .NET 5 to support Linux testing

* Add a method to skip tests on Linux and apply them to the logging tests

* Fix test class cleanup error for skipped test

* Added GHA step to run integration tests on linux-arm64 (#767)

* Added commands to remove expired cert. (#748)

* Update mongodb tests (#747)

* Updates MongDb driver to v2.13.1.
Adds CoreIndexManger related tests to test against a net core test application.
Refactors tests.

* fixes failed test endpoints due to incorrectly exercises mongodb apis.

* Expands AsyncCursorsTests tests to NetCore test application.

* Expands IndexManagerTests tests to the netcore mongodb test application.

* Expands the rest of MongoDb tests to test against .net core test application.

* removes irrelevant ref.

* Fix agent hang on startup. (#753)

* Adds "System.Net.HttpWebRequest.GetResponse" to the DeferInitializationOnTheseMethods list.

Removes confusing/incorrect logging message.

* Update CHANGELOG.md

* fixes grammar.

* Re-enable unbounded tests in workflow (#765)

* Added GHA step to run integration tests on linux-arm64.

* Updated CHANGELOG.md

Co-authored-by: Vu Tran <56414817+vuqtran88@users.noreply.github.com>
Co-authored-by: Alex Hemsath <57361211+nr-ahemsath@users.noreply.github.com>

* CHANGELOG.md update.

Co-authored-by: Jacob Affinito <jaffinito@newrelic.com>
Co-authored-by: Alex Hemsath <57361211+nr-ahemsath@users.noreply.github.com>
Co-authored-by: Vu Tran <56414817+vuqtran88@users.noreply.github.com>
  • Loading branch information
4 people authored Oct 26, 2021
1 parent 4aca03d commit 3ca307c
Show file tree
Hide file tree
Showing 129 changed files with 1,106 additions and 1,236 deletions.
158 changes: 147 additions & 11 deletions .github/workflows/all_solutions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ jobs:
Remove-Item -Path "${{ github.workspace }}\src\Agent\_profilerBuild\*.*" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "${{ github.workspace }}\src\Agent\_profilerBuild\x64-Release" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "${{ github.workspace }}\src\Agent\_profilerBuild\x86-Release" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "${{ github.workspace }}\src\Agent\_profilerBuild\linux-release" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "${{ github.workspace }}\src\Agent\_profilerBuild\linux-x64-release" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "${{ github.workspace }}\src\Agent\_profilerBuild\linux-arm64-release" -Recurse -Force -ErrorAction SilentlyContinue
shell: powershell

- name: Build x64
Expand All @@ -76,9 +77,9 @@ jobs:
path: ${{ github.workspace }}\src\Agent\_profilerBuild\**\*
if-no-files-found: error

build-linux-profiler:
build-linux-x64-profiler:
needs: cancel-previous-workflow-runs
name: Build Linux Profiler
name: Build Linux x64 Profiler
runs-on: ubuntu-18.04

env:
Expand All @@ -93,10 +94,11 @@ jobs:

- name: Clean out _profilerBuild directory
run: |
rm -f ${{ github.workspace }}/src/Agent/_profilerBuild/*.*
rm -rf ${{ github.workspace }}/src/Agent/_profilerBuild/linux-release
rm -rf ${{ github.workspace }}/src/Agent/_profilerBuild/x64-Release
rm -rf ${{ github.workspace }}/src/Agent/_profilerBuild/x86-Release
rm -f ${{ github.workspace }}/src/Agent/_profilerBuild/*.* || true
rm -rf ${{ github.workspace }}/src/Agent/_profilerBuild/linux-x64-release || true
rm -rf ${{ github.workspace }}/src/Agent/_profilerBuild/linux-arm64-release || true
rm -rf ${{ github.workspace }}/src/Agent/_profilerBuild/x64-Release || true
rm -rf ${{ github.workspace }}/src/Agent/_profilerBuild/x86-Release || true
shell: bash

- name: Build Linux Profler
Expand All @@ -108,8 +110,73 @@ jobs:

- name: Move Profiler to staging folder
run: |
mkdir --parents ${{ github.workspace }}/src/Agent/_profilerBuild/linux-release/
mv -f ${{ env.profiler_path }}/libNewRelicProfiler.so ${{ github.workspace }}/src/Agent/_profilerBuild/linux-release/libNewRelicProfiler.so
mkdir --parents ${{ github.workspace }}/src/Agent/_profilerBuild/linux-x64-release/
mv -f ${{ env.profiler_path }}/libNewRelicProfiler.so ${{ github.workspace }}/src/Agent/_profilerBuild/linux-x64-release/libNewRelicProfiler.so
shell: bash

- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:
name: profiler
path: ${{ github.workspace }}/src/Agent/_profilerBuild/
if-no-files-found: error

build-linux-arm64-profiler:
needs: cancel-previous-workflow-runs
name: Build Linux ARM64 Profiler
runs-on: ubuntu-18.04

env:
profiler_path: ${{ github.workspace }}/src/Agent/NewRelic/Profiler

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Clean out _profilerBuild directory
run: |
rm -f ${{ github.workspace }}/src/Agent/_profilerBuild/*.* || true
rm -rf ${{ github.workspace }}/src/Agent/_profilerBuild/linux-x64-release || true
rm -rf ${{ github.workspace }}/src/Agent/_profilerBuild/linux-arm64-release || true
rm -rf ${{ github.workspace }}/src/Agent/_profilerBuild/x64-Release || true
rm -rf ${{ github.workspace }}/src/Agent/_profilerBuild/x86-Release || true
shell: bash

- uses: uraimo/run-on-arch-action@v2.0.5
name: Run commands
id: runcmd
with:
arch: aarch64
distro: ubuntu18.04
githubToken: ${{ github.token }}
install: |
apt-get update -q -y
apt-get install -q -y wget curl git dos2unix software-properties-common make binutils libc++-dev clang-3.9 lldb-3.9 build-essential
echo "deb https://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main" | tee /etc/apt/sources.list.d/llvm.list
wget --no-cache --no-cookies -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
mkdir /root/git
cd /root/git
git clone --branch release/3.0 https://github.com/dotnet/coreclr.git
curl -sSL https://virtuoso-testing.s3.us-west-2.amazonaws.com/cmake-3.9.0-rc3-aarch64.tar.gz | tar -xzC ~
chmod 777 ~/cmake-3.9.0-rc3-aarch64/bin/cmake
ln -s ~/cmake-3.9.0-rc3-aarch64/bin/cmake /usr/bin/cmake || true
rm /usr/bin/cc || true
ln -s /usr/bin/clang-3.9 /usr/bin/cc
rm /usr/bin/c++ || true
ln -s /usr/bin/clang++-3.9 /usr/bin/c++
dockerRunArgs: |
--volume "${{ env.profiler_path }}:/profiler"
run: |
cd /profiler
chmod 777 ./linux/build_profiler.sh
./linux/build_profiler.sh
- name: Move Profiler to staging folder
run: |
mkdir --parents ${{ github.workspace }}/src/Agent/_profilerBuild/linux-arm64-release/
mv -f ${{ env.profiler_path }}/libNewRelicProfiler.so ${{ github.workspace }}/src/Agent/_profilerBuild/linux-arm64-release/libNewRelicProfiler.so
shell: bash

- name: Archive Artifacts
Expand All @@ -121,7 +188,7 @@ jobs:

# This builds both FullAgent and MSIInstaller since MSIInstaller requires FullAgent artifacts.
build-test-fullagent-msi:
needs: [ build-windows-profiler, build-linux-profiler ]
needs: [ build-windows-profiler, build-linux-x64-profiler, build-linux-arm64-profiler ]
name: Build and Test FullAgent and MSIInstaller
runs-on: windows-2019

Expand All @@ -146,7 +213,8 @@ jobs:
Remove-Item -Path "${{ github.workspace }}\src\Agent\_profilerBuild\*.*" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "${{ github.workspace }}\src\Agent\_profilerBuild\x64-Release" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "${{ github.workspace }}\src\Agent\_profilerBuild\x86-Release" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "${{ github.workspace }}\src\Agent\_profilerBuild\linux-release" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "${{ github.workspace }}\src\Agent\_profilerBuild\linux-x64-release" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "${{ github.workspace }}\src\Agent\_profilerBuild\linux-arm64-release" -Recurse -Force -ErrorAction SilentlyContinue
shell: powershell

- name: Download Profiler Artifacts Before Agent Build
Expand Down Expand Up @@ -199,6 +267,7 @@ jobs:
${{ github.workspace }}\src\Agent\newrelichome_x64
${{ github.workspace }}\src\Agent\newrelichome_x64_coreclr
${{ github.workspace }}\src\Agent\newrelichome_x64_coreclr_linux
${{ github.workspace }}\src\Agent\newrelichome_arm64_coreclr_linux
${{ github.workspace }}\src\Agent\newrelichome_x86
${{ github.workspace }}\src\Agent\newrelichome_x86_coreclr
if-no-files-found: error
Expand Down Expand Up @@ -552,6 +621,73 @@ jobs:
path: C:\IntegrationTestWorkingDirectory\TestResults\**\*TestResults.xml
if-no-files-found: error

run-integration-tests-linux-arm64:
needs: build-test-fullagent-msi
name: Run IntegrationTests linux-arm64
runs-on: ubuntu-18.04
if: false

env:
test_path: ${{ github.workspace }}/tests/Agent/IntegrationTests/IntegrationTests/TestResults

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Download Agent Home Folders
uses: actions/download-artifact@v2
with:
name: homefolders
path: src/Agent

- name: Run test commands
uses: uraimo/run-on-arch-action@v2.0.5
with:
arch: aarch64
distro: ubuntu18.04
githubToken: ${{ github.token }}

env: |
test_secrets: '${{ secrets.TEST_SECRETS }}'
NR_DOTNET_TEST_SAVE_WORKING_DIRECTORY: 1
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
install: |
apt-get update -q -y && apt-get install -q -y curl
export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1
mkdir -p /usr/share/dotnet
curl -sSL https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.818/dotnet-sdk-2.1.818-linux-arm64.tar.gz | tar -xzC /usr/share/dotnet
curl -sSL https://dotnetcli.azureedge.net/dotnet/Sdk/3.1.414/dotnet-sdk-3.1.414-linux-arm64.tar.gz | tar -xzC /usr/share/dotnet
curl -sSL https://dotnetcli.azureedge.net/dotnet/Sdk/5.0.401/dotnet-sdk-5.0.401-linux-arm64.tar.gz | tar -xzC /usr/share/dotnet
ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet
dotnet help
dockerRunArgs: |
--volume "${{ env.test_path }}:/tmp/IntegrationTestWorkingDirectory"
run: |
cd tests/Agent/IntegrationTests/IntegrationTests
echo $test_secrets | dotnet user-secrets set --project "../Shared"
dotnet test -f netcoreapp3.1 -c Release -l "trx" --filter "FullyQualifiedName~ApiCallsTestsCore|FullyQualifiedName~InfiniteTracingNetCoreLatestTests"
- name: Archive IntegrationTestWorkingDirectory on Failure
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: integration-test-artifacts-linux-arm64
path: ${{ env.test_path }}/**/*
if-no-files-found: error

- name: Archive Test Artifacts
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: integration-test-artifacts-linux-arm64
path: ${{ env.test_path }}/*.trx
if-no-files-found: error

run-unbounded-tests:
needs: [build-unbounded-tests]
name: Run Unbounded Tests
Expand Down
7 changes: 5 additions & 2 deletions build/ArtifactBuilder/Artifacts/Artifact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ public Artifact(string name)
protected string PackageDirectory;
protected string OutputDirectory;

public void Build()
public void Build(bool clearOutput = true)
{
FileHelpers.DeleteDirectories(StagingDirectory, OutputDirectory);
FileHelpers.DeleteDirectories(StagingDirectory);
if (clearOutput)
FileHelpers.DeleteDirectories(OutputDirectory);

InternalBuild();
}

Expand Down
19 changes: 16 additions & 3 deletions build/ArtifactBuilder/Artifacts/DownloadSiteArtifact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ protected override void InternalBuild()
}

//Linux packages
CopyFileAndChecksum($@"{RepoRootDirectory}\build\BuildArtifacts\LinuxDeb", "*.deb", OutputDirectory);
CopyFileAndChecksum($@"{RepoRootDirectory}\build\BuildArtifacts\LinuxRpm", "*.rpm", OutputDirectory);
CopyFileAndChecksum($@"{RepoRootDirectory}\build\BuildArtifacts\LinuxTar", "*.tar.gz", OutputDirectory);
CopyAllFilesAndChecksum($@"{RepoRootDirectory}\build\BuildArtifacts\LinuxDeb", "*.deb", OutputDirectory);
CopyAllFilesAndChecksum($@"{RepoRootDirectory}\build\BuildArtifacts\LinuxRpm", "*.rpm", OutputDirectory);
CopyAllFilesAndChecksum($@"{RepoRootDirectory}\build\BuildArtifacts\LinuxTar", "*.tar.gz", OutputDirectory);

//Copying Readme.txt file
FileHelpers.CopyFile($@"{PackageDirectory}\Readme.txt", $@"{OutputDirectory}");
Expand All @@ -83,6 +83,19 @@ private void CopyFileAndChecksum(string sourceDirectory, string sourceFileSearch
File.Copy($@"{sourceDirectory}\{SourceShaFileName}", $@"{ShaDirectory}\{destinationFileName}{ShaFileExtension}");
}

private void CopyAllFilesAndChecksum(string sourceDirectory, string sourceFileSearchPattern, string destinationDirectory)
{
var files = Directory.GetFiles(sourceDirectory, sourceFileSearchPattern);

foreach (var filePath in files)
{
var fileName = Path.GetFileName(filePath);

File.Copy(filePath, $@"{destinationDirectory}\{fileName}");
File.Copy($"{filePath}.sha256", $@"{ShaDirectory}\{fileName}.sha256");
}
}

private void CreateSHAValuesTableMarkdownFile(string shaDirectory, string outputFilename)
{
var outputLines = new List<string>() { { "### Checksums" }, { "| File | SHA - 256 Hash |" }, { "| ---| ---|" } };
Expand Down
2 changes: 1 addition & 1 deletion build/ArtifactBuilder/Artifacts/LinuxPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected override void InternalBuild()

//Generate the checksum file based on the Linux standards for the checksum contents: <checksum_value> <checksum_mode><filename>
//<checksum_mode> is either a ' ' for text mode or '*' for binary mode.
File.WriteAllText($@"{OutputDirectory}\checksum.sha256", $"{FileHelpers.GetSha256Checksum(packagePath)} *{fileInfo.Name}");
File.WriteAllText($@"{OutputDirectory}\{fileInfo.Name}.sha256", $"{FileHelpers.GetSha256Checksum(packagePath)} *{fileInfo.Name}");
}
}
}
2 changes: 2 additions & 0 deletions build/ArtifactBuilder/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ static int Main(string[] args)
private static void BuildLinuxPackages()
{
new LinuxPackage("LinuxDeb", "_amd64", "deb").Build();
new LinuxPackage("LinuxDeb", "_arm64", "deb").Build(clearOutput: false);
new LinuxPackage("LinuxRpm", ".x86_64", "rpm").Build();
new LinuxPackage("LinuxTar", "_amd64", "tar.gz").Build();
new LinuxPackage("LinuxTar", "_arm64", "tar.gz").Build(clearOutput: false);
}

private static void BuildDownloadSite(string[] args)
Expand Down
19 changes: 12 additions & 7 deletions build/Linux/build/deb/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/bash

PACKAGE_NAME='newrelic-netcore20-agent'
ARCH='amd64'
AGENT_HOMEDIR='newrelichome_x64_coreclr_linux'
PACKAGE_NAME='newrelic-netcore20-agent'

if [ "$1" = "arm64" ]; then
ARCH="arm64"
AGENT_HOMEDIR='newrelichome_arm64_coreclr_linux'
fi

if [ -z "$AGENT_VERSION" ]; then
# Get version from agent core dll
Expand All @@ -15,11 +21,10 @@ if [ -z "$AGENT_VERSION" ]; then
fi

echo "AGENT_VERSION=${AGENT_VERSION}"
INSTALL_ROOT=/tmp/${PACKAGE_NAME}
ARCH='amd64'
INSTALL_ROOT=/tmp/${ARCH}/${PACKAGE_NAME}
PACKAGE_FILE_BASENAME="${PACKAGE_NAME}_${AGENT_VERSION}_$ARCH"

mkdir ${INSTALL_ROOT} && mkdir ${INSTALL_ROOT}/DEBIAN
mkdir /tmp/${ARCH} && mkdir ${INSTALL_ROOT} && mkdir ${INSTALL_ROOT}/DEBIAN

INSTALL_LOCATION=${INSTALL_ROOT}/usr/local/${PACKAGE_NAME}

Expand Down Expand Up @@ -51,9 +56,9 @@ cp /deb/agentinfo.json .

# create debian package
dpkg-deb --build ${INSTALL_ROOT}
cp /tmp/${PACKAGE_NAME}.deb /release/${PACKAGE_FILE_BASENAME}.deb
cp /tmp/${ARCH}/${PACKAGE_NAME}.deb /release/${PACKAGE_FILE_BASENAME}.deb
# create a copy of the agent that only uses the package name to make it easy to link to builds
cp /tmp/${PACKAGE_NAME}.deb /release/${PACKAGE_NAME}.deb
cp /tmp/${ARCH}/${PACKAGE_NAME}.deb /release/${PACKAGE_NAME}_${ARCH}.deb

# agentinfo.json for tar.gz
cp /common/agentinfo.json .
Expand All @@ -63,4 +68,4 @@ tar cvfz /release/${PACKAGE_FILE_BASENAME}.tar.gz -C ${INSTALL_LOCATION} ..

if [ $? -gt 0 ] ; then
echo "::error Docker run exited with code: $?"
fi
fi
2 changes: 1 addition & 1 deletion build/Linux/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.8"
services:
build_deb:
build: ./build/deb
command: bash -c "dos2unix /deb/build.sh && chmod 755 -R /deb && chmod 777 /deb/build.sh && /deb/build.sh"
command: bash -c "dos2unix /deb/build.sh && chmod 755 -R /deb && chmod 777 /deb/build.sh && /deb/build.sh && /deb/build.sh arm64"
volumes:
- ../../src/_build/CoreArtifacts:/release
- ../../src/Agent:/data
Expand Down
12 changes: 9 additions & 3 deletions build/build_functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function Copy-AgentRoot {
[Parameter(Mandatory=$true)][string]$Destination,
[Parameter(Mandatory=$true)][ValidateSet("Debug","Release")][string]$Configuration,
[Parameter(Mandatory=$true)][ValidateSet("Framework","Core")][string]$Type,
[Parameter(Mandatory=$true)][ValidateSet("x64","x86")][string]$Architecture,
[Parameter(Mandatory=$true)][ValidateSet("x64","x86","ARM64")][string]$Architecture,
[switch]$Linux
)

Expand All @@ -155,8 +155,14 @@ function Copy-AgentRoot {

$grpcDir = Get-GrpcPackagePath $RootDirectory
if ($Linux) {
Copy-Item -Path "$grpcDir\runtimes\linux-x64\native\libgrpc_csharp_ext.x64.so" -Destination "$Destination" -Force
Copy-Item -Path "$RootDirectory\src\Agent\_profilerBuild\linux-release\libNewRelicProfiler.so" -Destination "$Destination" -Force
if ($Architecture -like "x64") {
Copy-Item -Path "$grpcDir\runtimes\linux-x64\native\libgrpc_csharp_ext.x64.so" -Destination "$Destination" -Force
Copy-Item -Path "$RootDirectory\src\Agent\_profilerBuild\linux-x64-release\libNewRelicProfiler.so" -Destination "$Destination" -Force
}
if ($Architecture -like "ARM64") {
Copy-Item -Path "$grpcDir\runtimes\linux-arm64\native\libgrpc_csharp_ext.arm64.so" -Destination "$Destination" -Force
Copy-Item -Path "$RootDirectory\src\Agent\_profilerBuild\linux-arm64-release\libNewRelicProfiler.so" -Destination "$Destination" -Force
}
}
else {
Copy-Item -Path "$grpcDir\runtimes\win-x86\native\*.dll" -Destination "$Destination" -Force
Expand Down
Loading

0 comments on commit 3ca307c

Please sign in to comment.