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

Clean and sync incorrectly follows junction/directory symlinks on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • p4-plugin
    • Windows Host and Agent, Jenkins ver. 2.176.1 (Pipeline in SCM)
      P4-Plugin 1.10.0

      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.

       

       

       

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

              Created:
              Updated:
              Resolved: