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

stash step on ARM loses execute bit

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • pipeline

      We have a Jenkins server with both x86 and ARM slaves. When running a `stash` pipeline step on the ARM slave, the resulting stash does not preserve the execute bit on files. Of course, it might be some other difference between the slaves than the actual architecture, but I'll need assistance in narrowing down the cause.

      As a demonstration, this pipeline job

      node('tegra-cuda') {
          deleteDir()
          sh 'dd if=/dev/zero of=dummy bs=1M count=1; chmod +x dummy; ls -l dummy'
          stash 'source'
      }
      
      node('tegra-cuda') {
          deleteDir()
          unstash 'source'
          sh 'ls -l dummy'
      }
      

      produces this output:

      [Pipeline] node
      Running on e5f011df5aa1-e069b02f in /var/lib/jenkins/workspace/ARM stash test
      [Pipeline] {
      [Pipeline] deleteDir
      [Pipeline] sh
      [ARM stash test] Running shell script
      + dd if=/dev/zero of=dummy bs=1M count=1
      1+0 records in
      1+0 records out
      1048576 bytes (1.0 MB) copied, 0.00465561 s, 225 MB/s
      + chmod +x dummy
      + ls -l dummy
      -rwxr-xr-x 1 kat kat 1048576 Jul 25 10:40 dummy
      [Pipeline] stash
      Stashed 1 file(s)
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] node
      Running on e5f011df5aa1-e069b02f in /var/lib/jenkins/workspace/ARM stash test
      [Pipeline] {
      [Pipeline] deleteDir
      [Pipeline] unstash
      [Pipeline] sh
      [ARM stash test] Running shell script
      + ls -l dummy
      -rw-r--r-- 1 kat kat 1048576 Jul 25 10:40 dummy
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS
      

      where `tegra-cuda` is a label for the Tegra X1 slave. The problem seems to be on the creation side rather than the unstashing side (verified by moving one or the other to an the x86_64 node). Using tar in an `sh` step, stashing the tarball, unstashing it, and unpacking it preserves the execute bit.

      This is a newly installed (about a week ago) Jenkins, with no data imported from old versions.

      I've filed this against core rather than a plugin, because a brief bit of code digging shows that stash is eventually implemented by `FilePath.archive`.

            jglick Jesse Glick
            bmerry Bruce Merry
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: