Skip to content

Can't build with NativeAOT on Windows #21808

Open
@rolfbjarne

Description

@rolfbjarne

Apple platform

iOS

Framework version

net9.0-*

Affected platform version

.NET 9

Description

Publishing a project on Windows with PublishAot=true yields:

d:\AzDO_work\8\s\xamarin-macios\packages\microsoft.dotnet.ilcompiler\9.0.0\build\Microsoft.NETCore.Native.Unix.targets(115): error: 'xcrun' not found in PATH. Make sure 'xcrun' is available in PATH.

Steps to Reproduce

dotnet new ios
dotnet build /p:_IsPublishing=true /p:PublishAot=true /p:RuntimeIdentifier=ios-arm64 /p:ServerAddress=... /p:ServerUser=... /p:ServerPassword=...

There's a test case in this PR: #21800

Build logs

The binlog contains secrets, so I can provide it upon request (or re-create one).

The target that fails:

Target Name=SetupOSSpecificProps Project=d:\AzDO\_work\8\s\xamarin-macios\tests\dotnet\MySimpleApp\iOS\MySimpleApp.csproj
    UseSystemZlib = true
    FullRuntimeName = libRuntime.WorkstationGC
    CrossCompileRid = 
    CrossCompileRid = ios-arm64
    CrossCompileArch = 
    CrossCompileArch = arm64
    CrossCompileAbi = gnu
    Task "Exec" skipped, due to false condition; ('$(CrossCompileArch)' != '' and '$(SysRoot)' != '') was evaluated as ('arm64' != '' and '' != '').
    TargetTriple = 
    TargetTriple = arm64-linux-gnu
    IlcRPath = @executable_path
    EventPipeName = libeventpipe-disabled
    LinkStandardCPlusPlusLibrary = true
    VxSortSupportName = libRuntime.VxsortEnabled
    StandaloneGCSupportName = libstandalonegc-disabled
    AppleMinOSVersion = 12.2
    _AppleSdkName = iphoneos
    _AppleTripleOS = ios
    _AppleTripleAbi = macho
    TargetTriple = arm64-apple-ios12.2-macho
    Task "Error" skipped, due to false condition; ('$(_IsiOSLikePlatform)' == 'true' and ('$(_AppleSdkName)' == '' or '$(CrossCompileArch)' == '' or '$(_AppleTripleOS)' == ''  or '$(AppleMinOSVersion)' == '' or '$(_AppleTripleAbi)' == '')) was evaluated as ('true' == 'true' and ('iphoneos' == '' or 'arm64' == '' or 'ios' == ''  or '12.2' == '' or 'macho' == '')).
    Xcrun = xcrun
    _WhereXcrun = 0
    Exec
        Assembly = D:\AzDO\_work\8\s\xamarin-macios\tests\dotnet\Windows\bin\dotnet\packs\Microsoft.iOS.Sdk.net9.0_18.1\18.1.9220-ci.pr.gh21800\tools\msbuild\Xamarin.MacDev.Tasks.dll
        Parameters
            Command = command -v "xcrun"
            IgnoreExitCode = True
            StandardOutputImportance = Low
        CommandLineArguments = command -v "xcrun"
        'command' is not recognized as an internal or external command,
        operable program or batch file.
        The command "command -v "xcrun"" exited with code 9009.
        OutputProperties
            _WhereXcrun = 9009
    Error
        Assembly = D:\AzDO\_work\8\s\xamarin-macios\tests\dotnet\Windows\bin\dotnet\sdk\9.0.102\Microsoft.Build.Tasks.Core.dll
        Parameters
            Text = 'xcrun' not found in PATH. Make sure 'xcrun' is available in PATH.
        Errors
            d:\AzDO\_work\8\s\xamarin-macios\packages\microsoft.dotnet.ilcompiler\9.0.0\build\Microsoft.NETCore.Native.Unix.targets(115,5): 'xcrun' not found in PATH. Make sure 'xcrun' is available in PATH. [d:\AzDO\_work\8\s\xamarin-macios\tests\dotnet\MySimpleApp\iOS\MySimpleApp.csproj]

Metadata

Metadata

Assignees

Labels

bugIf an issue is a bug or a pull request a bug fixnativeaot

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions