Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

BUG: Compiling for Linux with IL2CPP from Windows fails if your system username contains a space.

Discussion in 'Editor & General Support' started by cubecoders, May 13, 2021.

  1. cubecoders

    cubecoders

    Joined:
    Dec 13, 2015
    Posts:
    4
    Issue Description:
    When Unity invokes clang++.exe - the "sysroot" argument is incorrect if the system username contains a space.

    It tries to invoke:

    C:\Users\Firstname Lastname\.............\clang.exe

    With the arguments:

    --sysroot=C:\Users\Firstname Lastname\....................\sysroots\linux...

    The resulting space means it's treated as a separate argument, and the build consequently fails.

    Affected Versions:
    Verified in 2020.3.8f1

    Reproduction Steps:

    • Create a local or domain user whose name contains a space, and such that the user directory in C:\Users\ has a space in its name.
    • Install Unity, and the `Linux Build Support (IL2CPP)` module
    • Create a new Unity Project
    • Change the project player settings under Player -> Scripting Backend to IL2CPP
    • Build the project
    • Compilation Fails
    Proposed Resolution(s):
    The correct invocation to avoid this would be to enclose the entire argument in double quotes:


    "--sysroot=C:\Users\Firstname Lastname\....................\sysroots\linux..."


    To properly preserve the spaces.

    Alternatively, allow us to chose a different directory for Unitys sysroot cache so we can place it outside of our profile directory entirely to avoid the space issue.

    It's worth noting that the sysroots are in %LOCALAPPDATA%/unity3d/cache and doesn't follow the convention of being located in the %LOCALAPPDATA%/Unity/Cache directory - and as such the environment variables to change the cache path do not apply.
     
  2. cubecoders

    cubecoders

    Joined:
    Dec 13, 2015
    Posts:
    4
    I've been trying to post the relevant stack trace and exception, but it triggers the anti-spam.
     
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
  4. cubecoders

    cubecoders

    Joined:
    Dec 13, 2015
    Posts:
    4
    I've created a matching bug report.