Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57955

Clean and sync incorrectly follows junction/directory symlinks on Windows

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      Windows Host and Agent, Jenkins ver. 2.176.1 (Pipeline in SCM)
      P4-Plugin 1.10.0
    • Similar Issues:

      Description

      I sync my client workspace in three environments Windows, Mac and Linux

      My step after syncing the workspace is to set up a symlink in each environment that points to a local third party dependencies folder used by the build.

      I'm not wishing to add my third party dependencies folder to source control as the folder is about 18GB and would vastly increase the sync time and unnecessary as this folder doesn't change.

       

      After adding the symlink and running the build, on the second run... the p4 plugin issues a force clean workspace before it syncs the workspace again.

       

      On Mac and Linux, the third party symlink is deleted and recreated each time...

      However on windows, instead of removing the link, it follows in to the link and deletes the contents of the dependencies folder, when all I am looking to to is unlink it.

       

      On windows the command I am using to create the link is:

      mklink /J "%WORKSPACE%\3rdparty" "C:\Jenkins\3rdparty"

       

      And on Mac and Linux its:

      ln -s /Jenkins/workspace/ 3rdparty

       

      I notice that the cleanup command is an "rm -rf" which I am guessing must be handled differently on the windows agent.

       

      it must be the recursive flag that's entering the folder.

      maybe whats needed is the ability to run a custom removal command. (This will also fix another issue with the fact that the Mac needs to run the rm command with sudo if not running as root user, even if it has permissions to delete and modify the workspace folder, however the plugin only issues "rm -rf" not "sudo rm -rf". which took me a while to convince my IT department to enable the root user on the mac)

       

      Thanks a lot as this one is a massive pain for me and can't seem to be able to work around it.

       

       

       

        Attachments

          Issue Links

            Activity

            Hide
            p4paul Paul Allen added a comment -

            Released in 1.10.2

            Show
            p4paul Paul Allen added a comment - Released in 1.10.2
            Hide
            kierzo Kieron Kierzo added a comment -

            This still is not fixed unfortunately Karl Wirth i'm on version 1.10.3

            Show
            kierzo Kieron Kierzo added a comment - This still is not fixed unfortunately Karl Wirth i'm on version 1.10.3
            Hide
            p4paul Paul Allen added a comment -

            Possible issue when cleaning up symbolic links on Windows. 

            Show
            p4paul Paul Allen added a comment - Possible issue when cleaning up symbolic links on Windows. 
            Hide
            p4paul Paul Allen added a comment -

            P4Java's reconcile  supports 'symlinks' not 'junctions'.  Please use:

            mklink /D "%WORKSPACE%\3rdparty" "C:\Jenkins\3rdparty" 

            'D' for a Directory Symlink.

            Show
            p4paul Paul Allen added a comment - P4Java's reconcile  supports 'symlinks' not 'junctions'.  Please use: mklink /D "%WORKSPACE%\3rdparty" "C:\Jenkins\3rdparty" 'D' for a Directory Symlink.
            Hide
            p4paul Paul Allen added a comment -

            Closing - will not support 'junctions'.

            Show
            p4paul Paul Allen added a comment - Closing - will not support 'junctions'.

              People

              • Assignee:
                msmeeth Matthew Smeeth
                Reporter:
                kierzo Kieron Kierzo
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: