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
Invalid code generated with new mpc on macOS #355
Comments
I tested on ubuntu-18.04 and got same output. This can be avoided by
|
I'm getting results identical to those above on a Windows Unity project.
Does anyone have a fix? |
I'm trying to resolve the problem, and this is my progress.
|
…essagePack-CSharp#355) It is because dotnet SDK's msbuild in linux and mac cannot resolve `net4x` targetframework. This fix changes to following behavior in generating project info. 1. execute `dotnet msbuild` with output msbuild's binary log 2. if failed, execute `msbuild` with output msbuild's binary log 3. if success with `dotnet msbuild` or `msbuild`, analyze binary log
Hi, have you managed to solve this issue? |
my fix is replacing from using |
Sorry, I have no idea what this means.. Kind regards |
I am having the following error Unhandled Exception: _ |
I got the same problem here on MacOS
|
avoiding problem which empty proxy class is created in linux and mac(#355)
I've merged PR, but check above error reports. |
I've tested on following env and seems to work fine. |
Hi there, |
I've added binary to releases page. |
I have also tested the new mpc on MacOS with .NET core 2.1 project and working great. Thanks a lot 👍 |
I still have same result.
I have latest .NET Core SDK.
|
I investigated and same result in sandbox/SharedData/SharedData.csproj on linux , and I found suspicious point. |
Thanks! But I still have same result on macOS.
|
hmm, it seems to be difficult to resolve problem.
Could you try again? |
I try the code.
output.txt |
Our game depends heavily on this fix... We are willing to pay for someone to fix that and close the issue... |
@jkampitakis Our current workaround for the MacOSX compatibility issues is using a Parallels Desktop installation on the MacOS machine and running mpc.exe (older version, not the newest) from there. It's not pretty (and would probably be hard to run as part of a CI pipeline) but it does the trick if you really need it. |
@mikkoairaksinen Ok. we can try that...Are you using version 1.7.3 from https://github.com/neuecc/MessagePack-CSharp/releases/tag/v1.7.3 ? |
Yes. Haven't tried yet if 1.7.3.6 would work with Parallels, but I'd imagine there should be no problems there. I will try to update some time in the near future and can report back on the results. |
Using VirtualBox with Windows10 installation and v1.7.3 we don't have an empty .cs file anymore but it's all wrong... The mapped classes aren't there, it just scans all the classes declared in the .csproj file and gives us useless generated data (I am attaching the files) MessagePackGenerated.txt ### Unhandled Exception: System.AggregateException: One or more errors occurred. (One or more errors occurred. (The system cannot find the file specified)) (The system cannot find the file specified) ---> System.ComponentModel.Win32Exception: The system cannot find the file specified |
There might be an issue in the csproj file you pass as input to the mpc.exe. Ours is very simple, basically looks like this:
|
I have been investigated about this problem, and successed reproducing. I found TypeCollector.targetTypes.Length is 0 even if compilation included valid MessagePackObject attribute. I will continue the investigation. |
I might find the cause of this issue. The issue is occured in following conditions.
If in above conditions, msbuild task is finished as success, but I think if |
throw exception when getting attribute's metadata is failed.(#355)
For anyone still struggling with mac compatibility, here is the minimal dummy csproj I have managed to make work with the latest MsgPack version: MessagePackResolverDummyProject.csproj
Replace the second path with whatever path you need to include all your code that must be visible. Run mpc with Some random observations:
|
@mikkoairaksinen Thanks a lot! I can confirm your solution is working and that we have exactly the same errors / problems as you 📟 |
Same issue here, any progress? |
@mikkoairaksinen try replacing the PATH env variable of the process to match that of your command line.
|
So is there any way to build a Unity game using this library for iOS? I have both windows machine and a macbook |
@DataGreed why do you think there is none? |
@hiradyazdan because I did not find any code generator version working on macOS |
@DataGreed there were some issues, but I suspect it is mainly to do with what script/dll you use to build. I use below now and it works fine now: MessagePackUniversalCodeGenerator/osx-x64/mpc.dll -i "whatever.csproj" -o "MessagePackGenerated.cs" using the dll solved my issue at least. Let me know if this works for you. Note: make sure to run it against |
#355 (comment) > dotnet /Users/kyubuns/code/MessagePack-CSharp/bin/MessagePack.UniversalCodeGenerator/Debug/netcoreapp2.1/mpc.dll -i Game/Serializable.csproj -o test.cs
Project Compilation Start:Game/Serializable.csproj
Unhandled Error:System.IO.FileNotFoundException: Could not find file '/Users/kyubuns/code/Hoge/Game/Temp/bin/Debug/MessagePack.dll'.
File name: '/Users/kyubuns/code/Hoge/Game/Temp/bin/Debug/MessagePack.dll'
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at Roslyn.Utilities.FileUtilities.OpenFileStream(String path) in /_/src/Compilers/Core/Portable/FileSystem/FileUtilities.cs:line 402
at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation) in /_/src/Compilers/Core/Portable/MetadataReference/MetadataReference.cs:line 232
at MessagePack.CodeGenerator.RoslynExtensions.GetWorkspaceFromBuild(Build build, String[] preprocessorSymbols) in /Users/kyubuns/code/MessagePack-CSharp/src/MessagePack.UniversalCodeGenerator/Utils/RoslynExtensions.cs:line 248
at MessagePack.CodeGenerator.RoslynExtensions.GetCompilationFromProject(String csprojPath, String[] preprocessorSymbols) in /Users/kyubuns/code/MessagePack-CSharp/src/MessagePack.UniversalCodeGenerator/Utils/RoslynExtensions.cs:line 283
at MessagePack.CodeGenerator.TypeCollector..ctor(String csProjPath, IEnumerable`1 conditinalSymbols, Boolean disallowInternal, Boolean isForceUseMap) in /Users/kyubuns/code/MessagePack-CSharp/src/MessagePack.UniversalCodeGenerator/CodeAnalysis/TypeCollector.cs:line 186
at MessagePack.CodeGenerator.Program.Main(String[] args) in /Users/kyubuns/code/MessagePack-CSharp/src/MessagePack.UniversalCodeGenerator/Program.cs:line 31 |
@kyubuns have you referenced messagepack.dll in your csproj? |
@hiradyazdan
|
@kyubuns when using asmdefs, make sure you're not referencing MessagePack.dll in assembly definition references anywhere as your error says it can't find the messsagepack.dll. One thing you need to know is that this is "pre code generation" and may not necessarily contain your built asmdef project as well. Also, only add your MessagePack source codes to a directory (e.g. library) in Assets directory, as messagepack needs to be used with its source than dll in unity. |
@hiradyazdan
The path is lie. I overwrite to "Library/ScriptAssemblies/". Then I had other error.
I think this error was also up in this thread, do you know anything? |
I don't think you have to change your output path. I would suggest build your project without asmdefs and and isolate your problem to main unity project template and then your current platform and then retry. Also, probably would be worth to learn more about asmdefs first before jumping right into them. |
Even myself, asmdef is only used for other benefits. |
I think new mpc generate empty GeneratedResolver always.
I got same result by sandbox/SharedData/SharedData.csproj in this repository, and own project csproj.
./osx-x64/mpc -i /Users/kyubuns/code/MessagePack-CSharp/sandbox/SharedData/SharedData.csproj -o ~/Desktop/Test.cs
The text was updated successfully, but these errors were encountered: