nhibernate-core icon indicating copy to clipboard operation
nhibernate-core copied to clipboard

Add .net 6 and net48 targets

Open bahusoid opened this issue 3 years ago • 8 comments

bahusoid avatar Jan 19 '22 11:01 bahusoid

Looks like ANTLR generator has some concurrency issue as github build now throw from time to time exceptions like:

Error: /home/runner/.nuget/packages/antlr3.codegenerator/3.5.2-rc1/build/Antlr3.CodeGenerator.targets(146,5): error AC1000: 
Unknown build error:  : error 10 : internal error: 
System.IO.FileNotFoundException: Could not find file '/home/runner/work/nhibernate-core/nhibernate-core/src/NHibernate/obj/Release/netcoreapp2.0/Hql__.g'. File name: '/home/runner/work/nhibernate-core/nhibernate-core/src/NHibernate/obj/Release/netcoreapp2.0/Hql__.g'    
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)    
at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter)    
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)    
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)    
at Antlr3.Tool.GrammarSpelunker.Parse()   
...

bahusoid avatar Jan 19 '22 15:01 bahusoid

Why do we need net48 target in the library? In test I understand, and wanted to implement it, but in the library?

hazzik avatar Jan 19 '22 20:01 hazzik

Why do we need net48?

Why not? Since it's already used in tests, I thought it wouldn't hurt to have it for lib too. And some optimizations are still possible on this target (like here)

bahusoid avatar Jan 19 '22 21:01 bahusoid

@fredericDelaporte Seems hazzik made it up to you (enabled auto-merge). Any objections?

bahusoid avatar Sep 12 '22 12:09 bahusoid

I wanted to merge it after some other PR and after 5.3.x merge, so enabled auto merge.

Also, I’m a little hesitant on adding .NET4.8 target.

hazzik avatar Sep 13 '22 06:09 hazzik

I think it makes sense to add that 4.8 target, provided we consider the NuGet size is not an issue. .Net Framework is far from its end of life: enabling some more optimizations already done for other targets should be beneficial to lots of users.

(I have seen a 4.8.1 has been released in August, but we should not target it in my opinion. It adds arm support, which users can still get by targeting their application on 4.8.1, without needing NHibernate targeting it too. Moreover that version is available only on most recent versions of Windows OSes.)

fredericDelaporte avatar Sep 13 '22 19:09 fredericDelaporte

enabling some more optimizations already done for other targets should be beneficial to lots of users.

What exactly do you mean, @fredericDelaporte? Optimizations in the NHibernate, or in the Framework? If later then it is all runtime dependent and does not depend on the target.

hazzik avatar Sep 14 '22 02:09 hazzik

I mean the former, like mentioned by Roman.

Why not? Since it's already used in tests, I thought it wouldn't hurt to have it for lib too. And some optimizations are still possible on this target (like here)

fredericDelaporte avatar Sep 14 '22 18:09 fredericDelaporte

@fredericDelaporte please approve and merge if you're happy with the changes

hazzik avatar Oct 27 '22 08:10 hazzik