dotnet / runtimelab

This repo is for experimentation and exploring new ideas that may or may not make it into the main dotnet/runtime repo.
MIT License
1.41k stars 197 forks source link

[NativeAOT-LLVM, Wasm] Cannot marshal multiple arrays by reference #2233

Closed RReverser closed 1 year ago

RReverser commented 1 year ago

Minimal repro:

[DllImport("*")]
public static extern void pass_two_arrays(
    [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] in byte[] a,
    uint a_len,
    [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] in byte[] b,
    uint b_len
);

...

pass_two_arrays(
    new byte[] { 1, 2, 3 },
    3,
    new byte[] { 4, 5, 6 },
    3
);

When built with 7.0.0-preview.5.23113.1 for the Wasm target, this results in broken LLVM IR:

Common Language Runtime detected an invalid program. ([Sample]Sample.pass_two_arrays(uint8[]&,uint32,uint8[]&,uint32))
  Global is referenced by parentless instruction!
  void (i8*, i8*)* @corert.throwifnull
  ; ModuleID = 'netscripten'
    invoke addrspace(0) void @corert.throwifnull(i8* <badref>, i8* %load_loc0_10)
            to label %Trap unwind label %LandingPad0
  Global is referenced by parentless instruction!
  void (i8*, i8*)* @corert.throwifnull
  ; ModuleID = 'netscripten'
    invoke addrspace(0) void @corert.throwifnull(i8* <badref>, i8* %load_loc0_27)
            to label %Trap unwind label %LandingPad0
  Global is referenced by parentless instruction!
  void (i8*, i8*)* @corert.throwifnull
  ; ModuleID = 'netscripten'
    invoke addrspace(0) void @corert.throwifnull(i8* <badref>, i8* %load_loc2_54)
            to label %Trap unwind label %LandingPad0
  Global is referenced by parentless instruction!
  void (i8*, i8*)* @corert.throwifnull
  ; ModuleID = 'netscripten'
    invoke addrspace(0) void @corert.throwifnull(i8* <badref>, i8* %load_loc2_69)
            to label %Trap unwind label %LandingPad0
  Global is referenced by parentless instruction!
  { i32, i1 } (i32, i32)* @llvm.smul.with.overflow.i32
  ; ModuleID = 'netscripten'
    <badref> = call addrspace(0) { i32, i1 } @llvm.smul.with.overflow.i32(i32 %load_arrayLength, i32 1)
  Global is referenced by parentless instruction!
  { i32, i1 } (i32, i32)* @llvm.smul.with.overflow.i32
  ; ModuleID = 'netscripten'
    <badref> = call addrspace(0) { i32, i1 } @llvm.smul.with.overflow.i32(i32 %load_arrayLength30, i32 1)
  Global is referenced by parentless instruction!
  { i32, i1 } (i32, i32)* @llvm.smul.with.overflow.i32
  ; ModuleID = 'netscripten'
    <badref> = call addrspace(0) { i32, i1 } @llvm.smul.with.overflow.i32(i32 %load_arrayLength57, i32 1)
  Global is referenced by parentless instruction!
  { i32, i1 } (i32, i32)* @llvm.smul.with.overflow.i32
  ; ModuleID = 'netscripten'
    <badref> = call addrspace(0) { i32, i1 } @llvm.smul.with.overflow.i32(i32 %load_arrayLength72, i32 1)
  Global is referenced by parentless instruction!
  i8* (i8*, i32)* @S_P_CoreLib_System_Runtime_InteropServices_Marshal__AllocCoTaskMem
  ; ModuleID = 'netscripten'
    <badref> = invoke addrspace(0) i8* @S_P_CoreLib_System_Runtime_InteropServices_Marshal__AllocCoTaskMem(i8* <badref>, i32 <badref>)
            to label %Trap unwind label %LandingPad0
  Global is referenced by parentless instruction!
  i8* (i8*, i32)* @S_P_CoreLib_System_Runtime_InteropServices_Marshal__AllocCoTaskMem
  ; ModuleID = 'netscripten'
    <badref> = invoke addrspace(0) i8* @S_P_CoreLib_System_Runtime_InteropServices_Marshal__AllocCoTaskMem(i8* <badref>, i32 <badref>)
            to label %Trap unwind label %LandingPad0
  Global is referenced by parentless instruction!
  void (i8*, i8*)* @"S_P_CoreLib_System_Runtime_InteropServices_MemoryMarshal__GetArrayDataReference<UInt8>"
  ; ModuleID = 'netscripten'
    invoke addrspace(0) void @"S_P_CoreLib_System_Runtime_InteropServices_MemoryMarshal__GetArrayDataReference<UInt8>"(i8* <badref>, i8* %Temp2_)
            to label %Trap unwind label %LandingPad0
  Global is referenced by parentless instruction!
  void (i8*, i8*)* @"S_P_CoreLib_System_Runtime_InteropServices_MemoryMarshal__GetArrayDataReference<UInt8>"
  ; ModuleID = 'netscripten'
    invoke addrspace(0) void @"S_P_CoreLib_System_Runtime_InteropServices_MemoryMarshal__GetArrayDataReference<UInt8>"(i8* <badref>, i8* %Temp19_)        
            to label %Trap unwind label %LandingPad0
  Alias and aliasee types should match!
  i32* @Sample_Sample__pass_two_arrays___EHInfo
  Alias and aliasee types should match!
  i32* @Sample_Sample__pass_two_arrays___EHInfo_End

If I remove one of the params, or even just the in specifier from one of the params, it compiles fine.

SingleAccretion commented 1 year ago

@corert.throwifnull

Hmm, that's produced by the IL backend (which is now gone). I see we should have packages with the more recent compiler, but they are probably/possibly broken publishing wise.

yowl commented 1 year ago

Looks like it is publishing:

image

Probably just need to try the latest package?

RReverser commented 1 year ago

I remember having some other issues with net8.0-based packages, not sure what those were though. I can give it a try again again and report back here.

RReverser commented 1 year ago

Looks like it is publishing:

Where is this from btw / how do I find the latest version? Packages like Microsoft.DotNet.ILCompiler.LLVM are not on NuGet, and I wasn't sure where to look.

yowl commented 1 year ago

https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-experimental

RReverser commented 1 year ago

Thanks. Another question: if IL backend is gone, do I still need KnownILCompilerPack from https://github.com/dotnet/runtimelab/issues/2196#issue-1578480889? Previously that was the only config that worked for me but I'd be happy to remove if no longer necessary.

RReverser commented 1 year ago

Another question: if IL backend is gone, do I still need KnownILCompilerPack from #2196 (comment)? Previously that was the only config that worked for me but I'd be happy to remove if no longer necessary.

Tried commenting that one out, and it seems to compile even without it.

Going to try those marshalling examples now.

RReverser commented 1 year ago

Looks like this marshalling indeed works correctly in latest 8.0.0-*, thanks.

RReverser commented 1 year ago

Ah no wait, need more testing. I remember what the issue was now - looks like dotnet publish with 8.0.0 ignores -r browser-wasm and produces dll instead of wasm for me.

Did something change in how it's supposed to be passed?

RReverser commented 1 year ago

FWIW this is what updated csproj section looks like (variation of https://github.com/dotnet/runtimelab/issues/2196#issue-1578480889 just with new version):

<KnownILCompilerPack Update="Microsoft.DotNet.ILCompiler" TargetFramework="net7.0" ILCompilerPackNamePattern="runtime.**RID**.Microsoft.DotNet.ILCompiler.LLVM" ILCompilerPackVersion="8.0.0-alpha.1.23170.1" ILCompilerRuntimeIdentifiers="browser-wasm;linux-musl-x64;linux-x64;win-x64;linux-arm;linux-arm64;linux-musl-arm;linux-musl-arm64;osx-arm64;osx-x64;win-arm;win-arm64;win-x86" />
<PackageReference Include="Microsoft.DotNet.ILCompiler.LLVM" Version="8.0.0-alpha.1.23170.1" />
<PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler.LLVM" Version="8.0.0-alpha.1.23170.1" />
SingleAccretion commented 1 year ago

It may need --self-contained.

RReverser commented 1 year ago

Yeah already using it - needed it for 7.0.0-* anyway.

RReverser commented 1 year ago

FWIW this is what my sample csproj looks like - I started off working template by @kant2002 and hardcoded some more options to avoid passing them on command line:

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <OutputType>Library</OutputType>
        <NativeLib>Shared</NativeLib>
        <!-- <OutputType>Exe</OutputType> -->
        <TargetArchitecture>wasm</TargetArchitecture>
        <PlatformTarget>AnyCPU</PlatformTarget>
        <MSBuildEnableWorkloadResolver>false</MSBuildEnableWorkloadResolver>
        <TargetFramework>net7.0</TargetFramework>
        <ImplicitUsings>enable</ImplicitUsings>
        <!-- <Nullable>enable</Nullable> -->
        <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
        <EmitLegacyAssetsFileItems>true</EmitLegacyAssetsFileItems>
        <EmccExtraArgs>--no-entry -s STANDALONE_WASM -s WASM_ASYNC_COMPILATION=0 -s EXPORTED_FUNCTIONS=["_NativeAOT_StaticInitialization","(...my functions...)"] -g2</EmccExtraArgs>
        <SelfContained>true</SelfContained>
        <RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
        <!-- size opts -->
        <InvariantGlobalization>true</InvariantGlobalization>
        <IlcGenerateStackTraceData>false</IlcGenerateStackTraceData>
        <IlcDisableReflection>true</IlcDisableReflection>
    </PropertyGroup>

    <!-- PropertyGroup only for Release mode -->
    <PropertyGroup Condition="'$(Configuration)' == 'Release'">
        <NativeDebugSymbols>false</NativeDebugSymbols>
    </PropertyGroup>

    <ItemGroup>
        <!-- Works with these versions:
        <KnownILCompilerPack Update="Microsoft.DotNet.ILCompiler" TargetFramework="net7.0" ILCompilerPackNamePattern="runtime.**RID**.Microsoft.DotNet.ILCompiler.LLVM" ILCompilerPackVersion="7.0.0-preview.5.23113.1" ILCompilerRuntimeIdentifiers="browser-wasm;linux-musl-x64;linux-x64;win-x64;linux-arm;linux-arm64;linux-musl-arm;linux-musl-arm64;osx-arm64;osx-x64;win-arm;win-arm64;win-x86" />
        <PackageReference Include="Microsoft.DotNet.ILCompiler.LLVM" Version="7.0.0-preview.5.23113.1" />
        <PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler.LLVM" Version="7.0.0-preview.5.23113.1" />
        -->

         <!-- Doesn't work with these versions: -->
        <KnownILCompilerPack Update="Microsoft.DotNet.ILCompiler" TargetFramework="net7.0" ILCompilerPackNamePattern="runtime.**RID**.Microsoft.DotNet.ILCompiler.LLVM" ILCompilerPackVersion="8.0.0-alpha.1.23170.1" ILCompilerRuntimeIdentifiers="browser-wasm;linux-musl-x64;linux-x64;win-x64;linux-arm;linux-arm64;linux-musl-arm;linux-musl-arm64;osx-arm64;osx-x64;win-arm;win-arm64;win-x86" />
        <PackageReference Include="Microsoft.DotNet.ILCompiler.LLVM" Version="8.0.0-alpha.1.23170.1" />
        <PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler.LLVM" Version="8.0.0-alpha.1.23170.1" />
    </ItemGroup>

</Project>

Let me know if anything looks off.

RReverser commented 1 year ago

I don't need to update the dotnet CLI itself, do I?

SingleAccretion commented 1 year ago

In theory, 7.0 SDK should work. If you have a binlog (/bl) from the build, that would be the way to diagnose what's not working. It is possible the publishing regressed further with the upstream integration.

RReverser commented 1 year ago

In theory, 7.0 SDK should work. If you have a binlog (/bl) from the build, that would be the way to diagnose what's not working. It is possible the publishing regressed further with the upstream integration.

Just pushed a minimal sample including binlog for the failing update to https://github.com/RReverser/minisample

kant2002 commented 1 year ago

@RReverser Try following steps

  1. Add <PublishAot>true</PublishAot> to project file
  2. apply changes from https://github.com/dotnet/runtime/pull/82645 to .packages folder. These changes should be applied only to microsoft.dotnet.ilcompiler.llvm package 3, Are you have .NET 8.0 installed? Pin to 7.0 SDK, otherwise <KnownILCompilerPack Update="Microsoft.DotNet.ILCompiler" TargetFramework="net7.0" .. should somehow apply to only one KnownILCompilerPack (from 7.0)
RReverser commented 1 year ago
  • Add <PublishAot>true</PublishAot> to project file

That one (at least in isolation) still doesn't work:

C:\Program Files\dotnet\sdk\7.0.202\Sdks\Microsoft.DotNet.ILCompiler\build\Microsoft.NETCore.Native.Publish.targets(58,5): error : Cross-OS native compilation is not supported. [C:\Users\me\Documents\minisample\minisample.csproj]

2. apply changes from Replace IlcHostArch with SDK-computed value runtime#82645 to .packages folder. These changes should be applied only to microsoft.dotnet.ilcompiler.llvm package

Not sure if I can apply it locally, assuming you mean e.g. src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets -> .packages\microsoft.dotnet.ilcompiler.llvm\8.0.0-alpha.1.23170.1\build\Microsoft.DotNet.ILCompiler.SingleEntry.targets, as the contents look pretty different, I assume the latter is prebuilt with some transformations.

Wouldn't that patch be included in latest version - 8.0.0-alpha.1.23170.1 - anyway?

3. Are you have .NET 8.0 installed? Pin to 7.0 SDK

Sorry, not sure what you mean by pin here (aside from having my TargetFramework set to net7.0 as it already is).

kant2002 commented 1 year ago
  1. Here what I have as diff. I do miss runtime.browser-wasm

    diff --git a/minisample.csproj b/minisample.csproj
    index b1090de..d872a5c 100644
    --- a/minisample.csproj
    +++ b/minisample.csproj
    @@ -11,6 +11,7 @@
                <EmccExtraArgs>--no-entry -s EXPORTED_FUNCTIONS=[_NativeAOT_StaticInitialization,_hello]</EmccExtraArgs>
                <SelfContained>true</SelfContained>
                <RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
    +               <PublishAot>true</PublishAot>
        </PropertyGroup>
    
        <ItemGroup>
    @@ -23,7 +24,7 @@
    
                <KnownILCompilerPack Update="Microsoft.DotNet.ILCompiler" TargetFramework="net7.0" ILCompilerPackNamePattern="runtime.**RID**.Microsoft.DotNet.ILCompiler.LLVM" ILCompilerPackVersion="8.0.0-alpha.1.23170.1" ILCompilerRuntimeIdentifiers="browser-wasm;linux-musl-x64;linux-x64;win-x64;linux-arm;linux-arm64;linux-musl-arm;linux-musl-arm64;osx-arm64;osx-x64;win-arm;win-arm64;win-x86" />
                <PackageReference Include="Microsoft.DotNet.ILCompiler.LLVM" Version="8.0.0-alpha.1.23170.1" />
    -               <PackageReference Include="runtime.win-x64.Microsoft.DotNet.ILCompiler.LLVM" Version="8.0.0-alpha.1.23170.1" />
    
        </ItemGroup>
  2. Aaah. I should not post that late at night. I mean https://github.com/dotnet/runtimelab/pull/2203 and https://github.com/dotnet/runtime/pull/82645 was only important because it gives me idea about HostOSIdentifier change. I apply these changes directly to cached packages. So drop content of Microsoft.DotNet.ILCompiler.LLVM.props into .\.packages\microsoft.dotnet.ilcompiler.llvm\8.0.0-alpha.1.23170.1\build\Microsoft.DotNet.ILCompiler.LLVM.props and apply change Microsoft.DotNet.ILCompiler.SingleEntry.targets to .\.packages\microsoft.dotnet.ilcompiler.llvm\8.0.0-alpha.1.23170.1\build\Microsoft.DotNet.ILCompiler.SingleEntry.targets
  3. Please create global.json. You can use any version of SDK >= 7.200 and <8.0
    {
    "sdk": {
        "version": "7.0.300-preview.23122.5"
    }
    }
RReverser commented 1 year ago

2. I apply these changes directly to cached packages. So drop content of Microsoft.DotNet.ILCompiler.LLVM.props into .\.packages\microsoft.dotnet.ilcompiler.llvm\8.0.0-alpha.1.23170.1\build\Microsoft.DotNet.ILCompiler.LLVM.props and apply change Microsoft.DotNet.ILCompiler.SingleEntry.targets to .\.packages\microsoft.dotnet.ilcompiler.llvm\8.0.0-alpha.1.23170.1\build\Microsoft.DotNet.ILCompiler.SingleEntry.targets

Just to be clear, did you mean here just from the first PR or from the second one as well? I applied the first one + other described steps, but that doesn't seem to be enough, and I can't apply changes from the 2nd one because local content looks quite different, as mentioned before.

Either way, even if I can get it to work with manual patching, it doesn't seem like a very sustainable solution as it would be destroyed & hard to share with others unless I commit .packages as well :/

I think I'm going to stay on the latest 7.0.0-* for now instead, until the remaining PRs are merged. I do wonder, looking at the suggested changes, do the new problems stem from EmitLegacyAssetsFileItems workaround not working anymore in 8.0.0-*, so now PublishAot + all those fixes are necessary instead or is it something else?

kant2002 commented 1 year ago

Just to be clear, did you mean here just from the first PR or from the second one as well?

Yes. Only first one is needed.

Either way, even if I can get it to work with manual patching, it doesn't seem like a very sustainable solution

Sure. I do not think this is as sustainable solution. I just do not 100% that this solves your issues. Anyway you can try https://github.com/kant2002/minisample and run build.ps1

so now PublishAot + all those fixes are necessary instead or is it something else?

NativeAOT LLVM is closer and closer to how .NET SDK consume ILC. That's changes substantially from early NativeAOT days and we are in transition period. I think I need @SingleAccretion seal of approval on my PR.

Also can you post your dotnet --info. I want to know what .NET SDK installed on your PC.

RReverser commented 1 year ago

Sure. I do not think this is as sustainable solution. I just do not 100% that this solves your issues. Anyway you can try kant2002/minisample and run build.ps1

Thanks, had to fix up the build script & global.json for my local environment, but it does generate Wasm!

I wonder what I missed in the previous instruction - the only thing I can think of is that I manually edited that one line in Microsoft.DotNet.ILCompiler.SingleEntry.targets instead of copying the entire new file, but they should be the same?

FWIW there are some missing symbols though:

EXEC : warning : undefined symbol: RhpCallCatchFunclet (referenced by top-level compiled C/C++ code) [C: 
\Users\me\Documents\minisample\minisample.csproj]
EXEC : warning : undefined symbol: RhpCallFilterFunclet (referenced by top-level compiled C/C++ code) [C 
:\Users\me\Documents\minisample\minisample.csproj]
EXEC : warning : undefined symbol: RhpCallFinallyFunclet (referenced by top-level compiled C/C++ code) [ 
C:\Users\me\Documents\minisample\minisample.csproj]
EXEC : warning : undefined symbol: pthread_kill (referenced by top-level compiled C/C++ code) [C:\Users\ 
me\Documents\minisample\minisample.csproj]
emcc : warning : warnings in JS library compilation [-Wjs-compiler] [C:\Users\me\Documents\minisample\mi 
nisample.csproj]

Also can you post your dotnet --info. I want to know what .NET SDK installed on your PC.

Sure, I think it's just the latest 7.0, but here's the full list:

.NET SDK:
 Version:   7.0.202
 Commit:    6c74320bc3

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.202\

Host:
  Version:      7.0.4
  Architecture: x64
  Commit:       0a396acafe

.NET SDKs installed:
  7.0.201 [C:\Program Files\dotnet\sdk]
  7.0.202 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.32 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.7 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  C:\Users\me\Documents\minisample\global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Now that I tried without it, looks like the global.json pinning is not necessary for me after all.

SingleAccretion commented 1 year ago

FWIW, working on fixing the publishing right now...

missing symbols

(#2226)

kant2002 commented 1 year ago

I wonder what I missed in the previous instruction

@RReverser I think you missing clearing bin,obj after copy files. https://github.com/kant2002/minisample/blob/e2efef31026307a2d158507c44045397e41b2ac6/build.ps1#L5-L6

That's because dotnet restore did not pickup Microsoft.DotNet.ILCompiler.LLVM.props.

but they should be the same?

Yes, you did everything right. I should go with automatable instructions in first place.

RReverser commented 1 year ago

@RReverser I think you missing clearing bin,obj after copy files. kant2002/minisample@e2efef3/build.ps1#L5-L6

I see, thanks!

RReverser commented 1 year ago

Closing this issue as I just rechecked the original code and it indeed works on 8.0.0 previews and I'm guessing there is no interest in backporting / continuing on the old version.