Odin doesn't use Unity version control API before modifying files, and tries to set GUIDs to uppercase

Issue #636 open
Ben Hymers created an issue

Looks like Odin runs a step to force update the GUIDs of its DLLs, but it doesn't use Unity's version control to do so, so in Perforce it will fail if it needs to make a change.

A related issue is that I only discovered this because Unity re-serialised a bunch of files, which made Odin's DLLs' GUIDs become lower-case (the canonical form of GUIDs in Unity), and it looks like Odin by default wants to make GUIDs upper case.

I suggest Odin should write out lower case GUIDs, and should use Unity's version control API to check out files before writing to them. Thanks 🙂

1. What happened?

This error message:

Could not update asset guid for assembly Sirenix.Serialization.Config.dll. Access to the path "E:\projects\BenHymers_Davy_Gorge_1\TPC\Assets\Plugins\Sirenix\Assemblies\Sirenix.Serialization.Config.dll.meta" is denied.
Sirenix.Utilities.Editor.PersistentAssemblyGuidUpdater:LogError(Assembly, String) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.Utilities.Editor/AssemblyUtils/PersistentAssemblyGuidUpdater.cs:123)
Sirenix.Utilities.Editor.PersistentAssemblyGuidUpdater:UpdateGuids(Boolean) (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.Utilities.Editor/AssemblyUtils/PersistentAssemblyGuidUpdater.cs:99)
Sirenix.Utilities.Editor.<>c:<Init>b__0_0() (at X:/Repositories/sirenix-development/Sirenix Solution/Sirenix.Utilities.Editor/AssemblyUtils/PersistentAssemblyGuidUpdater.cs:21)

2. How can we reproduce it?

Make an ODIN DLL meta file GUID contain some lowercase characters, and version it in Perforce. To check that the error happens though, it’s enough to make the file readonly - this is what Perforce does until manually checked out.

3. If screenshots would help explain or demonstrate your issue, please include these.

4. What version of Unity are you using?


5. What version of Odin are you using? (See "Tools > Odin Inspector > About")


6. Do you have Editor Only mode enabled?


7. What operating system are you on?

Windows 10 Pro 1909

Comments (2)

  1. Tor Esa Vestergaard
    • changed status to open

    Huh, that’s interesting. To my knowledge, Unity exposes no mechanism for changing the guid of an asset, but some of our assemblies must always have the correct guids, and so our only recourse is to change the guid manually in the .meta file. I can make sure that the guid is always lower-case, though, that is an easy enough change to implement that might ameliorate this issue.

    Apart from that, I’m afraid it’s just not great to lock down Odin files in version control, because as a rule Odin assumes and relies on being able to edit itself and modify its own files in order to run properly, usually to deal with Unity’s various quirks and limitations. Disallowing this invites a bunch of issues, so we can’t really support the general case of Odin’s files being locked.

  2. Log in to comment