SignatureBeef / TShock.Plugins.Net6Migrator

TShock plugin migration tool built on ModFramework
GNU General Public License v3.0
7 stars 1 forks source link

Vanillafier and Tiled plugins can't be migrated #2

Closed MasterSlenderTR closed 2 years ago

MasterSlenderTR commented 2 years ago

[09.06.22 15:49:01] [Server API] Error: Server crashed due to an unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Mono.Cecil.Pdb.SymWriter.Initialize(Object emitter, String filename, Boolean fFullBuild) at Mono.Cecil.Pdb.NativePdbWriterProvider.CreateWriter(ModuleDefinition module, String pdb) at Mono.Cecil.Pdb.NativePdbWriterProvider.GetSymbolWriter(ModuleDefinition module, String fileName) at Mono.Cecil.ModuleWriter.GetSymbolWriter(ModuleDefinition module, String fq_name, ISymbolWriterProvider symbol_writer_provider, WriterParameters parameters) at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable1 stream, WriterParameters parameters) at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable1 stream, WriterParameters parameters) at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters) at MonoMod.MonoModder.Write(Stream output, String outputPath) at ModFramework.ModFwModder.Write(Stream output, String outputPath) at TShock.Plugins.Net6Migrator.Mod.Migrate(String sourceFolder, String outputFolder) in D:\Visual Studio Projects Library\TShock.Plugins.Net6Migrator\Plugin\Mod.cs:line 346 at TShock.Plugins.Net6Migrator.Mod.OnRunning() in D:\Visual Studio Projects Library\TShock.Plugins.Net6Migrator\Plugin\Mod.cs:line 23 --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Span1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at ModFramework.ModContext.Invoke(ModificationAttribute modification, ModType modType, MonoModder modder, List1 availableParameters) at ModFramework.ModContext.<>cDisplayClass35_0.<_Apply>gQueueFreeTasks|0() at ModFramework.ModContext._Apply(ModType modType, ModFwModder modder, IEnumerable1 assemblies) at ModFramework.ModContext.Apply(ModType modType, ModFwModder modder, IEnumerable1 assemblies) at ModFramework.ModContext.Apply(ModType modType) at Terraria.Program.LaunchOTAPI() at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs) at Terraria.WindowsLaunch.orig_Main(String[] args) at Terraria.WindowsLaunch.Main(String[] args) at TerrariaApi.Server.Program.StartServer(String[] args) in /home/runner/work/TShock/TShock/TerrariaServerAPI/TerrariaServerAPI/Program.cs:line 110 at TerrariaApi.Server.Program.Main(String[] args) in /home/runner/work/TShock/TShock/TerrariaServerAPI/TerrariaServerAPI/Program.cs:line 93

Untitled

Edit: I tested bunch of other plugins, they don't migrate either giving the same error.

SignatureBeef commented 2 years ago

i don't get the same result.

image

MasterSlenderTR commented 2 years ago

I even tried uninstalling entire server and installing it twice but it doesn't work for me. I feel like either this plugin doesn't work right in Win7 or I can't just build it properly.

This is how I built the plugin from source: 1) Cloned the source using git bash 2) Launched TShock.Plugins.Net6Migrator.sln with VS2022 3) I clicked Build Solution Untitled 4) I moved TShock.Plugins.Net6Migrator.dll from TShock.Plugins.Net6Migrator\Plugin\bin\Release\net6.0 to server's "modifications" directory.

Did I build this wrong or something?

SignatureBeef commented 2 years ago

i think it's unlikely to be a w7 issue specifically, or even to do with building it. so one question would be what plugins/url are you using, or have you accidentally copied a broken plugin in? for example, a previously migrated plugin may have failed at some point in the past, and even though the migrator tries to prevent remigrating twice, perhaps it's failing to detect. tip: when the migrator first touches a dll it will rename it with a .legacy extension, and will write the migrated copy in the original place for tshock to load.

that said, i have only tested with plugins listed in the launcher itself and i have also just checked the latest crossplay dll from the tshock plugins repo. both of the plugins you mentioned are migrating fine for myself on w10+osx, via the launcher and tshock beta.

if i could replicate the issue i'd be able to work out an appropriate fix, however that is not yet possible. this tool is still quite volatile and whether it's used in the future is still in question, since recompilation of the original source code is always the best outcome (the compiler does better than a rewriter), but who knows, this could capture most cases in future.

Screen Shot 2022-09-07 at 8 45 53 pm

MasterSlenderTR commented 2 years ago

"so one question would be what plugins/url are you using, or have you accidentally copied a broken plugin in?" I don't know what you mean by url but I don't use any plugin other than net6migrator and experimental otapi3 version of Tiled plugin. I already tried using net6migrator without tiled plugin, it did change nothing. And nope I did not acidentally copy a broken plugin.

Also, this is what always happen when migrator fails, new dll being 0kb. image

I'd try to use launcher but as I said before it just crashes on me. Capture

If it's not a issue, can you send me migrated version of Vanillafier plugin? that's the only plugin I need tbh.

SignatureBeef commented 2 years ago

tldr: update to the latest tshock beta and use the same dll you used when you posted the issue at the vanillafier repo.

those errors appear to be failing to download the plugins, likely something to do with your network.

i would have suggested disabling/commenting out the download code in the launcher, downloading vanillafier manually and dropping the legacy folder for it to convert, but if you are having network issues relinking likely will suffer the same issues as it will resolve missing dependencies from nuget (e.g. the .net6 assemblies for retargeting, sqlite etc). this could well be the issue you are having, just masked as a terrible error message making diagnosis difficult.

regardless of this, i see you already have a -partially- working copy as per your issue in the vanilafier repo. youll be happy to know that the issue you found for vanillafier was actually a problem in tshock beta, which has received a fix and i can confirm vanillafy/-confirm should now succeed.

image

MasterSlenderTR commented 2 years ago

Tysm vanillafier works now, ig I no longer need net6migrator but I still wish it worked.

"those errors appear to be failing to download the plugins, likely something to do with your network." I connected to my phone's network for testing but that didn't change something either.