Stash and archive should follow symlinks. Otherwise a symlink that the pipeline tries to archive is broken, a broken symlink is unstashed, unarchived or copied from another job, an error should be thrown.

          [JENKINS-54998] Stash and archive should refuse symlinks

          Jesse Glick added a comment -

          Presence of symlinks or other special files in the input should just be treated as an error.

          Jesse Glick added a comment - Presence of symlinks or other special files in the input should just be treated as an error.

          Chris Dore added a comment -

          jglick why should a symlink be an error?

          Since symlinks are not preserved, we abandoned using stash and instead we are now allocating a node for the entire pipeline, even when that node could be released back to the pool during certain stages. I would love to revisit our workaround and improve node utilization, having stash handle symlinks would make this very easy. Are there other alternative ideas to allow a pipeline to save state containing symlinks across stages on different nodes/workspaces?

          Chris Dore added a comment - jglick why should a symlink be an error? Since symlinks are not preserved, we abandoned using stash and instead we are now allocating a node for the entire pipeline, even when that node could be released back to the pool during certain stages. I would love to revisit our workaround and improve node utilization, having stash handle symlinks would make this very easy. Are there other alternative ideas to allow a pipeline to save state containing symlinks across stages on different nodes/workspaces?

          Jesse Glick added a comment -

          Use tar and decide in your script which options to pass to get the desired behavior: preserving symlinks, preserving other special files, preserving owner, preserving mode, etc.

          Jesse Glick added a comment - Use tar and decide in your script which options to pass to get the desired behavior: preserving symlinks, preserving other special files, preserving owner, preserving mode, etc.

          Jean-Luc Pé added a comment -

          I am facing the same issue I also consider as a bug.
          And I really do not understand why I should have to tar before stash and untar after unstash just because stash does not manage symlinks.
          For the best, an option "keep symlink target" should be available. If set, stash should save both the symlink and the target. And if the target is a directory, its content should also be saved. IMHO, the default value for this option should be true. Just because I do not see any good reason to save some sort of hollow shell.

          Jean-Luc Pé added a comment - I am facing the same issue I also consider as a bug. And I really do not understand why I should have to tar before stash and untar after unstash just because stash does not manage symlinks. For the best, an option "keep symlink target" should be available. If set, stash should save both the symlink and the target. And if the target is a directory, its content should also be saved. IMHO, the default value for this option should be true. Just because I do not see any good reason to save some sort of hollow shell.

            Unassigned Unassigned
            neothethird Jan Sprinz
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: