Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG] Unity crash on symlink since 2021.2.0b14+ and 2022.1.0a9+ #61

Closed
ghost opened this issue Oct 26, 2021 · 7 comments
Closed

[BUG] Unity crash on symlink since 2021.2.0b14+ and 2022.1.0a9+ #61

ghost opened this issue Oct 26, 2021 · 7 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Oct 26, 2021

Describe the bug
ParrelSync doesn't work with Unity 2021.2.0b14+ and 2022.1.0a9+ due to a bug in Unity.

To Reproduce
Steps to reproduce the behavior:

  1. Create project with Unity 2021.2.0b14+
  2. Clone
  3. Open cloned project
  4. Crash in 0x00007ff762cbfee1 (Unity) OnDemandScheduler::SetStandbyWorkerCount

https://issuetracker.unity3d.com/issues/crash-on-ondemandscheduler-setstandbyworkercount-when-opening-a-project-with-a-symbolic-link-in-it
It seems Unity has problem with symbolic links in latest versions.
I am not sure if it's easy to workaround on ParrelSync side (probably not) so please upvote this link so that this gets Unity attention!

@ghost ghost added the bug Something isn't working label Oct 26, 2021
@Hadoukanen
Copy link

I got stopped in my tracks due to this as well.

@jmguillemette
Copy link

just tripped on this as well

@Hadoukanen
Copy link

I manage to get mine working by disabling Directory Monitoring under Asset Pipeline in the prefs. Symlinks does not work with it..
Capture
.

@ghost
Copy link
Author

ghost commented Nov 1, 2021

It's now part of "Known Issues in 2021.2.0f1":

Asset Import Pipeline: There is a crash in OnDemandScheduler::SetStandbyWorkerCount when opening a project with a symbolic link in it. (1370389)

@brogan89
Copy link

brogan89 commented Nov 1, 2021

I made some editor methods that just copy the project to a clone. Its not ideal as it takes much longer, but its working fine for now. Its not that bad when just syncing the scripts only and stuff. It will do for the time being anyway.

		[MenuItem("Sync/All", true)]
		[MenuItem("Sync/Scripts", true)]
		[MenuItem("Sync/Prefabs", true)]
		[MenuItem("Sync/Scenes", true)]
		private static bool IsTheClone() => !Directory.GetCurrentDirectory().Contains("_clone");
		[MenuItem("Sync/All")] private static void SyncProject() => SyncPath("Assets", "Packages", "ProjectSettings");
		[MenuItem("Sync/Scripts")] private static void SyncScriptsFolder() => SyncPath("Assets/Scripts");
		[MenuItem("Sync/Prefabs")] private static void SyncPrefabsFolder() => SyncPath("Assets/Prefabs");
		[MenuItem("Sync/Scenes")] private static void SyncScenesFolder() => SyncPath("Assets/Scenes");

		private static void SyncPath(params string[] paths)
		{
			foreach (var path in paths)
			{
				var oldRoot = Directory.GetCurrentDirectory();
				var oldFolder = $"{oldRoot}/{path}";

				var newRoot = $"{oldRoot}_clone";
				var newFolder = $"{newRoot}/{path}";
				
				// create root
				Directory.CreateDirectory(newRoot);
				SyncDir(oldFolder, newFolder);
			}
		}

		private static void SyncDir(string sourcePath, string targetPath)
		{
			if (!Directory.Exists(targetPath))
				Directory.CreateDirectory(targetPath);
			
			// CopyFilesRecursively
			//Now Create all of the directories
			foreach (string dirPath in Directory.GetDirectories(sourcePath, "*", SearchOption.AllDirectories))
				Directory.CreateDirectory(dirPath.Replace(sourcePath, targetPath));

			//Copy all the files & Replaces any files with the same name
			foreach (string newPath in Directory.GetFiles(sourcePath, "*.*",SearchOption.AllDirectories))
				File.Copy(newPath, newPath.Replace(sourcePath, targetPath), true);
			
			Debug.Log($"Synced: <b>{sourcePath}</b> to <b>{targetPath}</b>");
		}

@brogan89
Copy link

brogan89 commented Nov 1, 2021

I manage to get mine working by disabling Directory Monitoring under Asset Pipeline in the prefs. Symlinks does not work with it.. Capture .

This also works too. Thanks for the tip :)

@ghost
Copy link
Author

ghost commented Nov 15, 2021

image
Source: https://issuetracker.unity3d.com/issues/crash-on-ondemandscheduler-setstandbyworkercount-when-opening-a-project-with-a-symbolic-link-in-it

szymonm992 added a commit to szymonm992/NGP-GL that referenced this issue Oct 7, 2022
…er to stop the crashes on startup

the crashes were cause to relative path, disabling some settings helped (directory monitoring)
heres the link to bugfix
VeriorPies/ParrelSync#61
@314pies 314pies closed this as completed May 19, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants