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

RedistCopy.OnPostprocessBuild fails writing to Steamworks.NET.txt on Linux #350

Closed
AdriaandeJongh opened this issue Apr 26, 2020 · 5 comments

Comments

@AdriaandeJongh
Copy link

Hey there!

I get the following error every time I try to make a linux build on my mac:

DirectoryNotFoundException: Could not find a part of the path "/Users/Adriaan/SVN/Miniature/miniature-v1/Builds/Steam/Linux/HiddenFolks_Data/Plugins/x86_64/Steamworks.NET.txt".
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) (at <437ba245d8404784b9fbab9b439ac908>:0)
(wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
System.IO.StreamWriter.CreateFile (System.String path, System.Boolean append, System.Boolean checkHost) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.IO.StreamWriter..ctor (System.String path) (at <437ba245d8404784b9fbab9b439ac908>:0)
(wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string)
System.IO.File.WriteAllLines (System.String path, System.String[] contents) (at <437ba245d8404784b9fbab9b439ac908>:0)
RedistCopy.OnPostprocessBuild (UnityEditor.BuildTarget target, System.String pathToBuiltProject) (at Assets/Editor/Steamworks.NET/RedistCopy.cs:79)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
UnityEditor.Build.BuildPipelineInterfaces+AttributeCallbackWrapper.OnPostprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:177)
UnityEditor.Build.BuildPipelineInterfaces+<>c__DisplayClass17_0.<OnBuildPostProcess>b__1 (UnityEditor.Build.IPostprocessBuildWithReport bpp) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:433)
UnityEditor.Build.BuildPipelineInterfaces.InvokeCallbackInterfacesPair[T1,T2] (System.Collections.Generic.List`1[T] oneInterfaces, System.Action`1[T] invocationOne, System.Collections.Generic.List`1[T] twoInterfaces, System.Action`1[T] invocationTwo, System.Boolean exitOnFailure) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildPipelineInterfaces.cs:391)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

Going to that location, I can indeed see that that file doesn't exist. I don't have access to a Linux computer right now so haven't figured out whether the Steam integration also actually works on Linux builds of the game, but regardless it's probably good to look into this. I'm assuming because of recent changes to how Unity handles plugins that this .txt isn't copied into the plugins folder?

I'm on Unity 2019.3.10, compiling from 10.15.4, using the latest september release for this plugin.

@rlabrecque
Copy link
Owner

I'm assuming because of recent changes to how Unity handles plugins that this .txt isn't copied into the plugins folder?

Indeed, that seems to be the case.

I'm on Unity 2019.3.10, compiling from 10.15.4, using the latest september release for this plugin.

Could you try grabbing the latest from the github master branch? Going to put out a new release with it this week. IIRC there was some change to the Steamworks.NET.txt creation which may have been fixed since September.

@RudyTheDev
Copy link

Seeing the same thing on 2019.3.13f on Linux only (Windows and macOS build fine). I see the commit 9e168df that fixes the previous report of this at #278, so I grabbed that file only and will get the proper release later. The building process seems to work, although I also can't verify for sure right now as I need to set up a VM for that.

@DuneCasu
Copy link

I was having this issue on Win 10 2019.3.13f1, but updating to the latest has fixed it.

@Gelberdaniel19
Copy link

I created a fix for this but you need to change the file yourself until a fix is implemented.

  1. Go to your project>Assets>Editor>Steamworks.NET>RedistCopy.cs

  2. Find the line that has
    string pluginsDir = Path.Combine(baseDir, "Plugins");
    For me, this line is 67.

  3. Below that, add the following line:
    Directory.CreateDirectory(pluginsDir);

This works for me because the Plugins folder was never being created. This line ensures that the directory exists, and if it already exists, nothing happens. It doesn't mess up my windows or mac builds either!

Let me know if this works!

@rlabrecque
Copy link
Owner

Thanks @Gelberdaniel19 I applied that in 354bb21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants