• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • mercurial-plugin
    • None

      I created a Mercurial instance under the global configuration. I then enabled "install automatically". I then configured a job to use this Mercurial instance on an Ubuntu slave node.

      When I run the job, it fails with:

      $ /usr/bin/hg clone --rev default --noupdate https://host.com/hg/gstreamer-android/ /home/builds/.jenkins/workspace/GStreamer_Android_snapshot
      ERROR: Failed to clone https://host.com/hg/gstreamer-android/ because hg could not be found; check that you've properly configured your Mercurial installation
      ERROR: Failed to clone https://host.com/hg/gstreamer-android/
      

      Sure enough, /usr/bin/hg does not exist yet the tool auto-installer is not kicking in.

      The Mercurial auto-installer has two sub-options:

      1. Extract .zip/.tar.gz
      2. Run command

      I don't know how where to get the Mercurial binaries for Ubuntu in *.zip or *.tar.gz form (the sources are posted online, but not the binaries). As for "run command" I know "sudo apt-get install mercurial" will work but this requires root access and I cannot grant Jenkins root access, for security reasons.

      Please explain how this is supposed to work. Is this a bug or am I misunderstanding how to configure this?

          [JENKINS-15385] Easier Mercurial auto-installer

          Jesse Glick added a comment -

          For the ZIP/tarball extraction method, you would have to supply your own binaries suited to the platform you are running on; I do not know of any published binaries for Ubuntu available in this format.

          For the command installer, yes you could sudo apt-get install mercurial if the slave is a sudoer, or you could do anything else resulting in a valid Hg installation, such as compiling from sources.

          Jesse Glick added a comment - For the ZIP/tarball extraction method, you would have to supply your own binaries suited to the platform you are running on; I do not know of any published binaries for Ubuntu available in this format. For the command installer, yes you could sudo apt-get install mercurial if the slave is a sudoer, or you could do anything else resulting in a valid Hg installation, such as compiling from sources.

          cowwoc added a comment -

          Jesse,

          Good answer but shouldn't this be documented on the plugin page? Is it possible to convert this issue into a RFE for a documentation improvement?

          cowwoc added a comment - Jesse, Good answer but shouldn't this be documented on the plugin page? Is it possible to convert this issue into a RFE for a documentation improvement?

          Jesse Glick added a comment -

          @cowwoc: wiki improvements always welcome, no need to ask permission!

          And of course if you come across a reliable source of Linux binary bundles please write it up. Generally the prebuilt binaries are provided as system packages which is not great for use from Jenkins. Another tricky aspect is the fact that a Python runtime is required, but might not be preinstalled on the OS. For a while I was looking at the effort to make Mercurial run in Jython, which would be greatly convenient for Jenkins slaves, but last I checked the performance was abysmal.

          Jesse Glick added a comment - @cowwoc: wiki improvements always welcome, no need to ask permission! And of course if you come across a reliable source of Linux binary bundles please write it up. Generally the prebuilt binaries are provided as system packages which is not great for use from Jenkins. Another tricky aspect is the fact that a Python runtime is required, but might not be preinstalled on the OS. For a while I was looking at the effort to make Mercurial run in Jython, which would be greatly convenient for Jenkins slaves, but last I checked the performance was abysmal.

          cowwoc added a comment -

          Good news. I did just discover such a source.

          If you go to http://mercurial.selenic.com/wiki/Download#Linux_.28others.29 then click on Arch Linux you will notice they provide binary packages for both 32-bit and 64-bit linux. I just tried them and I can confirm they work great. A standalone version of Python is bundled.

          cowwoc added a comment - Good news. I did just discover such a source. If you go to http://mercurial.selenic.com/wiki/Download#Linux_.28others.29 then click on Arch Linux you will notice they provide binary packages for both 32-bit and 64-bit linux. I just tried them and I can confirm they work great. A standalone version of Python is bundled.

          Jesse Glick added a comment -

          http://www.archlinux.org/packages/extra/i686/mercurial/download/ does seem to work although for use from the tool auto-installer it would either need to be repackaged using GZip and published, or FilePath.installIfNecessaryFrom should be made to use org.tukaani:xz where necessary.

          Jesse Glick added a comment - http://www.archlinux.org/packages/extra/i686/mercurial/download/ does seem to work although for use from the tool auto-installer it would either need to be repackaged using GZip and published, or FilePath.installIfNecessaryFrom should be made to use org.tukaani:xz where necessary.

          cowwoc added a comment -

          I would recommend adding xz support, assuming it's not too difficult to do.

          cowwoc added a comment - I would recommend adding xz support, assuming it's not too difficult to do.

          Jesse Glick added a comment -

          @cowwoc: file an RFE in core for XZ support; I think it would be easy, though it adds a (small) dependency.

          In the meantime I successfully experimented with the ArchLinux download (using a shell command to download, uncompress, and unpack) and wrote up a quick tip in the wiki. Thanks for finding this.

          Jesse Glick added a comment - @cowwoc: file an RFE in core for XZ support; I think it would be easy, though it adds a (small) dependency. In the meantime I successfully experimented with the ArchLinux download (using a shell command to download, uncompress, and unpack) and wrote up a quick tip in the wiki. Thanks for finding this.

          Jesse Glick added a comment -

          Reopening for another possibility: for the plugin to define a Linux-only Hg installer based on the ArchLinux packages; would detect machine architecture for you, and handle download and unpacking. There would be no choice of version here: you just get the latest version AL built, which seems current.

          I did not find binaries for other platforms (Win, Mac) that looked suitable for this.

          Jesse Glick added a comment - Reopening for another possibility: for the plugin to define a Linux-only Hg installer based on the ArchLinux packages; would detect machine architecture for you, and handle download and unpacking. There would be no choice of version here: you just get the latest version AL built, which seems current. I did not find binaries for other platforms (Win, Mac) that looked suitable for this.

            jglick Jesse Glick
            cowwoc cowwoc
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: