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

Fix long path error on Windows build. #423

Merged
merged 4 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ jobs:
run: |
Write-Output "${{ matrix.unity-root }}${{ matrix.unity-version }}/${{ matrix.unity-path }}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Make symbolic link for Unity (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: New-Item -ItemType SymbolicLink -Path "C:\${{ matrix.unity-version }}" -Target "C:\Program Files\Unity\Hub\Editor\${{ matrix.unity-version }}"

- name: Build Sentry.Unity Solution
env:
UNITY_VERSION: ${{ matrix.unity-version }}
Expand All @@ -165,9 +170,6 @@ jobs:
run: dotnet msbuild /t:UnityEditModeTest /p:Configuration=Release

- name: Build Android Player with IL2CPP
# TODO: Remove condition once path too long issue resolved:
# PathTooLongException: Path is too long. Path: C:\Program Files\Unity\Hub\Editor\2021.1.26f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tempToolsDir\lib\monitor-x86\p2\org.eclipse.equinox.p2.engine\profileRegistry\DefaultProfile.profile\.data\org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions
if: ${{ matrix.os != 'windows-latest' && matrix.unity-version != '2021.1.26f1' }}
env:
UNITY_VERSION: ${{ matrix.unity-version }}
run: dotnet msbuild /t:UnityBuildPlayerAndroidIL2CPP /p:Configuration=Release
Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
<UnityRoot Condition="Exists('C:\Program Files\Unity\Hub\Editor\$(UnityVersion)\Editor\Data\Managed\UnityEngine.dll')">C:\Program Files\Unity\Hub\Editor\$(UnityVersion)\Editor</UnityRoot>
<!--If not using Unity Hub, tries to pick whatever Unity version is installed on the machine-->
<UnityRoot Condition="$(UnityRoot) == '' AND Exists('C:\Program Files\Unity\Editor\Data\Managed\UnityEngine.dll')">C:\Program Files\Unity\Editor</UnityRoot>
<!--Short version for GitHub Actions to avoid long path names errors on Windows-->
<UnityRoot Condition="Exists('C:\$(UnityVersion)\Editor\Data\Managed\UnityEngine.dll')">C:\$(UnityVersion)\Editor</UnityRoot>
<UnityManagedPath>$(UnityRoot)\Data\Managed</UnityManagedPath>
<UnityExec>$(UnityRoot)\Unity.exe</UnityExec>
<StandaloneBuildMethod>Builder.BuildWindowsIl2CPPPlayer</StandaloneBuildMethod>
Expand Down