Skip to content

SB: redist.proj tries to run target crossgen2 during cross-build #115002

Closed
@am11

Description

@am11

I'm seeing Exec format error during the cross source-build at sdk build step (which comes after building all other repos including runtime):

Command: /prep-source-build.sh && ./build.sh --clean-while-building -sb -p:TargetOS=linux -p:TargetArchitecture=riscv64 -p:Crossbuild=true

/dotnet/src/sdk/src/Layout/redist/targets/Crossgen.targets(153,5): error MSB6003: The specified task executable "crossgen2" could not be run. System.ComponentModel.Win32Exception (8): An error occurred trying to start process '/dotnet/src/sdk/artifacts/sb/package-cache/microsoft.netcore.app.crossgen2.linux-riscv64/10.0.0-preview.4.25217.10/tools/crossgen2' with working directory '/dotnet/src/sdk/src/Layout/redist'. Exec format error [/dotnet/src/sdk/src/Layout/redist/redist.csproj]

The workaround is to disable crossgen2 by passing -p:SkipUsingCrossgen=true, but then it doesn't include it in the layout at <install prefix>/packs:

am11@k1:~$ mkdir ~/.dotnet10
am11@k1:~$ tar xzf /tmp/assets/Release/dotnet-sdk-10.0.100-preview.4.25219.1-linux-riscv64.tar.gz -C ~/.dotnet10
am11@k1:~$ ls ~/.dotnet10/packs/
Microsoft.AspNetCore.App.Ref
Microsoft.NETCore.App.Host.linux-riscv64
Microsoft.NETCore.App.Runtime.linux-riscv64
runtime.linux-riscv64.Microsoft.DotNet.ILCompiler
Microsoft.AspNetCore.App.Runtime.linux-riscv64
Microsoft.NETCore.App.Ref
NETStandard.Library.Ref

It should be running the host crossgen2 (esp. with CrossBuild=true) and adding targets' crossgen2 in <install prefix>/packs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions