Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dotnet upgrade net8.0 #896

Merged
merged 27 commits into from
Apr 5, 2024
Merged

Conversation

cschuchardt88
Copy link
Member

@cschuchardt88 cschuchardt88 commented Mar 25, 2024

Change Log

  • Changed projects to net8.0
  • Removed Directory.Build.props file; ends causing more problems than it fixes.
  • Changed main.yml github workflow to net8.0

Closes #895

Tests

image

Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testing

dotnet test tests/Neo.Network.RPC.Tests --framework net8.0 --blame-hang --blame-hang-timeout 180000 /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage-join/ -p:Exclude=${EXCLUDED_TESTS}
dotnet test tests/Neo.Plugins.RpcServer.Tests --framework net8.0 --blame-hang --blame-hang-timeout 180000 /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage-join/ /p:MergeWith=${GITHUB_WORKSPACE}/coverage-join/coverage.json -p:Exclude=${EXCLUDED_TESTS}
dotnet test tests/Neo.Plugins.Storage.Tests --framework net8.0 --blame-hang --blame-hang-timeout 180000 /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage-join/ /p:MergeWith=${GITHUB_WORKSPACE}/coverage-join/coverage.json -p:Exclude=${EXCLUDED_TESTS}
dotnet test tests/Neo.Cryptography.MPTTrie.Tests --framework net8.0 --blame-hang --blame-hang-timeout 180000 /p:CollectCoverage=true /p:CoverletOutput=${GITHUB_WORKSPACE}/coverage-join/ /p:MergeWith=${GITHUB_WORKSPACE}/coverage-join/coverage.json -p:Exclude=${EXCLUDED_TESTS}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this in other PR

vncoelho
vncoelho previously approved these changes Mar 25, 2024
@vncoelho
Copy link
Member

I am just afraid some need on actions is needed, but this can come in another PR

@vncoelho
Copy link
Member

At least everything is running again

image

Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run coverallsapp/[email protected]
Run mkdir -p ~/bin/
coveralls-linux.tar.gz: OK
Run coveralls report      --format lcov ${GITHUB_WORKSPACE}/coverage/lcov.info 
 
⠀⠀⠀⠀⠀⠀⣿
⠀⠀⠀⠀⠀⣼⣿⣧⠀⠀⠀⠀⠀⠀⠀ ⣠⣶⣾⣿⡇⢀⣴⣾⣿⣷⣆ ⣿⣿⠀⣰⣿⡟⢸⣿⣿⣿⡇ ⣿⣿⣿⣷⣦⠀⠀⢠⣿⣿⣿⠀⠀⣿⣿⠁⠀⣼⣿⡇⠀⢀⣴⣾⣿⡷
⠶⣶⣶⣶⣾⣿⣿⣿⣷⣶⣶⣶⠶  ⣸⣿⡟ ⠀⢠⣿⣿⠃⠈⣿⣿⠀⣿⣿⢠⣿⡿⠀⣿⣿⣧⣤⠀⢸⣿⡇⣠⣿⡿⠀⢠⣿⡟⣿⣿⠀⢸⣿⡿⠀⠀⣿⣿⠃⠀⢸⣿⣧⣄
⠀⠀⠙⢻⣿⣿⣿⣿⣿⡟⠋⠁⠀⠀ ⣿⣿⡇⠀ ⢸⣿⣿⠀⣸⣿⡟⠀⣿⣿⣾⡿⠁ ⣿⣿⠛⠛⠀⣿⣿⢿⣿⣏⠀⢀⣿⣿⣁⣿⣿⠀⣾⣿⡇⠀⢸⣿⡿⠀⠀⡀⠙⣿⣿⡆
⠀⠀⢠⣿⣿⣿⠿⣿⣿⣿⡄⠀⠀⠀ ⠙⢿⣿⣿⠇⠈⠿⣿⣿⡿⠋⠀⠀⢿⣿⡿⠁⠀⢸⣿⣿⣿⡇⢸⣿⣿⠀⣿⣿⣄⣾⣿⠛⠛⣿⣿⢠⣿⣿⣿ ⣼⣿⣿⣿ ⣿⣿⡿⠋⠀
⠀⢀⣾⠟⠋⠀⠀⠀⠙⠻⣷⡀⠀⠀
 
  v0.6.6
✏️ Forced coverage format: lcov
🚨 ERROR: Couldn't find specified file: /home/runner/work/neo-modules/neo-modules/coverage/lcov.info
Error: Process completed with exit code 1.

@vncoelho
Copy link
Member

vncoelho commented Mar 25, 2024

WORKDIR /opt/neoLib
RUN if [ "$NEO_BLOCKCHAIN_RUN_TESTS" = "true" ] ; then (dotnet format --verify-no-changes --verbosity diagnostic);  fi

ARG COVERAGE_OUTPUT_FOLDER=/opt/neoLib/coverage-join/
ARG COVERAGE_FILE_NAME=coverage.net8.0.json
ARG DOTNET_TEST_COMMAND=dotnet test --framework net8.0
RUN find tests -name *.csproj | xargs -I % dotnet add % package coverlet.msbuild
RUN if [ "$NEO_BLOCKCHAIN_RUN_TESTS" = "true" ] ; then ($DOTNET_TEST_COMMAND ./tests/Neo.ConsoleService.Tests         /p:CollectCoverage=true /p:CoverletOutput=$COVERAGE_OUTPUT_FOLDER);  fi
RUN if [ "$NEO_BLOCKCHAIN_RUN_TESTS" = "true" ] ; then ($DOTNET_TEST_COMMAND ./tests/Neo.Cryptography.BLS12_381.Tests /p:CollectCoverage=true /p:CoverletOutput=$COVERAGE_OUTPUT_FOLDER /p:MergeWith=$COVERAGE_OUTPUT_FOLDER$COVERAGE_FILE_NAME);  fi
#RUN mv /opt/neoLib/coverage-join/coverage.json $COVERAGE_OUTPUT_FOLDER$COVERAGE_FILE_NAME
RUN if [ "$NEO_BLOCKCHAIN_RUN_TESTS" = "true" ] ; then ($DOTNET_TEST_COMMAND ./tests/Neo.UnitTests                    /p:CollectCoverage=true /p:CoverletOutput=$COVERAGE_OUTPUT_FOLDER /p:MergeWith=$COVERAGE_OUTPUT_FOLDER$COVERAGE_FILE_NAME);  fi
RUN if [ "$NEO_BLOCKCHAIN_RUN_TESTS" = "true" ] ; then ($DOTNET_TEST_COMMAND ./tests/Neo.VM.Tests                     /p:CollectCoverage=true /p:CoverletOutput=$COVERAGE_OUTPUT_FOLDER /p:MergeWith=$COVERAGE_OUTPUT_FOLDER$COVERAGE_FILE_NAME);  fi
RUN if [ "$NEO_BLOCKCHAIN_RUN_TESTS" = "true" ] ; then ($DOTNET_TEST_COMMAND  ./tests/Neo.Json.UnitTests               /p:CollectCoverage=true /p:CoverletOutput=/opt/neoLib/coverage/lcov  /p:MergeWith=$COVERAGE_OUTPUT_FOLDER$COVERAGE_FILE_NAME /p:CoverletOutputFormat=lcov);  fi
WORKDIR /

This works fine for neo-core

main.yml fixes
Jim8y
Jim8y previously approved these changes Mar 25, 2024
@vncoelho
Copy link
Member

@cschuchardt88, let's set the folder and file name as a variable coverage-join/coverage.net8.0.json

@cschuchardt88 cschuchardt88 marked this pull request as ready for review March 25, 2024 16:18
@cschuchardt88
Copy link
Member Author

@cschuchardt88, let's set the folder and file name as a variable coverage-join/coverage.net8.0.json

Ok i think i got it working now... 🙏

@vncoelho
Copy link
Member

vncoelho commented Mar 25, 2024

it is good again,
but the same unknown error:

MSBUILD : error MSB1008: Only one project can be specified.
    Full command line: '/usr/share/dotnet/sdk/8.0.202/MSBuild.dll -maxcpucount -verbosity:m -restore -target:VSTest -nodereuse:false -nologo tests/Neo.Cryptography.MPTTrie.Tests /p:CollectCoverage=true /p:CoverletOutput=/home/runner/work/neo-modules/neo-modules/coverage-join/ p:Exclude="[Neo]*,[Neo.IO]*,[Neo.Json]*,[Neo.VM]*,[Neo.Extensions]*,[Neo.Cryptography.BLS12_381]*" /p:MergeWith=/home/runner/work/neo-modules/neo-modules/coverage-join/coverage.net8.0.json -property:VSTestArtifactsProcessingMode=collect -property:VSTestSessionCorrelationId=3676_7879406c-2666-49c9-bec6-1213d8a37c87 -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,/usr/share/dotnet/sdk/8.0.202/dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,/usr/share/dotnet/sdk/8.0.202/dotnet.dll'
  Switches appended by response files:
Switch: p:Exclude=[Neo]*,[Neo.IO]*,[Neo.Json]*,[Neo.VM]*,[Neo.Extensions]*,[Neo.Cryptography.BLS12_381]*

@vncoelho
Copy link
Member

still same errors, @cschuchardt88

#41 10.09        "/opt/neo-modules/src/ApplicationLogs/ApplicationLogs.csproj" (Publish target) (1) ->
#41 10.09        "/opt/neo-modules/src/RpcServer/RpcServer.csproj" (default target) (3:3) ->
#41 10.09        "/opt/neo-modules/neo/src/Neo.Json/Neo.Json.csproj" (default target) (9:9) ->
#41 10.09          /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: The "GenerateDepsFile" task failed unexpectedly. [/opt/neo-modules/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
#41 10.09        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: System.IO.IOException: The process cannot access the file '/opt/neo-modules/neo/src/Neo.Json/bin/Release/net8.0/Neo.Json.deps.json' because it is being used by another process. [/opt/neo-modules/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
#41 10.09        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions) [/opt/neo-modules/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
#41 10.09        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) [/opt/neo-modules/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
#41 10.09        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [/opt/neo-modules/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
#41 10.09        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.File.Create(String path) [/opt/neo-modules/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
#41 10.09        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.GenerateDepsFile.WriteDepsFile(String depsFilePath) [/opt/neo-modules/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
#41 10.09        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/opt/neo-modules/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
#41 10.09        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/opt/neo-modules/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
#41 10.09        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/opt/neo-modules/neo/src/Neo.Json/Neo.Json.csproj::TargetFramework=net8.0]
#41 10.09 
#41 10.09     8 Warning(s)
#41 10.09     2 Error(s)

@vncoelho
Copy link
Member

dotnet/sdk#39753

Still no answer there as well.

@cschuchardt88 cschuchardt88 marked this pull request as draft March 30, 2024 15:38
@cschuchardt88 cschuchardt88 marked this pull request as ready for review March 30, 2024 15:44
@cschuchardt88
Copy link
Member Author

@vncoelho Please don't change code in my repo unless tested as 100% working; unless you going to fix the issues your changes create. It wastes my time. Put in review instead.

Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cschuchardt88, the same error as before.

Please ensure that the project is building

#41 8.422        "/opt/neo-modules/neo/src/Neo.VM/Neo.VM.csproj" (default target) (9:4) ->
#41 8.422          /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: The "GenerateDepsFile" task failed unexpectedly. [/opt/neo-modules/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
#41 8.422        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018: System.IO.IOException: The process cannot access the file '/opt/neo-modules/neo/src/Neo.VM/bin/Release/net8.0/Neo.VM.deps.json' because it is being used by another process. [/opt/neo-modules/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
#41 8.422        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Init(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Int64& fileLength, UnixFileMode& filePermissions) [/opt/neo-modules/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
#41 8.422        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException) [/opt/neo-modules/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
#41 8.422        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode) [/opt/neo-modules/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
#41 8.422        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at System.IO.File.Create(String path) [/opt/neo-modules/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
#41 8.422        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.GenerateDepsFile.WriteDepsFile(String depsFilePath) [/opt/neo-modules/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
#41 8.422        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/opt/neo-modules/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
#41 8.422        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/opt/neo-modules/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
#41 8.422        /usr/share/dotnet/sdk/8.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(284,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/opt/neo-modules/neo/src/Neo.VM/Neo.VM.csproj::TargetFramework=net8.0]
#41 8.422 
#41 8.422     0 Warning(s)
#41 8.422     2 Error(s)

That day I committed some fix on coveralls I was also trying to check this error here while we were discussing on discord, you were already aware of this one. I presented to you and discussed on discord.

So, in order to save/not waste time:
1 - explain that it is not building
2 - or fix it, at least the building errors, before calling for review.

@vncoelho vncoelho dismissed their stale review March 31, 2024 10:52

I will leave the reject dismissed because I am not sure if the error is here on in neo core, due to the upgrade to net 8.0 that occurred first there. Maybe the changes here will be this. But those who accept should be aware that project is not building in most of the time as reported here and you the dotnet repo.

global.json Show resolved Hide resolved
global.json Outdated Show resolved Hide resolved
@vncoelho
Copy link
Member

vncoelho commented Apr 1, 2024

After upgrading to 203 the building error reduced considerably. There is something that is keeping files open or process.

I am now ensuring that dotnet build-server shutdown after building plugins and perhaps it will work better.

Just fix the lastesfeature for now I am ready.

Co-authored-by: Vitor Nazário Coelho <[email protected]>
@vncoelho vncoelho merged commit 66573ed into neo-project:master Apr 5, 2024
4 checks passed
@shargon shargon deleted the dotnet-upgrade branch April 5, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Oracle Plugin against Master
5 participants