game-ci / unity-builder

Build Unity projects for different platforms
https://github.com/marketplace/actions/unity-builder
MIT License
857 stars 253 forks source link

Symbolically linked Library fails on unity-builder@v4 #603

Closed DenverGylee closed 11 months ago

DenverGylee commented 1 year ago

Bug description

This is on a self-hosted runner. I have a fairly large project that can not use GitHub's cache for my project's Library folder between builds. I wrote a script to symbolically link my Library folder to an auto-generated folder at ~/.cache/PROJECT_NAME/Library.

The unity-builder step currently fails if I use a symbolically referenced folder. My current workaround is to rsync back and forth my Library folder with the ~/.cache/PROJECT_NAME/Library but this adds a signficant overhead to my pipeline runtimes.

How to reproduce

  1. After a successful Library build, move the folder to ~/.cache/PROJECT_NAME/Library. mv ./PROJECT_NAME/Library ~/.cache/PROJECT_NAME/Library
  2. Create a symbolic link between the paths. ln -s ~/.cache/PROJECT_NAME/Library ./PROJECT_NAME/Library
  3. Run the unity-builder@v4 action in the project. Here is a reference to my actions.
    - name: Build for Windows
        id: build-for-windows
        uses: game-ci/unity-builder@v4
        env:
          UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          projectPath: PROJECT_NAME
          allowDirtyBuild: true
          versioning: Semantic
          targetPlatform: StandaloneWindows
          sshAgent: ${{ env.SSH_AUTH_SOCK }}
          runAsHostUser: true

Expected behavior

Builds would complete as expected rather than utilizing rsync back and forth.

AndrewKahr commented 1 year ago

Did this work pre-v4? This looks more like an issue with docker not respecting symlinks within mounted folders

DenverGylee commented 1 year ago

Ah, I had not considered that. It very likely is a Docker problem then. Is there any configuration I can do to mount the symlinked directory as well? I'm not seeing that in the documentation.

DenverGylee commented 11 months ago

Hi, just wanted to check if there is a reasonable way to do this without having to configure my own Docker image. I have a workaround right now with rsync but it's signficantly slower and requires double the effective drive space.

DenverGylee commented 11 months ago

I'm going to close my issue out as this seems pretty far out of scope. Docker doesn't seem to support symlinks and an alternative may be just mv rather than rsync