Skip to content

Fix libs.tests build with gcc - #60757

Merged
jkoritzinsky merged 1 commit into
dotnet:mainfrom
am11:feature/native/gcc-build
Oct 26, 2021
Merged

jkoritzinsky merged 1 commit into
dotnet:mainfrom
am11:feature/native/gcc-build

Conversation

@am11

@am11 am11 commented Oct 22, 2021 •

Copy link
Copy Markdown
Member

All calls to DNNE's default compiler on unix hit the hardcoded compiler at: https://github.com/AaronRobinsonMSFT/DNNE/blob/492a2bb/src/msbuild/DNNE.BuildTasks/macOS.cs#L78.

This patch generalizes compiler selection based on what was passed to top-level script for regular builds (same as we do for cross builds).

Build command that this fixes:

$ DOCKER_URN="mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-gcc11-amd64-20210916125744-f42d766"
$ docker run $DOCKER_URN -v $(pwd):/runtime \
    /runtime/build.sh libs.tests -gcc

@ghost ghost added area-Infrastructure-libraries community-contribution Indicates that the PR has been added by a community member labels Oct 22, 2021
@ghost

ghost commented Oct 22, 2021

Copy link
Copy Markdown

Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details

All calls to DNNE's default compiler on unix hit the hardcoded compiler at: https://github.com/AaronRobinsonMSFT/DNNE/blob/492a2bb/src/msbuild/DNNE.BuildTasks/macOS.cs#L78.

This patch generalizes compiler selection based on what was passed to top-level script for regular builds (same as we do for cross builds).

Build command that this fixes:

$ DOCKER_URN=mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-gcc11-amd64-20210916125744-f42d766
$ docker run $DOCKER_URN -v $(pwd):/runtime \
    /runtime/build.sh libs.tests -gcc
Author: am11
Assignees: -
Labels:

area-Infrastructure-libraries, community-contribution

Milestone: -

@am11
am11 marked this pull request as ready for review October 22, 2021 06:49
@am11

am11 commented Oct 22, 2021

Copy link
Copy Markdown
Member Author

cc @AaronRobinsonMSFT, @jkoritzinsky, the error during the tests build was:

  Building native export: "clang" -g -O0 -shared -fpic -D DNNE_ASSEMBLY_NAME=Microsoft.Interop.Tests.NativeExports -D DNNE_COMPILE_AS_SOURCE -I "/root/.nuget/packages/dnne/1.0.26/tools/platform" -I "/root/.nuget/packages/microsoft.netcore.app.host.linux-x64/6.0.0-rc.1.21411.2/runtimes/linux-x64/native" -o "/runtime/artifacts/obj/NativeExports/net7.0-Debug/linux-x64/dnne/bin/Microsoft.Interop.Tests.NativeExportsNE.so" "/runtime/artifacts/obj/NativeExports/net7.0-Debug/linux-x64/dnne/Microsoft.Interop.Tests.NativeExports.g.c" "/root/.nuget/packages/dnne/1.0.26/tools/platform/platform.c" -lstdc++ "/root/.nuget/packages/microsoft.netcore.app.host.linux-x64/6.0.0-rc.1.21411.2/runtimes/linux-x64/native/libnethost.a" 
  /bin/sh: 2: /tmp/tmp3bf184f10e254116a369717cc2929d55.exec.cmd: clang: not found
/root/.nuget/packages/dnne/1.0.26/build/DNNE.targets(145,5): error MSB3073: The command ""clang" -g -O0 -shared -fpic -D DNNE_ASSEMBLY_NAME=Microsoft.Interop.Tests.NativeExports -D DNNE_COMPILE_AS_SOURCE -I "/root/.nuget/packages/dnne/1.0.26/tools/platform" -I "/root/.nuget/packages/microsoft.netcore.app.host.linux-x64/6.0.0-rc.1.21411.2/runtimes/linux-x64/native" -o "/runtime/artifacts/obj/NativeExports/net7.0-Debug/linux-x64/dnne/bin/Microsoft.Interop.Tests.NativeExportsNE.so" "/runtime/artifacts/obj/NativeExports/net7.0-Debug/linux-x64/dnne/Microsoft.Interop.Tests.NativeExports.g.c" "/root/.nuget/packages/dnne/1.0.26/tools/platform/platform.c" -lstdc++ "/root/.nuget/packages/microsoft.netcore.app.host.linux-x64/6.0.0-rc.1.21411.2/runtimes/linux-x64/native/libnethost.a" " exited with code 127. [/runtime/src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/NativeExports.csproj]

@am11
am11 force-pushed the feature/native/gcc-build branch 4 times, most recently from 1b0e2fe to 5a61b01 Compare October 26, 2021 16:34
@am11
am11 force-pushed the feature/native/gcc-build branch from 5a61b01 to 9386796 Compare October 26, 2021 17:38
@jkoritzinsky

Copy link
Copy Markdown
Member

The only leg that failed was a staging leg with a timeout, so I'll merge this in.

@jkoritzinsky
jkoritzinsky merged commit 7ac806d into dotnet:main Oct 26, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Infrastructure-libraries community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants