Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug Generate Bindings fails if project is on a non-C drive

Discussion in 'Cloud Code' started by BackgroundMover, Apr 2, 2024.

  1. BackgroundMover

    BackgroundMover

    Joined:
    May 9, 2015
    Posts:
    241
    I submitted a bug report, but if anyone is failing to generate bindings from a CCM asset, maybe its because your project is on a different drive than C:

    Notice in
    Packages/com.unity.services.cloudcode/Editor/Authoring/Deployment/Modules/FileSystem.cs

    on line 60, theres a call to Directory.Move()

    One of the exceptions listed is, if attempting to move the directory to a different volume
    Directory.Move(String, String) Method (System.IO) | Microsoft Learn

    So if theres anywhere else in Unity that uses Directory.Move() and copying from TEMP into the project, this bug could probably appear there as well

    Looking at
    Packages\com.unity.services.cloudcode\Editor\Authoring\Modules\Bindings\CloudCodeModuleBindingsGenerator.cs

    its probably that
    GetSolutionCompilationOutputPath()

    GetBindingsGenerationOutputTempFolder()

    are using
    Path.GetTempPath()

    instead of the project
    /temp
    directory
     
    Last edited: Apr 2, 2024
    Kurutah likes this.
  2. GabKBelmonte

    GabKBelmonte

    Unity Technologies

    Joined:
    Dec 14, 2021
    Posts:
    149
    Hey!

    I'm on the team that developed this, do you mind linking the ticket? I'll make sure it gets addressed

    Cheers!
     
  3. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,922
  4. unity_rLrstvXScQEvow

    unity_rLrstvXScQEvow

    Joined:
    Mar 4, 2019
    Posts:
    32
    It's exactly the same for me. Did you copy the project to C:/, create the bindings and then delete the project again? I wouldn't want to continue working on C:/.
     
  5. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,922
    Yes, I temporarily moved the project to C: just to generate the bindings, then moved it back.
     
    unity_rLrstvXScQEvow likes this.
  6. BackgroundMover

    BackgroundMover

    Joined:
    May 9, 2015
    Posts:
    241
    Another workaround is to modify the Cloud Code package source
    Library\PackageCache\com.unity.services.cloudcode\Editor\Authoring\Modules\Bindings\CloudCodeModuleBindingsGenerator.cs

    line 238
    change Path.GetTempPath() to "/temp"

    or without changing source, another workaround might be to change your system's Environment Variables, and point TEMP and TMP to a new temp folder on your project's drive. But I hven't tested this
     
    CodeSmile likes this.