curiosity-ai / h5

🚀 The next generation C# to JavaScript compiler

Home Page:https://h5.rocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

h5 now runs on NET6.0

theolivenbaum opened this issue · comments

Since .net60 moved into the go-live release phase, I've updated h5 compiler to run on net6.0 to make sure it's ready. I've not hit any issues on my side, but I'm opening this issue to track any problems.

If you're updating the h5 compiler on your computer, you might need to install the net6.0 SDK first:
https://dotnet.microsoft.com/download/dotnet/6.0

Otherwise you can keep using the last net5.0 version - there were no new features on the net6.0 version.

rc1 requires Visual Studio 2022 and it is probably not ideal way to go.

@theolivenbaum

I have uninstalled existing version:

dotnet tool uninstall --global h5-compiler

installed NET 5.0 version:

dotnet tool install --global h5-compiler --version 0.0.21310

My project file looks like this:

<Project Sdk="h5.Target/0.0.21664">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="h5" Version="0.0.22158" />
  </ItemGroup>

</Project>

During compilation I got errors and warnings:

warning MSB3073: The command "h5 check-if-online" exited with code 1.
warning MSB4181: The "Exec" task returned false but did not log an error.

warning MSB3073: The command "dotnet tool run h5 check-if-online" exited with code 1.
warning MSB4181: The "Exec" task returned false but did not log an error.


Installing (or updating) the h5 compiler.
1>EXEC : warning NU1202: Package h5-compiler 0.0.22166 is not compatible with net5.0 (.NETCoreApp,Version=v5.0) / any. Package h5-compiler 0.0.22166 supports: net6.0 (.NETCoreApp,Version=v6.0) / any
1>Tool 'h5-compiler' failed to update due to the following:
1>The tool package could not be restored.
1>Tool 'h5-compiler' failed to install. This failure may have been caused by:

warning MSB3073: The command "dotnet tool update --global h5-compiler" exited with code 1.
warning MSB4181: The "Exec" task returned false but did not log an error.

How to solve above issues?

After that it starts H5 Compilation server which is interactive and it is not closed on VS closing.
How to make it hidden and shutdown it when VS solution is closed?

OK, I have found the option which disables some warnings related to updating of compiler. Though it is wrong example in documentation.. <UpdateH5>false<UpdateH5/> (mistyping, should be <UpdateH5>false</UpdateH5>)

But some of them are still there:

warning MSB3073: The command "dotnet tool run h5 check-if-online" exited with code 1.
warning MSB4181: The "Exec" task returned false but did not log an error.

If someone has the error message below. remove all locales from h5.json
"locales": "en-US;en-GB;bg-BG",

[info] [15:33:01] [E] H5 Compilation in 2.4900 seconds
info] [15:33:01]
__ _ _ _ _
|_ |)|)/ |)
|__| | \
/| \

[fail] [15:33:01]
H5 : error H5003: Sequence contains no matching element
[fail] [15:33:01]
Stack Trace: at System.Linq.ThrowHelper.ThrowNoMatchException()
at H5.Translator.Translator.ExtractLocales(String outputPath) in D:\a\1\s\H5\Compiler\Translator\Translator\Translator.Output.cs:line 633
1> at H5.Translator.Translator.ExtractCore(String outputPath, String projectPath) in D:\a\1\s\H5\Compiler\Translator\Translator\Translator.Output.cs:line 462
1> at H5.Translator.TranslatorProcessor.PostProcess() in D:\a\1\s\H5\Compiler\Translator\Translator\TranslatorProcessor.cs:line 80
1> at H5.Compiler.CompilationProcessor.Compile(CompilationRequest compilationRequest, UID128 compilationUID, CancellationToken cancellationToken) in D:\a\1\s\H5\Compiler\Compiler\CompilationProcessor.cs:line 102
**

Hi @eppoeh, thanks for reporting the issue - could you double check which version of the h5 compiler you're running?

The latest is 0.0.23290

You can see that by running: dotnet tool list -g

If you're on the latest, could you post your h5.json file here for me to test?

Unfortunately not. Ended up reinstalling all all just works now.

(biggest culprit was net6.0 not registering corrent in env tables, had to put the new path up in the list, mb still was using .net5 on the background?)

But tested again with a old config, still including locales. Just builds. I'm so happy now!

Edit: Must have been using an old version. Way too many basic things stopped working. As basic as setting a veriable...

But now, so fast, errorless, feels like i'm dreaming. Not kidding! Thank you very very very much!

Hi @eppoeh, yeah that seems to be a known issue with the VS2022 installer - same thing happened to me. In the end was just a matter of fixing the path environment order. Thanks for the feedback :)