Closed ghost closed 1 year ago
@hardhub This is due to the update of h5 to target net70, which needs then the SDK installed on your computer.
You can download the latest .NET SDK here: https://dotnet.microsoft.com/en-us/download
And re-install the latest version of h5 with the command: dotnet tool update --global h5-compiler --version 0.0.34002
I wrote above about NET 7.
And I obviously tested it on .NET 7.
dotnet --version
7.0.100
You closed it too quick ))
Good point, missed that!
For build output you can see this comment: https://github.com/theolivenbaum/h5/issues/71#issuecomment-1324890564
>C:\Users\hardhub\.nuget\packages\h5.target\0.0.34005\Sdk\Sdk.targets(461,5): warning MSB3073: The command "h5 check-if-online" exited with code 9009.
1>Cannot find a tool in the manifest file that has a command named 'h5'.
1>C:\Users\hardhub\.nuget\packages\h5.target\0.0.34005\Sdk\Sdk.targets(470,5): warning MSB3073: The command "dotnet tool run h5 check-if-online" exited with code 1.
I was not able to look at Sdk targets to analyze anything because I just completed porting some Bridge frameworks projects and the project based on Bridge in the past. I wrote about frameworks in Gitter: https://gitter.im/curiosityai/h5#. But it seems nobody uses it actively.
Interesting, which version of VS do you have installed? If you want to chat directly you can join our app slack.
Interesting, which version of VS do you have installed?
I guess it does not matter, because it happens even under gitlab-runner (CentOS 7, .NET 7, Microsoft Official Repository)
h5 check-if-online
/home/gitlab-runner/.nuget/packages/h5.target/0.0.34005/Sdk/Sdk.targets(461,5): warning MSB3073: The command "h5 check-if-online" exited with code 134.
Difference only in exit code for different platforms, for VS and Windows it is 1 and for Linux it is any none-zero as I see that.
The error code there is on purpose, as we need to start the compilation server - we do it this way because the compiler caches some of the state in across compilations for speed.
For CIs, we don't run the compiler as server, as you can see here.
The reason you always see the error code is that we run two checks, one for the globally installed compiler, and one for the locally installed one. We run this to make sure you're running the latest version of the compiler, because I didn't want to support the complexity added by the original Bridge CLI that let you mix multiple versions of the CLI / compiler / base library.
All that said, I'm sure this can be improved - either by adding some flags to disable this process, or something else. I'll leave this open to track the issue
Thank for good explanation.
As I see it we need to inform calling code about status of server:
try
{
await remoteCompiler.Ping(_exitToken.Token);
Logger.LogInformation("Found compilation server");
return 0;
}
catch (Exception E)
{
Logger.LogInformation("Compilation server not online");
return 1;
}
It is a bit unclear for me what calls this tool. And why we need to tell some number outside - why we cannot just start it silently and always return 0.
Because on my screenshot above it looks like it returns 1
even if H5 is already started.
So I can track output in console of H5 server, I can observe how it builds a project, but warning check-if-online exited with code 1
continues to be added into Error List for each project which it starts to build.
Maybe it raises exception if H5 is already started for another H5-based project in solution and it is the reason why it returns 1
?
I guess I will need to analyze implementation details to be more specific.
And if I build using multiple threads via CLI (for example `msbuild /maxcpucount:8 instead of /maxcpucount:1) then I get warnings about h5-compiler:
The command "dotnet tool update --global h5-compiler" exited with code 1.
@hardhub I've changed the logic in the SDK target to ignore the exit code and instead use the exit code value, this should fix this warning (but you'll need to update the SDK target in your projects
Just remembered there's an auto-update of the target value in the compiler so as long as you update the compiler it should be fine!
I think current version of H5 is not usable much.
1)
UpdateH5
option simply does not work as intended. If you have NET 7 installed it will update your installed h5 tools in any case. If you have only NET 6 then it cannot update and will not install new version. But enabling this option can reduce amount of error in the log.2) It always puts a lot of different warnings which should not be displayed in case of normal building process:
For example:
Warning MSB3073 The command "dotnet tool run h5 check-if-online" exited with code 1
Exit code other than zero means that external program completed not successful.
@theolivenbaum Can you provide any feedback? We cannot hear anything from you.